/* ============ Threadly — Design Tokens ============ */
:root {
  --primary: #b5502e;
  --primary-dark: #94401f;
  --primary-light: #f3e1d8;
  --accent: #6b705c;
  --success: #2f7d4f;
  --danger: #c0392b;
  --warn: #c8892b;

  --bg: #faf7f2;
  --card: #ffffff;
  --text: #201a16;
  --text2: #6b625b;
  --text3: #a89e94;
  --border: #ece4da;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(32,26,22,0.06);
  --shadow-md: 0 4px 16px rgba(32,26,22,0.08);
  --shadow-lg: 0 12px 32px rgba(32,26,22,0.14);
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

[data-theme="dark"] {
  --bg: #17140f;
  --card: #221d17;
  --text: #f3ede4;
  --text2: #bcb0a1;
  --text3: #7d7264;
  --border: #332b21;
  --primary-light: #3a281d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --card: #221d17;
    --text: #f3ede4;
    --text2: #bcb0a1;
    --text3: #7d7264;
    --border: #332b21;
    --primary-light: #3a281d;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 64px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ============ Layout shell ============ */
.hidden { display: none !important; }
.page { min-height: 60vh; max-width: 600px; margin: 0 auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  max-width: 600px; margin: 0 auto;
}
.topbar .wordmark { font-size: 22px; color: var(--primary); flex-shrink: 0; }
.search-wrap { flex: 1; position: relative; }
.search-input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; outline: none; transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--primary); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); }
.topbar-icons { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.icon-btn { position: relative; color: var(--text); background: none; border: none; padding: 4px; }
.badge {
  position: absolute; top: -4px; right: -6px; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.search-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 340px; overflow-y: auto; z-index: 50;
}
.search-suggest-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item img { width: 36px; height: 44px; object-fit: cover; border-radius: 6px; }

/* ============ Bottom nav ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text3); font-size: 10px; background: none; border: none; padding: 6px 10px;
  position: relative;
}
.nav-item.active { color: var(--primary); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: none; font-weight: 600; font-size: 14px;
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Cards / grid ============ */
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }
.product-grid.list-view { grid-template-columns: 1fr; }

.product-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card .thumb-wrap { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--bg); }
.product-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .fav-btn {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 999px;
  background: rgba(255,255,255,0.85); border: none; display: flex; align-items: center; justify-content: center;
  color: var(--text2); backdrop-filter: blur(4px);
}
.product-card .fav-btn.active { color: var(--danger); }
.sale-badge {
  position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.product-card .info { padding: 10px 12px 12px; }
.product-card .brand { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.product-card .name { font-size: 13.5px; font-weight: 600; margin: 2px 0 6px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-row { display: flex; align-items: baseline; gap: 6px; }
.price { font-weight: 700; font-size: 14px; }
.price.discount { color: var(--primary); }
.price-strike { font-size: 12px; color: var(--text3); text-decoration: line-through; }
.rating-row { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--text3); }
.swatch-row { display: flex; gap: 4px; margin-top: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 999px; border: 1px solid var(--border); }

.list-view .product-card { display: flex; }
.list-view .product-card .thumb-wrap { width: 110px; aspect-ratio: 4/5; flex-shrink: 0; }
.list-view .product-card .info { flex: 1; }

/* ============ Home ============ */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; margin: 14px 16px;
  aspect-ratio: 16/8; background: linear-gradient(135deg, var(--primary-light), var(--bg));
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-content {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 24px; background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(0,0,0,0));
}
.hero-content h1 { font-family: var(--font-display); color: #fff; font-size: 28px; margin: 0 0 8px; }
.hero-content p { color: rgba(255,255,255,0.9); margin: 0 0 14px; font-size: 14px; }

.hero-carousel { position: relative; margin: 14px 16px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/8; }
.hero-carousel-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.hero-carousel-track::-webkit-scrollbar { display: none; }
.hero-carousel-slide { flex: 0 0 100%; scroll-snap-align: start; cursor: pointer; }
.hero-carousel-slide img, .hero-carousel-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.hero-carousel-dots .dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.5); transition: all var(--transition); }
.hero-carousel-dots .dot.active { background: #fff; width: 16px; }

.auth-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 16px 16px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--primary-light); border: 1px solid var(--border);
}
.auth-banner .text strong { display: block; font-size: 14px; }
.auth-banner .text span { font-size: 12.5px; color: var(--text2); }
.auth-banner .btn-row { display: flex; gap: 8px; flex-shrink: 0; }

.topbar-account-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 700; border: none; white-space: nowrap;
}

.category-strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-pill {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 68px; text-align: center;
}
.category-pill .circle {
  width: 60px; height: 60px; border-radius: 999px; overflow: hidden; background: var(--primary-light);
  border: 1px solid var(--border);
}
.category-pill .circle img { width: 100%; height: 100%; object-fit: cover; }
.category-pill span { font-size: 11px; font-weight: 600; color: var(--text2); }

.section { padding: 18px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.section-header h2 { font-family: var(--font-display); font-size: 19px; margin: 0; }
.section-header a { font-size: 12.5px; color: var(--primary); font-weight: 600; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .product-card { flex-shrink: 0; width: 160px; }

/* ============ Filter bar ============ */
.filter-bar {
  display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; border-bottom: 1px solid var(--border);
  background: var(--card); position: sticky; top: 61px; z-index: 30; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 6px;
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.filter-drawer-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; display: flex; justify-content: flex-end;
}
.filter-drawer {
  width: min(340px, 88vw); background: var(--card); height: 100%; overflow-y: auto; padding: 18px;
}

/* Hamburger menu (bottom-nav "Menu" tab) slides from the left — visually distinct from the filter drawer (right) */
.app-menu-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; display: flex; justify-content: flex-start;
}
.app-menu-panel {
  width: min(300px, 84vw); background: var(--card); height: 100%; overflow-y: auto;
  animation: menuSlideIn 0.2s ease;
}
@keyframes menuSlideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.app-menu-header { display: flex; align-items: center; gap: 12px; padding: 20px 16px 14px; }
.app-menu-header .avatar { width: 44px; height: 44px; font-size: 16px; }
.filter-group { margin-bottom: 22px; }
.filter-group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text3); margin: 0 0 10px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; background: var(--bg);
}
.option-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.color-chip { width: 30px; height: 30px; border-radius: 999px; border: 2px solid var(--border); }
.color-chip.selected { border-color: var(--primary); }

/* ============ Product detail ============ */
.gallery { position: relative; }
.gallery-main {
  aspect-ratio: 4/5; background: var(--bg); overflow-x: auto; display: flex; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.gallery-main::-webkit-scrollbar { display: none; height: 0; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; flex-shrink: 0; cursor: zoom-in; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; }
.gallery-dots .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--border); }
.gallery-dots .dot.active { background: var(--primary); width: 16px; }

/* ============ Lightbox (pinch-zoom product image viewer) ============ */
.lightbox-bg {
  position: fixed; inset: 0; z-index: 200; background: rgba(10,8,6,0.96);
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-track {
  width: 100%; height: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.lightbox-track::-webkit-scrollbar { display: none; height: 0; }
.lightbox-slide {
  flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  scroll-snap-align: start; overflow: hidden;
}
.lightbox-slide img {
  max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pan-x;
  cursor: zoom-in; user-select: none; -webkit-user-drag: none;
}
.lightbox-slide.zoomed img { cursor: zoom-out; }
.lightbox-dots {
  position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.lightbox-dots .dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.35); }
.lightbox-dots .dot.active { background: #fff; width: 16px; }
.lightbox-hint {
  position: absolute; bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,0.55); font-size: 11px;
}

.pd-info { padding: 16px; }
.pd-brand { color: var(--text3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.pd-name { font-family: var(--font-display); font-size: 22px; margin: 4px 0 10px; }
.pd-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.pd-price { font-size: 22px; font-weight: 700; }

.option-block { margin-bottom: 20px; }
.option-block .label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.option-block .label-row span:first-child { font-weight: 600; font-size: 13.5px; }
.size-guide-link { font-size: 12px; color: var(--primary); font-weight: 600; }

.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.qty-stepper button { width: 34px; height: 34px; background: none; border: none; font-size: 16px; }
.qty-stepper span { min-width: 30px; text-align: center; font-weight: 600; }

.sticky-buybar {
  position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--border);
  padding: 12px 16px; display: flex; gap: 10px; z-index: 20;
}
.sticky-buybar .btn { flex: 1; }

/* ============ Variant selector bottom sheet ============ */
.variant-sheet-bg {
  position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.variant-sheet {
  width: 100%; max-width: 600px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  animation: sheetSlideUp 0.25s ease;
}
.variant-sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto 14px; }
@keyframes sheetSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.pd-tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 8px; }
.pd-tab { flex: 1; text-align: center; padding: 12px; font-size: 13.5px; font-weight: 600; color: var(--text3); border-bottom: 2px solid transparent; }
.pd-tab.active { color: var(--primary); border-color: var(--primary); }

.review-summary { display: flex; align-items: center; gap: 18px; padding: 16px; }
.review-avg { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.review-item { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.review-item .stars { color: var(--warn); font-size: 13px; }
.review-item .review-images { display: flex; gap: 6px; margin-top: 8px; }
.review-item .review-images img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

/* ============ Cart / Checkout ============ */
.cart-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cart-item img { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; }
.cart-item .meta { flex: 1; }
.cart-item .meta .name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.cart-item .meta .variant { font-size: 12px; color: var(--text3); }
.cart-item .row-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.remove-link { font-size: 12px; color: var(--danger); background: none; border: none; }

.summary-box { padding: 16px; background: var(--card); border-top: 1px solid var(--border); }
.summary-line { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text2); margin-bottom: 8px; }
.summary-line.total { font-size: 16px; font-weight: 700; color: var(--text); border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; outline: none;
}
.form-input:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

.address-card { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; position: relative; }
.address-card.selected { border-color: var(--primary); background: var(--primary-light); }
.address-card .tag { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--primary); }

.payment-option { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; }
.payment-option.selected { border-color: var(--primary); background: var(--primary-light); }
.bank-details { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; font-size: 13px; margin-top: 10px; }
.bank-details .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 10px; }
.bank-details .copy-btn { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-light); border: none; padding: 3px 9px; border-radius: 999px; }
.bank-details-highlight { border: 1.5px solid var(--primary-light); box-shadow: var(--shadow-sm); }

.amount-highlight {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 16px;
  background: var(--primary-light); border: 1.5px solid var(--primary); border-radius: var(--radius);
}
.amount-highlight .label { font-size: 12.5px; font-weight: 700; color: var(--primary-dark); text-transform: uppercase; letter-spacing: 0.02em; }
.amount-highlight .value { font-size: 20px; font-weight: 800; color: var(--primary-dark); margin-left: auto; }
.amount-highlight .copy-btn { flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border: none; padding: 4px 10px; border-radius: 999px; }

.req-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.02em; }
.req-badge-required { background: #fbe6e3; color: var(--danger); }
.req-badge-optional { background: var(--bg); color: var(--text3); }
.receipt-grid-needed .receipt-thumb.receipt-add { border-color: var(--danger); }
.upload-box {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--text3);
  cursor: pointer; margin-top: 10px;
}
.upload-box img { max-height: 160px; margin: 0 auto; border-radius: 8px; }

.receipt-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-thumb {
  position: relative; width: 74px; height: 92px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.receipt-remove {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 999px;
  background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.receipt-thumb.receipt-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px dashed var(--border); cursor: pointer;
}

/* ============ Orders ============ */
.order-card { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.order-card .top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card .order-no { font-weight: 700; font-size: 14px; }
.status-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: capitalize; }
.status-badge.pending { background: #fdf1de; color: var(--warn); }
.status-badge.receiptuploaded { background: #eae6fb; color: #6b46c1; }
.status-badge.paymentrejected { background: #fbe6e3; color: var(--danger); }
.status-badge.confirmed { background: #e3ecff; color: #3a5fcd; }
.status-badge.shipped { background: #e5f1ea; color: var(--success); }
.status-badge.delivered { background: #e5f1ea; color: var(--success); }
.status-badge.cancelled { background: #fbe6e3; color: var(--danger); }

.tracker { display: flex; padding: 20px 16px 8px; }
.tracker-step { flex: 1; text-align: center; position: relative; }
.tracker-step .dot { width: 24px; height: 24px; border-radius: 999px; background: var(--border); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 12px; font-weight: 700; }
.tracker-step.done .dot { background: var(--success); }
.tracker-step .line { position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: -1; }
.tracker-step.done .line { background: var(--success); }
.tracker-step:first-child .line { display: none; }
.tracker-step span { font-size: 10.5px; color: var(--text3); }
.tracker-step.done span { color: var(--success); font-weight: 600; }

/* ============ Profile ============ */
.profile-header { display: flex; align-items: center; gap: 14px; padding: 20px 16px; }
.avatar { width: 60px; height: 60px; border-radius: 999px; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.menu-list { }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.menu-item .grow { flex: 1; font-size: 14px; font-weight: 500; }

/* ============ Auth overlay ============ */
.overlay-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; display: flex; align-items: flex-end;
}
@media (min-width: 640px) { .overlay-bg { align-items: center; justify-content: center; } }
.overlay-panel {
  background: var(--card); width: 100%; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 24px 20px;
}
@media (min-width: 640px) { .overlay-panel { max-width: 420px; border-radius: var(--radius); } }
.overlay-panel h2 { font-family: var(--font-display); margin: 0 0 18px; }
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.step-dots .d { width: 8px; height: 8px; border-radius: 999px; background: var(--border); }
.step-dots .d.active { background: var(--primary); }

/* ============ Toast / modal generic ============ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #201a16; color: #fff;
  padding: 12px 20px; border-radius: 999px; font-size: 13.5px; z-index: 200; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
}
.toast a, .toast button.link { color: var(--primary-light); font-weight: 700; background: none; border: none; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--card); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 20px; }
.modal-box h3 { margin-top: 0; }
.close-x { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--text2); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state svg { margin-bottom: 14px; opacity: 0.5; }
.empty-state p { margin: 0 0 16px; }
.empty-state .btn-row { display: flex; gap: 10px; justify-content: center; }

.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.footer { padding: 30px 16px 90px; text-align: center; color: var(--text3); font-size: 12px; }

/* Desktop nav (hide bottom nav, show top links) */
.desktop-links { display: none; gap: 20px; align-items: center; font-size: 14px; font-weight: 600; }
@media (min-width: 960px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .desktop-links { display: flex; }
}
