/* App del cliente: “Mis pedidos” */

.app-body {
  background:
    radial-gradient(70% 40% at 50% -6%, rgba(240, 132, 42, 0.22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100svh;
}
.app-shell {
  width: min(600px, 100% - 28px);
  margin-inline: auto;
  padding-bottom: calc(120px + var(--safe-b));
}
.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 0 18px;
}
.app-top .brand small {
  letter-spacing: 0.18em;
}
.view {
  display: grid;
  gap: 16px;
  animation: viewIn 0.45s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ingreso */
.auth-card {
  padding: 32px 26px;
  text-align: center;
  margin-top: 10px;
}
.auth-card form {
  text-align: left;
}
.auth-logo {
  width: 170px;
  height: 170px;
  margin: -10px auto 8px;
  filter: drop-shadow(0 18px 40px rgba(240, 132, 42, 0.35));
}
.auth-card h1 {
  font-size: 2.3rem;
  margin-bottom: 8px;
}

/* saludo */
.hello {
  padding: 22px;
  overflow: hidden;
  position: relative;
}
.hello::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 132, 42, 0.25), transparent 65%);
  pointer-events: none;
}
.hello-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hello-top .avatar {
  width: 54px;
  height: 54px;
  font-size: 1.35rem;
}
.hello h2 {
  font-size: 1.7rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.stats div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats small {
  color: var(--dim);
  font-weight: 700;
  font-size: 0.74rem;
}
.hello-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hello-ctas .btn {
  padding: 0 12px;
}

/* seguimiento */
.track {
  padding: 22px;
  border-color: rgba(244, 184, 68, 0.3);
  box-shadow: var(--glow), var(--shadow);
}
.track + .track {
  margin-top: 4px;
}
.track-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.track-head small {
  color: var(--dim);
  font-weight: 700;
}
.track h3 {
  font-size: 1.7rem;
  margin: 14px 0 6px;
}
.track p {
  color: var(--muted);
  font-size: 0.93rem;
}
.tracker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 20px 0 10px;
}
.tracker div {
  display: grid;
  gap: 8px;
  text-align: center;
}
.tracker i {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.tracker .is-done i {
  background: var(--grad);
}
.tracker .is-now i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: sweep 1.6s infinite;
}
@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
.tracker span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--dim);
  line-height: 1.2;
}
.tracker .is-done span {
  color: var(--muted);
}
.tracker .is-now span {
  color: var(--gold);
}
.track-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.track-foot b {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5vw, 1.35rem);
  white-space: nowrap;
}
.track-foot .btns {
  display: flex;
  gap: 8px;
}

/* historial */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.list-head h3 {
  font-size: 1.45rem;
}
.order-list {
  display: grid;
  gap: 10px;
}
.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    border-color 0.2s,
    transform 0.2s var(--ease);
}
.order-row:hover {
  border-color: rgba(244, 184, 68, 0.35);
  transform: translateY(-2px);
}
.order-row .code {
  font-weight: 800;
}
.order-row .date {
  color: var(--dim);
  font-size: 0.82rem;
  font-weight: 700;
}
.order-row .items {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-row .total {
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-row .row2 {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* detalle */
.sheet .co-main {
  padding: 20px 22px calc(24px + var(--safe-b));
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.timeline li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 16px;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 22px;
  bottom: 0;
  width: 2px;
  background: var(--surface-3);
}
.timeline li:last-child::before {
  display: none;
}
.timeline .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--dim);
  position: relative;
  z-index: 1;
}
.timeline .dot .ic {
  width: 14px;
  height: 14px;
}
.timeline li.is-done .dot {
  background: var(--grad);
  color: #1b0d05;
}
.timeline li.is-done::before {
  background: rgba(244, 184, 68, 0.5);
}
.timeline li.is-now .dot {
  box-shadow: 0 0 0 6px rgba(244, 184, 68, 0.15);
}
.timeline b {
  display: block;
  font-size: 0.95rem;
}
.timeline small {
  color: var(--dim);
  font-weight: 600;
  font-size: 0.8rem;
}
.timeline li:not(.is-done) b {
  color: var(--dim);
}
.detail-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.detail-block > h4 {
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.ditem {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.ditem span {
  color: var(--muted);
}
.ditem small {
  display: block;
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 600;
}
.ditem b {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mini-map {
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  margin-top: 12px;
}
.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.profile-card {
  padding: 22px;
}
.profile-card h3 {
  font-size: 1.35rem;
  margin-bottom: 16px;
}

/* barra inferior */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 40;
  width: min(380px, calc(100% - 28px));
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px;
  border-radius: 24px;
  background: rgba(31, 25, 21, 0.86);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.tabbar button {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 0;
  transition: color 0.2s;
}
.tabbar button .ic {
  width: 22px;
  height: 22px;
}
.tabbar button.on {
  color: var(--gold);
}
.tab-cta {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #1b0d05;
  margin-top: -26px;
  box-shadow:
    0 14px 30px -10px rgba(240, 132, 42, 0.9),
    0 0 0 6px var(--bg);
}
.tab-cta .ic {
  width: 26px;
  height: 26px;
  stroke-width: 2.6;
}

.empty-orders {
  text-align: center;
  padding: 40px 20px;
  border-radius: 22px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
}
.empty-orders .ic {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: var(--gold);
}

@media (max-width: 420px) {
  .stats b {
    font-size: 1.1rem;
  }
  .hello-ctas {
    grid-template-columns: 1fr;
  }
}
