/* order.css — Nicho App */
:root{
  --surface: #ffffff;
  --muted: #6B7280;
  --line: #E5E7EB;
}

body{
  background:#F9FAFB;
  padding-bottom: 24px;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.topbar-actions{ display:flex; align-items:center; gap:10px; }
.icon-btn{
  position:relative;
  width:42px; height:42px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(229,231,235,.8);
  text-decoration:none;
  color: var(--dark);
}
.icon-btn:active{ transform: scale(.98); }
.badge{
  position:absolute;
  top:4px; right:4px;
  background:#EF4444;
  color:#fff;
  min-width:18px; height:18px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 999px;
  font-size:.7rem;
  font-weight:800;
  border:2px solid #fff;
}
.hidden{ display:none !important; }

.auth-gate{
  margin: 16px 5%;
  padding: 22px 18px;
  border-radius: 18px;
  border: 1px solid rgba(37,99,235,.16);
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.10), transparent 42%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 16px 38px rgba(15,23,42,.08);
  text-align: center;
}
.auth-gate-icon{
  width: 58px;
  height: 58px;
  border-radius: 18px;
  margin: 0 auto 12px;
  display:grid;
  place-items:center;
  color: var(--primary);
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.18);
  font-size: 1.35rem;
}
.auth-gate h3{
  margin: 0;
  color:#111827;
  font-size: 1.15rem;
}
.auth-gate p{
  margin: 10px auto 0;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 700;
}
.auth-gate-actions{
  margin-top: 16px;
  display:flex;
  gap: 10px;
  justify-content:center;
  flex-wrap: wrap;
}

.filters{ padding: 10px 5% 2px; }
.filters-row{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.filters-row::-webkit-scrollbar{ display:none; }

.fchip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #111827;
  font-weight: 800;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}
.fchip small{
  font-weight:900;
  color:#111827;
  background:#F3F4F6;
  border:1px solid var(--line);
  padding: 2px 8px;
  border-radius:999px;
}
.fchip.active{
  background: var(--dark);
  color:#fff;
  border-color: var(--dark);
}
.fchip.active small{
  background: rgba(255,255,255,.9);
  border-color: transparent;
}

.loading{
  margin: 12px 5%;
  display:flex;
  gap:12px;
  align-items:center;
  padding: 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 16px;
}
.spinner-lg{
  width:28px; height:28px;
  border-radius:50%;
  border: 3px solid #E5E7EB;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
.loading-title{ font-weight:900; color:#111827; }
.loading-sub{ color: var(--muted); font-size:.9rem; margin-top:2px; }

@keyframes spin { to{ transform: rotate(360deg); } }

.empty{
  margin: 16px 5%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align:center;
}
.empty i{ font-size:2rem; color:#94A3B8; }
.empty h3{ margin: 10px 0 6px; }
.empty p{ color: var(--muted); margin: 0 0 12px; }

.orders{ padding: 0 5% 20px; display:grid; gap:12px; }

.oc{
  background: var(--surface);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.oc summary{
  list-style:none;
  cursor:pointer;
  padding: 12px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.oc summary::-webkit-details-marker{ display:none; }
.oc-head{
  flex:1;
  min-width:0;
}
.trow{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.tname{
  font-weight: 900;
  color:#111827;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.oid{
  color: var(--muted);
  font-weight: 800;
  font-size: .9rem;
}
.meta{
  margin-top: 6px;
  color: var(--muted);
  font-size:.9rem;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.chip{
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size:.78rem;
  background: #F3F4F6;
  border: 1px solid rgba(229,231,235,.9);
  color:#111827;
}
.schip{ border:none; }
.schip.pendiente{ background: rgba(59,130,246,.14); color:#2563EB; }
.schip.procesando{ background: rgba(245,158,11,.16); color:#B45309; }
.schip.enviado{ background: rgba(124,58,237,.14); color:#6D28D9; }
.schip.entregado{ background: rgba(34,197,94,.16); color:#15803D; }
.schip.anulado{ background: rgba(239,68,68,.14); color:#B91C1C; }

.avatar{
  width:34px;height:34px;
  border-radius: 999px;
  background:#E5E7EB;
  overflow:hidden;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
  font-weight: 900;
  color:#111827;
}
.avatar img{ width:100%; height:100%; object-fit:cover; display:block; }

.oc-body{
  padding: 0 12px 12px;
  border-top: 1px solid rgba(229,231,235,.7);
}
.timeline{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 12px 0 6px;
}
.step{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width: 70px;
}
.dot{
  width: 28px;height: 28px;
  border-radius:999px;
  display:grid;place-items:center;
  background:#E5E7EB;
  color:#fff;
  font-size: 12px;
  font-weight: 900;
}
.dot.on{ background: var(--primary); }
.step label{ font-size:.78rem; font-weight:900; color:#64748B; text-align:center; }
.step label.on{ color:#0f172a; }

.items{
  margin-top: 8px;
  display:grid;
  gap:10px;
}
.item{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px;
  border: 1px solid rgba(229,231,235,.8);
  border-radius: 14px;
  background: #fff;
}
.item .img{
  width:42px;height:42px;
  border-radius: 10px;
  background:#F3F4F6;
  overflow:hidden;
  display:grid;place-items:center;
  flex: 0 0 auto;
}
.item .img img{ width:100%;height:100%;object-fit:cover; }
.item .info{ flex:1; min-width:0; }
.item .name{ font-weight: 900; color:#111827; overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.item .sub{ color: var(--muted); font-weight: 800; font-size:.85rem; margin-top:2px; }
.item .line{ font-weight: 900; color:#111827; }

.actions{
  margin-top: 10px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}

.btn{
  border:none;
  cursor:pointer;
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 12px;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:active{ transform: scale(.98); }
.btn-outline{
  background:#fff;
  border: 1px solid rgba(229,231,235,.9);
  color:#111827;
}
.btn-solid{
  background: var(--primary);
  color:#fff;
}
.btn-outline[disabled], .btn-solid[disabled]{ opacity:.55; cursor:not-allowed; transform:none; }

@media (max-width: 640px){
  .auth-gate-actions{
    flex-direction: column;
  }
}

.modal-backdrop{
  position:fixed; inset:0;
  background: rgba(15,23,42,.55);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  z-index:999;
}
.modal-sheet{
  width: min(720px, 100%);
  background:#fff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -18px 50px rgba(0,0,0,.25);
  overflow:hidden;
}
.modal-head{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 1px solid rgba(229,231,235,.9);
  font-weight: 900;
}
.modal-body{ padding: 14px; max-height: 65vh; overflow:auto; }
.modal-actions{
  padding: 12px 14px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  border-top: 1px solid rgba(229,231,235,.9);
}

.rrow{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 10px;
  border: 1px solid rgba(229,231,235,.85);
  border-radius: 14px;
  margin-bottom: 10px;
}
.rrow .left{ flex:1; min-width:0; }
.rrow .title{ font-weight: 900; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rrow .hint{ color: var(--muted); font-weight: 800; font-size:.85rem; margin-top:2px; }
.qty{
  display:flex; align-items:center; gap:8px;
  background:#F3F4F6;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 12px;
  padding: 6px;
}
.qty button{
  width:34px;height:34px;
  border:none;
  background:#fff;
  border-radius: 10px;
  cursor:pointer;
  font-weight: 900;
}
.qty button:active{ transform: scale(.96); }
.qty span{ min-width:18px; text-align:center; font-weight: 900; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(17,24,39,.92);
  color:#fff;
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 2000;
  opacity:0;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  font-weight: 800;
  max-width: min(560px, 92vw);
}
.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(-6px);
}
