/* ============================================================
   Krriva — Design System (v2, premium brand)
   ============================================================ */
:root {
  /* Brand */
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  --accent-50: #fff8ed;
  --accent-100: #ffedd5;
  --accent-200: #fed7aa;
  --accent-300: #fdba74;
  --accent-400: #fb923c;
  --accent-500: #f97316;
  --accent-600: #ea580c;

  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;

  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-brand: #ffffff;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;

  --green-50: #ecfdf5;
  --green-600: #059669;
  --green-700: #047857;
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --amber-50: #fffbeb;
  --amber-600: #d97706;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-brand: 0 8px 24px rgba(79, 70, 229, 0.25);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--surface-muted);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink-900); line-height: 1.25; }
p { margin: 0; }
a { text-decoration: none; color: inherit; transition: color 0.2s var(--ease); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.section-subtitle { color: var(--ink-500); font-size: 15px; margin-bottom: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-brand { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.btn-brand:hover { background: var(--brand-700); box-shadow: 0 10px 30px rgba(79, 70, 229, 0.32); }
.btn-light { background: var(--surface); color: var(--ink-800); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-light:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }
.btn-dark { background: var(--ink-900); color: #fff; }
.btn-dark:hover { background: var(--ink-800); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============================================================
   Storefront
   ============================================================ */
/* ---------- Top bar ---------- */
.topbar { background: var(--ink-900); color: #cbd5e1; font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.topbar-left, .topbar-right { display: flex; gap: 20px; align-items: center; }
.topbar-msg { display: inline-flex; align-items: center; gap: 8px; color: #94a3b8; }
.topbar-msg strong { color: #fff; font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner { display: flex; align-items: center; gap: 32px; padding-top: 16px; padding-bottom: 16px; }
.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink-900);
  display: inline-flex;
  align-items: baseline;
}
.logo mark { background: none; color: var(--brand-600); }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 18px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.header-search:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); background: var(--surface); }
.header-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 0;
  font-size: 15px;
  color: var(--ink-800);
}
.header-search input::placeholder { color: var(--ink-400); }
.header-search button {
  background: var(--brand-600);
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.2s var(--ease);
}
.header-search button:hover { background: var(--brand-700); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.header-action:hover { background: var(--brand-50); color: var(--brand-700); }
.header-action svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--brand-600);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff;
}
.cart-badge.show { display: flex; }
.menu-toggle { display: none; }

/* ---------- Nav ---------- */
.nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 82px; z-index: 990; }
.nav-list { display: flex; align-items: center; gap: 4px; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-list a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-600);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-list a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav-list a.active { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--surface);
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-panel a { padding: 12px 14px; border-radius: var(--radius-md); font-weight: 600; color: var(--ink-800); }
.mobile-menu-panel a:hover { background: var(--brand-50); color: var(--brand-700); }
.menu-close { align-self: flex-end; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(129, 140, 248, 0.28), transparent 60%),
    radial-gradient(700px 400px at -10% 20%, rgba(99, 102, 241, 0.2), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  color: #fff;
  padding: 72px 0 80px;
  overflow: hidden;
  position: relative;
}
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #e0e7ff;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2); }
.hero h1 { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; color: #fff; margin-bottom: 16px; }
.hero h1 .grad {
  background: linear-gradient(90deg, #a5b4fc, #f0abfc, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: 17px; color: #c7d2fe; max-width: 470px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; }
.hero-stat .num { font-size: 22px; font-weight: 800; color: #fff; }
.hero-stat .lbl { font-size: 13px; color: #a5b4fc; }
.hero-visual { position: relative; }
.hero-card-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.hero-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 14px;
  backdrop-filter: blur(8px);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.hero-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); }
.hero-card .img { border-radius: 14px; overflow: hidden; aspect-ratio: 1/1; }
.hero-card .img img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .name { margin-top: 10px; font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .price { color: #a5b4fc; font-weight: 700; font-size: 14px; }
.hero-badge-mark { position: absolute; top: 20px; right: 20px; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, #6366f1, #a855f7); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); animation: float 3s ease-in-out infinite; }
.hero-badge-mark svg { width: 26px; height: 26px; color: #fff; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.trust { display: flex; gap: 14px; align-items: center; }
.trust .ic {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}
.trust .ic svg { width: 24px; height: 24px; }
.trust h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.trust p { font-size: 13px; color: var(--ink-500); }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 16px; }
.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  display: flex;
  align-items: flex-end;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.category-card:hover img { transform: scale(1.06); }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 23, 42, 0.75), transparent 60%); }
.category-card .label { position: relative; z-index: 1; padding: 18px; font-size: 15px; font-weight: 700; }
.category-card .label span { display: block; font-size: 12px; font-weight: 500; opacity: 0.8; }

/* ---------- Product grid & cards ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head .link { color: var(--brand-600); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.section-head .link:hover { color: var(--brand-700); }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.product-media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--surface-muted); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.05); }
.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  backdrop-filter: blur(6px);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  z-index: 2;
}
.product-tag.off { background: var(--accent-500); }
.product-wish {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.15s var(--ease), color 0.2s var(--ease);
}
.product-card:hover .product-wish { opacity: 1; }
.product-wish:hover { color: var(--red-600); transform: scale(1.1); }
.product-wish svg { width: 17px; height: 17px; }
.product-wish.wished { color: var(--red-600); opacity: 1; }
.product-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-600); margin-bottom: 6px; }
.product-name { font-size: 15px; font-weight: 700; color: var(--ink-900); line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
.product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.product-price .now { font-size: 18px; font-weight: 800; color: var(--ink-900); }
.product-price .was { font-size: 13px; color: var(--ink-400); text-decoration: line-through; }
.product-price .save { font-size: 12px; color: var(--green-700); font-weight: 700; background: var(--green-50); padding: 2px 8px; border-radius: 999px; }
.product-stock { font-size: 12px; color: var(--ink-500); margin-bottom: 12px; }
.product-stock.in { color: var(--green-700); }
.product-stock.out { color: var(--red-600); font-weight: 600; }
.product-card .btn { margin-top: auto; }
.product-card .btn.added { background: var(--green-600); box-shadow: none; }

/* ---------- Banner / promo ---------- */
.promo {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: #fff;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, #312e81, #6d28d9 55%, #7c3aed);
  box-shadow: var(--shadow-lg);
}
.promo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 200px at 90% 10%, rgba(255,255,255,0.18), transparent 60%); }
.promo h3 { color: #fff; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.promo p { color: #c7d2fe; margin-top: 4px; }
.promo .btn { background: #fff; color: var(--ink-900); position: relative; z-index: 1; }
.promo .btn:hover { background: #f1f5f9; }

/* ---------- Newsletter ---------- */
.newsletter { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 48px; text-align: center; }
.newsletter h3 { font-size: 24px; font-weight: 800; }
.newsletter p { color: var(--ink-500); margin: 8px 0 24px; }
.newsletter-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.newsletter-form input { flex: 1; border: 1.5px solid var(--border); border-radius: 999px; padding: 12px 18px; outline: none; background: var(--surface-muted); }
.newsletter-form input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }

/* ---------- Footer ---------- */
.footer { background: var(--ink-900); color: #94a3b8; margin-top: 24px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding: 64px 32px 48px; max-width: 1280px; margin: 0 auto; }
.footer-brand .logo { color: #fff; }
.footer-brand p { margin-top: 16px; font-size: 14px; line-height: 1.7; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; transition: background 0.2s var(--ease), transform 0.2s var(--ease); }
.footer-social a:hover { background: var(--brand-600); transform: translateY(-2px); }
.footer-social svg { width: 18px; height: 18px; color: #fff; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 18px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a { display: block; padding: 6px 0; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 32px; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.footer-pay { display: flex; gap: 8px; align-items: center; }
.footer-pay span { background: rgba(255,255,255,0.08); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #cbd5e1; }

/* ---------- Cart drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 1200; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease); }
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 410px;
  max-width: 92vw;
  height: 100vh;
  background: var(--surface);
  z-index: 1300;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
}
.cart-drawer.show { transform: translateX(0); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 18px; font-weight: 800; }
.cart-head .count { color: var(--ink-500); font-size: 13px; font-weight: 600; margin-left: 8px; }
.cart-close { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--ink-500); font-size: 20px; transition: background 0.2s var(--ease); }
.cart-close:hover { background: var(--surface-muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); align-items: center; }
.cart-item img { width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-muted); }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-size: 14px; font-weight: 700; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .price { font-size: 13px; color: var(--brand-700); font-weight: 700; margin-top: 2px; }
.qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; color: var(--ink-600); display: flex; align-items: center; justify-content: center; }
.qty button:hover { background: #fff; color: var(--brand-700); }
.qty span { font-weight: 700; font-size: 13px; min-width: 24px; text-align: center; }
.cart-remove { color: var(--ink-400); font-size: 17px; padding: 6px; border-radius: 8px; }
.cart-remove:hover { color: var(--red-600); background: var(--red-50); }
.cart-foot { border-top: 1px solid var(--border); padding: 18px 24px; }
.cart-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.cart-row .muted { color: var(--ink-500); }
.cart-row.total { font-weight: 800; font-size: 16px; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 8px; color: var(--ink-900); }
.cart-empty { text-align: center; color: var(--ink-500); padding: 48px 0; }
.cart-empty .icon { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--ink-300); }
.free-ship-note { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.free-ship-note.done { background: var(--green-50); border-color: var(--green-600); color: var(--green-700); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 90px);
  background: var(--ink-900);
  color: #fff;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s var(--ease);
  display: flex;
  gap: 10px;
  align-items: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast.success { background: var(--green-700); }

/* ---------- Modals ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 1500; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-xl); width: 560px; max-width: 100%; max-height: 92vh; overflow-y: auto; padding: 32px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 22px; font-weight: 800; }
.modal .sub { color: var(--ink-500); font-size: 14px; margin: 6px 0 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* First-visit welcome offer popup */
.welcome-overlay { z-index: 1490; }
.welcome-modal { width: min(420px, calc(100vw - 32px)); position: relative; text-align: center; padding: 40px 32px 28px; background: linear-gradient(165deg, #fffdf8 55%, #eef4ed); border: 1px solid #dce7d7; }
.welcome-modal .cart-close { position: absolute; top: 14px; right: 14px; }
.welcome-modal .offer-tag { display: inline-block; background: #315d3f; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; padding: 6px 14px; border-radius: 999px; text-transform: uppercase; }
.welcome-modal h3 { font-size: 23px; line-height: 1.3; margin: 16px 0 8px; }
.welcome-modal h3 span { color: #315d3f; }
.welcome-modal p { color: var(--ink-500); font-size: 14px; margin: 0 0 18px; }
.welcome-modal .offer-code { background: #fff; border: 1.5px dashed #b89a50; border-radius: var(--radius-md); padding: 12px; font-size: 24px; font-weight: 800; letter-spacing: 3px; color: #315d3f; margin-bottom: 18px; }
.welcome-modal .offer-later { display: inline-block; border: 0; background: transparent; margin-top: 14px; color: var(--ink-500); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.welcome-modal .offer-later:hover { color: #315d3f; }
.auth-offer { background: linear-gradient(90deg, #eff5ed, #fbf5e8); border-color: #dce7d7; }
.auth-offer .auth-offer-badge { background: #315d3f; }
.auth-offer strong, .auth-offer code { color: #315d3f; }
.auth-offer code { border-color: #b89a50; }
@media (max-width: 480px) { .welcome-modal { padding: 36px 22px 24px; } }
.auth-tabs { display: inline-flex; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.auth-tab { padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-500); transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.auth-tab.active { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.auth-error { background: var(--red-50); border: 1px solid #fecaca; color: var(--red-600); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; display: none; }
.auth-error.show { display: block; }
.auth-form .auth-switch { text-align: center; color: var(--ink-500); font-size: 13px; margin-top: 16px; }
.auth-form .auth-switch a { color: var(--brand-600); font-weight: 700; }
.auth-form .auth-switch a:hover { color: var(--brand-700); }

.auth-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: linear-gradient(90deg, var(--brand-50), #eef2ff); border: 1px solid var(--brand-100); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.auth-offer .auth-offer-badge { background: var(--brand-600); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.auth-offer strong { color: var(--brand-700); }
.auth-offer code { margin-left: auto; background: var(--surface); border: 1px dashed #a5b4fc; color: var(--brand-700); font-weight: 800; letter-spacing: 1.5px; padding: 3px 10px; border-radius: 8px; font-size: 13px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-700); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; border: 1.5px solid var(--border); background: var(--surface-muted); border-radius: var(--radius-md); padding: 12px 14px; outline: none; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.form-group input:focus, .form-group textarea:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.order-summary { background: var(--surface-muted); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 20px; }

/* ---------- Order success ---------- */
.order-success { text-align: center; padding: 20px 0; }
.order-success .check { width: 72px; height: 72px; border-radius: 50%; background: var(--green-50); color: var(--green-600); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.08); }
.order-success .check svg { width: 36px; height: 36px; }

/* ---------- Shop page ---------- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
.shop-filters { position: sticky; top: 140px; display: flex; flex-direction: column; gap: 28px; }
.filter-block h4 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); margin-bottom: 12px; }
.filter-block .opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--ink-600); }
.filter-block .opt input { accent-color: var(--brand-600); width: 16px; height: 16px; }
.filter-block .opt label { cursor: pointer; }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.shop-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); }
.shop-sort select { border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; background: var(--surface); font-size: 13px; outline: none; }
.shop-result-count { font-size: 14px; color: var(--ink-500); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-400); padding: 18px 0 0; }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs .sep { color: var(--ink-300); }
.breadcrumbs .current { color: var(--ink-800); font-weight: 600; }

/* ---------- Product detail ---------- */
.pd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 40px 0 8px; align-items: start; }
.pd-gallery { position: sticky; top: 150px; }
.pd-main-img { border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 1/1; box-shadow: var(--shadow-md); background: var(--surface); }
.pd-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-cat { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-600); }
.pd-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 12px; }
.pd-rating { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); margin-bottom: 16px; }
.pd-rating .stars { color: var(--accent-500); letter-spacing: 1px; }
.pd-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.pd-price .now { font-size: 32px; font-weight: 800; color: var(--ink-900); }
.pd-price .was { font-size: 17px; color: var(--ink-400); text-decoration: line-through; }
.pd-price .save { font-size: 13px; color: var(--green-700); font-weight: 800; background: var(--green-50); padding: 4px 10px; border-radius: 999px; }
.pd-desc { color: var(--ink-500); line-height: 1.8; margin: 16px 0 24px; }
.pd-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.pd-meta .chip { background: var(--surface-muted); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-600); }
.pd-meta .chip strong { color: var(--ink-900); }
.pd-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.qty-stepper button { width: 34px; height: 34px; border-radius: 50%; font-size: 18px; color: var(--ink-600); display: flex; align-items: center; justify-content: center; }
.qty-stepper button:hover { background: #fff; color: var(--brand-700); }
.qty-stepper span { font-weight: 800; min-width: 32px; text-align: center; font-size: 15px; }
.wish-btn { width: 48px; height: 48px; border-radius: 999px; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--ink-500); transition: all 0.2s var(--ease); }
.wish-btn:hover, .wish-btn.wished { border-color: var(--red-600); color: var(--red-600); background: var(--red-50); }
.wish-btn svg { width: 20px; height: 20px; }

/* ---------- Account page ---------- */
.account-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); text-align: center; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-600), #8b5cf6); color: #fff; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.profile-card h3 { font-size: 18px; font-weight: 800; }
.profile-card p { color: var(--ink-500); font-size: 13px; margin-top: 2px; }
.profile-meta { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-soft); text-align: left; }
.profile-meta .row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; color: var(--ink-600); }
.profile-meta .row span:first-child { color: var(--ink-400); }

/* Profile edit */
.profile-edit { max-width: 760px; }
.pe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.pe-head h2 { font-size: 22px; font-weight: 800; }
.pe-head p { color: var(--ink-500); font-size: 14px; margin-top: 4px; }
.pe-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: var(--shadow-sm); }
.pe-card h3 { font-size: 16px; font-weight: 800; }
.pe-card .pe-sub { color: var(--ink-500); font-size: 13px; margin: 4px 0 20px; }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.pe-grid .form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-600); margin-bottom: 6px; }
.pe-full { grid-column: 1 / -1; }
.pe-req { color: var(--red-600); }
.pe-hint { font-size: 12px; color: var(--ink-500); margin-top: 6px; }
.pe-hint::before { content: "ℹ "; }
.form-group input.input:disabled { background: var(--surface-muted); color: var(--ink-400); cursor: not-allowed; }
.pe-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
@media (max-width: 640px) { .pe-grid { grid-template-columns: 1fr; } .pe-head { flex-direction: column; } .pe-actions { justify-content: stretch; } .pe-actions .btn { flex: 1; } }
.profile-meta .row span:last-child { font-weight: 700; color: var(--ink-800); text-align: right; }
.account-actions { display: flex; gap: 8px; margin-top: 18px; }
.account-body h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.account-body .sub { color: var(--ink-500); font-size: 14px; margin-bottom: 20px; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.order-card .o-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.order-card .o-id { font-weight: 800; font-size: 15px; }
.order-card .o-date { font-size: 13px; color: var(--ink-500); }
.order-card .o-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.order-card .o-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-600); }
.order-card .o-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--surface-muted); }
.order-card .o-item .q { color: var(--ink-400); margin-left: auto; white-space: nowrap; }
.order-card .o-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.order-card .o-total { font-weight: 800; font-size: 16px; }
.badge-status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.badge-status.pending { background: var(--amber-50); color: var(--amber-600); }
.badge-status.confirmed { background: #eef2ff; color: #4338ca; }
.badge-status.processing { background: #eef2ff; color: var(--brand-700); }
.badge-status.ready_shipping { background: #f3e8ff; color: #6d28d9; }
.badge-status.shipped { background: #e0e7ff; color: #4338ca; }
.badge-status.delivered { background: var(--green-50); color: var(--green-600); }
.badge-status.cancelled { background: #fef2f2; color: var(--red-600); }
.account-empty { text-align: center; color: var(--ink-500); padding: 48px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
@media (max-width: 900px) { .account-layout { grid-template-columns: 1fr; } }

/* ---------- Toast / misc components reused ---------- */
.nowrap { white-space: nowrap; }

/* ---------- Banners carousel ---------- */
.banner-carousel { position: relative; border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 28px; aspect-ratio: 3/1; background: var(--ink-900); }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s var(--ease); }
.banner-slide.active { opacity: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide .overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,23,42,0.75) 0%, transparent 60%); display: flex; flex-direction: column; justify-content: center; padding: 0 48px; color: #fff; }
.banner-slide .overlay h2 { font-size: 32px; font-weight: 800; margin-bottom: 6px; }
.banner-slide .overlay p { font-size: 15px; color: #c7d2fe; margin-bottom: 16px; }
.banner-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.banner-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; transition: background 0.2s var(--ease); }
.banner-dots .dot.active { background: #fff; }

/* ---------- Search autocomplete ---------- */
.search-wrap { position: relative; width: 100%; max-width: 560px; }
.search-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); margin-top: 6px; max-height: 420px; overflow-y: auto; z-index: 1100; display: none; }
.search-dropdown.open { display: block; }
.search-dropdown .sd-section { padding: 10px 16px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-400); }
.search-dropdown .sd-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; transition: background 0.15s; font-size: 14px; }
.search-dropdown .sd-item:hover { background: var(--brand-50); }
.search-dropdown .sd-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--surface-muted); }
.search-dropdown .sd-item .sd-price { font-weight: 700; color: var(--brand-700); margin-left: auto; font-size: 13px; }
.search-dropdown .sd-item .sd-cat { font-size: 12px; color: var(--ink-500); padding: 2px 8px; background: var(--surface-muted); border-radius: 6px; }

/* ---------- Reviews ---------- */
.reviews-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.reviews-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.reviews-head h2 { font-size: 22px; font-weight: 800; }
.review-avg { display: flex; align-items: center; gap: 10px; }
.review-avg .big { font-size: 36px; font-weight: 800; color: var(--ink-900); }
.review-avg .stars { color: var(--accent-500); font-size: 18px; letter-spacing: 2px; }
.review-avg .cnt { font-size: 13px; color: var(--ink-500); }
.review-form { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; }
.review-form h4 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.star-picker { display: flex; gap: 4px; margin-bottom: 12px; }
.star-picker button { font-size: 24px; color: var(--ink-300); transition: color 0.15s; }
.star-picker button.active { color: var(--accent-500); }
.star-picker button:hover { color: var(--accent-400); }
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; }
.review-card .r-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-card .r-name { font-weight: 700; font-size: 14px; }
.review-card .r-stars { color: var(--accent-500); font-size: 13px; letter-spacing: 1px; }
.review-card .r-date { font-size: 12px; color: var(--ink-400); }
.review-card .r-comment { font-size: 14px; color: var(--ink-600); line-height: 1.6; }
.review-card .r-del { font-size: 12px; color: var(--red-600); cursor: pointer; margin-top: 8px; display: inline-block; }
.review-card .r-del:hover { text-decoration: underline; }

/* ---------- Account tabs ---------- */
.account-tabs { display: flex; gap: 4px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 24px; }
.account-tab { padding: 9px 20px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-500); cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.account-tab.active { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }

/* ---------- Address book ---------- */
.addr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; position: relative; }
.addr-card .addr-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-600); margin-bottom: 6px; }
.addr-card .addr-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.addr-card .addr-detail { font-size: 13px; color: var(--ink-500); line-height: 1.6; }
.addr-card .addr-actions { display: flex; gap: 8px; margin-top: 10px; }
.addr-card .addr-actions button { font-size: 12px; }
.addr-default { border-color: var(--brand-300); background: var(--brand-50); }
.addr-default .addr-label::after { content: " (Default)"; color: var(--green-700); }

/* ---------- Order timeline ---------- */
.timeline { position: relative; padding-left: 24px; margin-top: 16px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-600); border: 2px solid #fff; }
.tl-item:last-child::before { background: var(--green-600); }
.tl-item .tl-status { font-weight: 700; font-size: 13px; text-transform: capitalize; }
.tl-item .tl-note { font-size: 12px; color: var(--ink-500); }
.tl-item .tl-date { font-size: 11px; color: var(--ink-400); }

/* ---------- Coupon box ---------- */
.coupon-box { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.coupon-box input { flex: 1; border: 1.5px solid var(--border); border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; outline: none; }
.coupon-box input:focus { border-color: var(--brand-400); }
.coupon-box .btn { flex-shrink: 0; }
.coupon-applied { background: var(--green-50); border: 1px solid var(--green-600); color: var(--green-700); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.coupon-applied .remove { cursor: pointer; color: var(--red-600); font-size: 12px; font-weight: 700; }
.coupon-applied .remove:hover { text-decoration: underline; }
.discount-line { color: var(--green-700); font-weight: 700; }
.invoice-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-600); font-weight: 700; font-size: 13px; margin-top: 12px; }
.invoice-link:hover { color: var(--brand-700); text-decoration: underline; }

/* ---------- Recently viewed ---------- */
.recently-viewed { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.recently-viewed .product-card { min-width: 220px; flex-shrink: 0; }

/* ============================================================
   Final touches: loading, toasts, validation, checkout, pagination
   ============================================================ */
/* ---------- Global loading bar ---------- */
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; pointer-events: none; opacity: 0; }
.loading-bar.active { opacity: 1; }
.loading-bar span { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, transparent, var(--brand-500), #7c3aed, transparent); border-radius: 0 999px 999px 0; animation: lb-slide 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes lb-slide { 0% { margin-left: -35%; } 100% { margin-left: 110%; } }

/* ---------- Spinner & button loading ---------- */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { opacity: 0.75; cursor: progress; }
.btn.btn-light.loading .spinner, .btn.btn-ghost.loading .spinner { border-color: rgba(100, 116, 139, 0.35); border-top-color: var(--ink-600); }

/* ---------- Toast types ---------- */
.toast .t-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; background: rgba(255, 255, 255, 0.18); flex-shrink: 0; }
.toast.success { background: var(--green-700); }
.toast.error { background: var(--red-600); }
.toast.info { background: var(--ink-800); }

/* ---------- Inline field validation ---------- */
.form-group .input, .co-form .input, .max-w input.input { width: 100%; border: 1.5px solid var(--border); background: var(--surface-muted); border-radius: var(--radius-md); padding: 12px 14px; font-size: 14px; outline: none; font-family: inherit; color: var(--ink-800); transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.form-group .input:focus, .co-form .input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); background: var(--surface); }
.field-error { color: var(--red-600); font-size: 12px; font-weight: 600; margin: 5px 0 0; }
input.invalid, textarea.invalid, select.invalid { border-color: var(--red-500) !important; box-shadow: 0 0 0 4px var(--red-100) !important; }
.field-hint { font-size: 12px; color: var(--ink-400); margin: 5px 0 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 28px 0 8px; flex-wrap: wrap; }
.pg-btn { min-width: 36px; height: 36px; padding: 0 12px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-600); cursor: pointer; transition: all 0.18s var(--ease); }
.pg-btn:hover:not(:disabled) { border-color: var(--brand-400); color: var(--brand-600); }
.pg-btn.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Order success ---------- */
.os-pay { display: inline-block; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); border-radius: var(--radius-md); padding: 8px 16px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.os-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Checkout page / stepper ---------- */
.checkout-page { padding-bottom: 48px; }
.checkout-stepper { display: flex; gap: 0; margin: 18px 0 28px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px; width: fit-content; max-width: 100%; }
.cs-step { display: flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; border: none; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-400); cursor: pointer; white-space: nowrap; transition: all 0.2s var(--ease); }
.cs-dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: var(--ink-500); font-size: 12px; font-weight: 800; }
.cs-step.active { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.cs-step.active .cs-dot { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cs-step.done { color: var(--green-700); }
.cs-step.done .cs-dot { background: var(--green-600); color: #fff; }

.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.checkout-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; }
.checkout-main h2 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.co-form .form-group { margin-bottom: 14px; }
.co-form label { font-size: 13px; font-weight: 700; color: var(--ink-700); margin-bottom: 6px; display: block; }
.co-form label .opt { color: var(--ink-400); font-weight: 500; }
.co-form input[type="checkbox"] { width: auto; }
.co-save-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-600); margin: 12px 0; cursor: pointer; }
.co-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.co-addr-saved { display: grid; gap: 10px; margin-bottom: 18px; }
.co-addr { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; font-size: 13px; line-height: 1.6; transition: all 0.18s var(--ease); }
.co-addr:hover { border-color: var(--brand-300); }
.co-addr.selected { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.co-addr input { margin-top: 3px; }
.chip-sm { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-700); background: var(--brand-100); border-radius: 999px; padding: 2px 8px; }

/* ---------- Payment methods ---------- */
.pm-options { display: grid; gap: 10px; margin-bottom: 18px; }
.pm-opt { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; cursor: pointer; transition: all 0.18s var(--ease); }
.pm-opt:hover { border-color: var(--brand-300); }
.pm-opt.selected { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.pm-opt input { accent-color: var(--brand-600); }
.pm-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-muted); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: var(--brand-600); flex-shrink: 0; }
.pm-opt.selected .pm-icon { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pm-info { display: flex; flex-direction: column; }
.pm-info strong { font-size: 14px; }
.pm-info small { font-size: 12px; color: var(--ink-400); }
.pm-details { margin-bottom: 6px; }
.pm-note { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; color: var(--ink-600); line-height: 1.6; }

/* ---------- Checkout review ---------- */
.co-review { display: grid; gap: 14px; }
.rev-block { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.rev-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rev-head h4 { font-size: 14px; font-weight: 800; }
.rev-line { font-size: 13px; color: var(--ink-600); line-height: 1.7; margin: 2px 0; }

/* ---------- Checkout summary sidebar ---------- */
.checkout-side { position: sticky; top: 20px; }
.checkout-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 22px; }
.checkout-summary h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.cs-items { max-height: 260px; overflow-y: auto; border-bottom: 1px dashed var(--border); margin-bottom: 14px; }
.cs-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.cs-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--surface-muted); }
.cs-info { flex: 1; line-height: 1.4; }
.cs-name { font-size: 12px; font-weight: 600; color: var(--ink-700); }
.cs-sub { font-size: 11px; color: var(--ink-400); }
.cs-price { font-size: 12px; font-weight: 700; }
.cs-rows { display: grid; gap: 6px; }
.cs-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-600); }
.cs-row.disc { color: var(--green-700); font-weight: 700; }
.cs-row .disc { color: var(--green-700); font-weight: 700; }
.cs-row.total { font-size: 16px; font-weight: 800; color: var(--ink-900); border-top: 2px dashed var(--border); margin-top: 8px; padding-top: 12px; }
.cs-coupon { margin-top: 16px; }
.cs-coupon .coupon-box { margin-bottom: 0; }
.cs-coupon .coupon-applied { margin-bottom: 0; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { --cols: 3; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0 56px; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 480px; }
  .menu-toggle { display: flex; }
  .nav { display: none; }
  .header-inner { gap: 16px; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-filters { position: static; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .filter-block { width: 48%; }
  .pd-layout { grid-template-columns: 1fr; gap: 32px; }
  .pd-gallery { position: static; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .section { padding: 40px 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-body { padding: 12px; }
  .product-name { font-size: 13px; min-height: 36px; }
  .product-price .now { font-size: 15px; }
  .hero h1 { font-size: 34px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .cat-grid { --cols: 2; }
  .topbar-right { display: none; }
  .footer-top { grid-template-columns: 1fr; padding: 40px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .pd-title { font-size: 24px; }
  .pd-actions { flex-direction: column; align-items: stretch; }
  .qty-stepper { justify-content: space-between; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-side { position: static; }
  .checkout-stepper { width: 100%; justify-content: space-between; border-radius: 16px; overflow-x: auto; }
  .cs-step { padding: 10px 14px; }
  .checkout-main { padding: 20px; }
}
/* Mobile product detail: allow grid children to shrink to the viewport. */
@media (max-width: 680px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }

  .pd-layout > * {
    min-width: 0;
    max-width: 100%;
  }

  .pd-main-img,
  .pd-main-img img {
    max-width: 100%;
  }

  .pd-title,
  .pd-desc {
    overflow-wrap: anywhere;
  }
}
