/* Styles for the orders + admin pages. */

.page { padding: 34px 20px 80px; }
.page__head { margin-bottom: 22px; }
.page__head h1 { font-size: 26px; font-weight: 800; }
.page__head p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

.lookup { display: flex; gap: 10px; margin-bottom: 26px; max-width: 520px; }

/* ------------------------------------------------------------- order card */

.order {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 16px;
}
.order__top { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.order__id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 15px; }
.order__meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.order__amount { text-align: right; }
.order__amount b { font-size: 18px; font-weight: 800; display: block; }
.order__amount small { color: var(--muted); font-size: 12px; }

.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.status--placed { background: var(--accent-soft); color: #92400e; }
.status--packed { background: #dbeafe; color: #1d4ed8; }
.status--out_for_delivery { background: #ede9fe; color: #6d28d9; }
.status--delivered { background: var(--brand-soft); color: var(--brand-600); }
.status--cancelled { background: var(--danger-soft); color: #b91c1c; }
[data-theme="dark"] .status--packed { background: #16294a; color: #93c5fd; }
[data-theme="dark"] .status--out_for_delivery { background: #2a1f4d; color: #c4b5fd; }
[data-theme="dark"] .status--placed { color: #fbbf24; }
[data-theme="dark"] .status--cancelled { color: #fca5a5; }

.track { display: flex; margin: 20px 0 4px; }
.track__step { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.track__step::before {
  content: ""; display: block; width: 20px; height: 20px; border-radius: 99px; margin: 0 auto 8px;
  background: var(--line); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line);
}
.track__step::after {
  content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: -1;
}
.track__step:first-child::after { display: none; }
.track { position: relative; z-index: 0; }
.track__step.is-done { color: var(--brand-600); }
.track__step.is-done::before { background: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.track__step.is-done::after { background: var(--brand); }
.track__step.is-cancelled { color: var(--danger); }

.order__items { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.order__item { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 11px 6px 6px; font-size: 12.5px; }
.order__item img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.order__item b { font-weight: 600; }
.order__item span { color: var(--muted); }

.order__addr { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.order__addr b { color: var(--text); }

/* ------------------------------------------------------------------ admin */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.stat__ico { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-600);
  display: grid; place-items: center; margin-bottom: 12px; }
.stat__ico svg { width: 19px; height: 19px; }
.stat b { display: block; font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.stat small { color: var(--muted); font-size: 12.5px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 22px; }
.panel__head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex;
  justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel__head h2 { font-size: 16px; font-weight: 700; }
.panel__body { padding: 4px 0; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-weight: 700; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-weight: 600; }

.bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.bar span { min-width: 130px; font-size: 13.5px; }
.bar__track { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar__track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4ade80); border-radius: 99px; }
.bar b { font-size: 13px; min-width: 46px; text-align: right; }

.admin-empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.admin-empty img { width: 150px; margin: 0 auto 14px; }

@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .lookup { flex-direction: column; }
  .table-wrap { overflow-x: auto; }
  .table { min-width: 640px; }
}

/* ============================================================== checkout */

.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--brand-600); font-weight: 500; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span:last-child { color: var(--text); font-weight: 500; }

.secure-note { display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  font-weight: 600; color: var(--brand-600); }

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }

.cbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 16px; }
.cbox h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.cbox h2 i { width: 25px; height: 25px; border-radius: 99px; background: var(--brand); color: #fff;
  font-style: normal; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }

.slots { display: flex; flex-direction: column; gap: 9px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: var(--r); cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.slot input { position: absolute; opacity: 0; }
.slot::before { content: ""; width: 19px; height: 19px; border-radius: 99px; border: 2px solid var(--line-strong);
  flex-shrink: 0; display: grid; place-items: center; }
.slot:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.slot:has(input:checked)::before { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--brand); }
.slot__body { flex: 1; }
.slot__body strong { display: block; font-size: 13.5px; }
.slot__body small { color: var(--muted); font-size: 12px; }
.slot__fee { font-size: 12.5px; font-weight: 700; color: var(--brand-600); }

.summary { position: sticky; top: 90px; }
.summary__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.summary__card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.summary__items { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; margin-bottom: 14px; }
.summary__item { display: flex; align-items: center; gap: 11px; font-size: 13px; }
.summary__item img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.summary__item div { flex: 1; min-width: 0; }
.summary__item strong { display: block; font-weight: 600; font-size: 13px; }
.summary__item small { color: var(--muted); font-size: 12px; }
.summary__card .btn--block { margin-top: 14px; }
.summary__legal { color: var(--faint); font-size: 11.5px; text-align: center; margin: 10px 0 0; line-height: 1.5; }

.coupon-msg { font-size: 12.5px; font-weight: 600; color: var(--brand-600); margin: -8px 0 12px; }
.coupon-msg--err { color: var(--danger); }

.trustrow { display: flex; justify-content: space-around; gap: 8px; margin-top: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.trustrow span { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  font-size: 11.5px; font-weight: 600; color: var(--muted); }
.trustrow .ic { color: var(--brand-600); }

/* =========================================================== confirmation */

.confirm { max-width: 900px; margin: 0 auto; }
.confirm__hero { text-align: center; padding: 20px 0 32px; }
.confirm__hero img { margin: 0 auto 16px; }
.confirm__hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.confirm__hero p { color: var(--muted); margin: 0 0 16px; }
.confirm__id { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700; background: var(--brand-soft); color: var(--brand-600); padding: 9px 18px;
  border-radius: var(--r-sm); letter-spacing: .06em; }
.confirm__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.confirm__actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

.kv { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv span { display: flex; align-items: center; gap: 7px; color: var(--muted); min-width: 108px; flex-shrink: 0; }
.kv span .ic { width: 15px; height: 15px; }
.kv b { font-weight: 600; }

/* ================================================================== pdp */

.pdp { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 34px; align-items: start; margin-bottom: 20px; }
.pdp__media { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); }
/* height:auto is required — the img carries a height attribute, and a definite
   height makes the browser ignore aspect-ratio. */
.pdp__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.pdp__body h1 { font-size: 30px; font-weight: 800; margin: 10px 0 4px; }
.pdp__unit { color: var(--muted); font-size: 14px; }
.pdp__desc { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 14px 0 18px; }
.pdp__price { display: flex; align-items: baseline; gap: 10px; }
.pdp__price b { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.pdp__tax { color: var(--faint); font-size: 12px; }
.pdp__cta { display: flex; gap: 12px; align-items: center; margin: 20px 0 24px; flex-wrap: wrap; }
.stepper--lg button { width: 42px; height: 46px; font-size: 20px; }
.stepper--lg span { min-width: 40px; font-size: 15px; }

.pdp__facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pdp__facts li { display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); }
.pdp__facts .ic { color: var(--brand-600); width: 19px; height: 19px; }
.pdp__facts strong { display: block; font-size: 13px; }
.pdp__facts small { color: var(--muted); font-size: 12px; }

@media (max-width: 940px) {
  .checkout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .confirm__grid { grid-template-columns: 1fr; }
  .pdp { grid-template-columns: 1fr; gap: 22px; }
  .pdp__body h1 { font-size: 24px; }
  .pdp__facts { grid-template-columns: 1fr; }
  .confirm__actions { flex-direction: column; }
}

/* ================================================================== auth */

.accountbtn { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; height: 42px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: border-color .15s var(--ease); }
.accountbtn:hover { border-color: var(--brand); color: var(--brand-600); }
.accountbtn .ic { color: var(--brand-600); }

.auth { display: grid; grid-template-columns: 1fr 460px; gap: 40px; align-items: center;
  min-height: 68vh; max-width: 1000px; margin: 0 auto; }
.auth__pitch { text-align: center; }
.auth__pitch img { margin: 0 auto 18px; }
.auth__pitch h2 { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.auth__pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  gap: 10px; text-align: left; max-width: 300px; margin-inline: auto; }
.auth__pitch li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.auth__pitch .ic { color: var(--brand); width: 16px; height: 16px; }

.auth__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 26px; box-shadow: var(--shadow); }
.auth__form h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth__sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.auth__form .btn--block { margin-top: 6px; }
.auth__switch { text-align: center; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }
.auth__switch button { color: var(--brand-600); font-weight: 600; }
.auth__switch button:hover { text-decoration: underline; }
.auth__note { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 1.5; }
.auth__note .ic { width: 15px; height: 15px; margin-top: 1px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); margin-bottom: 22px; }
.tab { flex: 1; padding: 9px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.pw { position: relative; }
.pw input { padding-right: 62px !important; }
.pw__toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600; color: var(--brand-600); padding: 4px 6px; }

.meter { height: 4px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--danger);
  transition: width .2s var(--ease), background .2s var(--ease); }
.meter i.strength-2 { background: var(--accent); }
.meter i.strength-3 { background: #84cc16; }
.meter i.strength-4 { background: var(--brand); }

/* =============================================================== account */

.acc-head { display: flex; align-items: center; gap: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.avatar { width: 62px; height: 62px; border-radius: 99px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #4ade80); color: #fff; font-size: 22px; font-weight: 800;
  flex-shrink: 0; }
.acc-head h1 { font-size: 22px; font-weight: 800; }
.acc-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.acc-head small { color: var(--faint); font-size: 12px; }

.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.acc-grid .cbox h2 i { background: var(--brand-soft); color: var(--brand-600); width: 28px; height: 28px; }
.acc-grid .cbox h2 i .ic { width: 15px; height: 15px; }

.muted-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

.addr { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; }
.addr.is-default { border-color: var(--brand); background: var(--brand-tint); }
.addr__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.addr__head strong { font-size: 13.5px; }
.addr p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.addr__actions { display: flex; gap: 14px; margin-top: 10px; }
.chip-mini { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--brand); color: #fff; padding: 3px 8px; border-radius: var(--r-full); }

.linkbtn { font-size: 12.5px; font-weight: 600; color: var(--brand-600); }
.linkbtn:hover { text-decoration: underline; }
.linkbtn--danger { color: var(--danger); }

.mini-order { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 9px; transition: border-color .15s var(--ease); }
.mini-order:hover { border-color: var(--brand); }
.mini-order__thumbs { display: flex; }
.mini-order__thumbs img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover;
  border: 2px solid var(--surface); margin-left: -10px; }
.mini-order__thumbs img:first-child { margin-left: 0; }
.mini-order strong { display: block; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mini-order small { color: var(--muted); font-size: 12px; }
.mini-order b { display: block; font-size: 14px; }
.mini-order .status { margin-top: 4px; }

/* Checkout sign-in states */
.signin-cta, .signed-as { display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-radius: var(--r-lg); margin-bottom: 16px; }
.signin-cta { background: var(--brand-tint); border: 1px dashed var(--brand); justify-content: space-between; }
.signin-cta > div { display: flex; align-items: center; gap: 12px; }
.signin-cta .ic, .signed-as .ic { color: var(--brand-600); }
.signin-cta strong { display: block; font-size: 14px; }
.signin-cta small { color: var(--muted); font-size: 12.5px; }
.signed-as { background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.signed-as span { flex: 1; color: var(--muted); }
.signed-as b { color: var(--text); }
.addrpick { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }

@media (max-width: 940px) {
  .auth { grid-template-columns: 1fr; gap: 24px; }
  .auth__pitch { display: none; }
  .acc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .accountbtn span { display: none; }
  .accountbtn { padding: 0; width: 42px; justify-content: center; }
  .signin-cta { flex-direction: column; align-items: stretch; }
}
