/* ==== Design tokens ==== */
:root {
  --bg: #ffffff;
  --fg: #0f3024;
  --primary: #0d3d2c;
  --primary-hover: #145239;
  --primary-fg: #fbf9ee;
  --secondary: #f1f6f3;
  --muted: #f5f3ee;
  --muted-fg: #6b7770;
  --border: #e1e8e3;
  --accent: #f4c544;
  --accent-fg: #0d3d2c;
  --promo: #f6e6d4;
  --rating: #22b455;
  --destructive: #e23b3b;
  --shadow-card: 0 4px 20px -8px rgba(15, 48, 36, 0.18);
  --shadow-soft: 0 2px 12px -4px rgba(15, 48, 36, 0.12);
  --gradient-hero: linear-gradient(135deg, #d6ecf2 0%, #fae6a8 100%);
  --radius: 12px;
}

/* ==== Reset ==== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.15; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==== Header ==== */
.header { position: sticky; top: 0; z-index: 50; background: var(--bg); }

.mainnav { border-bottom: 1px solid var(--border); }
.mainnav .container {
  display: flex; align-items: center; gap: 16px;
  padding-top: 16px; padding-bottom: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: var(--accent);
  display: grid; place-items: center;
}
.logo-text { font-weight: 700; font-size: 20px; color: var(--primary); }

.nav-links { display: none; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { display: flex; align-items: center; gap: 4px; transition: color 0.2s; }
.nav-links a:hover { color: rgba(15, 48, 36, 0.6); }
@media (min-width: 1024px) { .nav-links { display: flex; } }

.search-wrap { display: none; flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search-wrap input {
  width: 100%; height: 44px; border-radius: 999px; border: 0;
  background: var(--secondary); padding: 0 48px 0 20px;
  font-size: 14px; outline: none; transition: box-shadow 0.2s;
}
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(13, 61, 44, 0.12); }
.search-wrap svg { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); }
.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 44px -28px rgba(15, 48, 36, 0.4);
}
.search-suggestion-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}
.search-suggestion-item:hover {
  background: #f1f6f3;
}
.search-suggestion-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.search-suggestion-item small {
  color: var(--muted-fg);
  font-size: 12px;
}
@media (min-width: 768px) { .search-wrap { display: flex; } }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (min-width: 768px) { .nav-actions { margin-left: 0; } }
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 500;
  position: relative;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--primary); background: var(--secondary); }
.icon-btn .label { display: none; }
.icon-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.cart-badge { background: var(--accent); color: var(--accent-fg); }
.favorite-badge { background: #ffe4e9; color: #b43653; }
#toggleFavorites.active {
  color: var(--destructive);
  background: #fff4f5;
  border-color: rgba(226, 59, 59, 0.2);
}
.menu-btn { display: block; }
@media (min-width: 1024px) { .menu-btn { display: none; } }

.mobile-menu { display: none; border-top: 1px solid var(--border); }
.mobile-menu.open { display: block; }
.mobile-menu .container { padding-top: 16px; padding-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.mobile-menu a { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; }
.mobile-menu a:last-child { border-bottom: 0; }

/* ==== Buttons ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-card); }
.btn-outline { border: 1px solid rgba(15, 48, 36, 0.15); color: var(--primary); background: transparent; }
.btn-outline:hover { background: #fff; }
.btn-block { width: 100%; }

/* ==== Hero ==== */
.hero { padding-top: 24px; }
@media (min-width: 1024px) { .hero { padding-top: 40px; } }
.hero-card {
  position: relative; overflow: hidden; border-radius: 18px;
  background: var(--gradient-hero);
}
@media (min-width: 1024px) { .hero-card { border-radius: 24px; } }
.hero-grid { display: grid; align-items: center; min-height: 420px; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; min-height: 520px; } }
.hero-content { padding: 32px; }
@media (min-width: 640px) { .hero-content { padding: 48px; } }
@media (min-width: 1024px) { .hero-content { padding: 64px; } }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(15, 48, 36, 0.65); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 800; color: var(--primary); }
.hero p { margin-top: 20px; font-size: 16px; color: var(--muted-fg); max-width: 28rem; }
@media (min-width: 640px) { .hero p { font-size: 18px; } }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { margin-top: 40px; display: flex; gap: 32px; color: var(--primary); }
.hero-stats > div + div { border-left: 1px solid rgba(15, 48, 36, 0.15); padding-left: 32px; }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--muted-fg); }
.hero-image { position: relative; height: 256px; }
@media (min-width: 768px) { .hero-image { height: 100%; } }
.hero-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .hero-image img { object-fit: contain; object-position: right; } }

/* ==== Section heading ==== */
section { scroll-margin-top: 100px; }
.section { padding: 56px 0; border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .section { padding: 80px 0; } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; gap: 16px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
.section-head p { font-size: 14px; color: var(--muted-fg); margin-top: 8px; }
.see-all { display: none; font-size: 14px; font-weight: 600; color: var(--primary); }
.see-all:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 640px) { .see-all { display: inline; } }

/* ==== Categories ==== */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat {
  position: relative; aspect-ratio: 1; border-radius: 18px;
  overflow: hidden; background: var(--muted); display: block;
}
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.cat:hover img { transform: scale(1.1); }
.cat::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0.05) 60%, transparent);
}
.cat-name {
  position: absolute; top: 16px; left: 16px; right: 16px;
  color: #fff; font-weight: 700; font-size: 18px; z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@media (min-width: 640px) { .cat-name { font-size: 20px; } }

/* ==== Products ==== */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 640px) { .products-grid { gap: 32px; } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
.product { display: flex; flex-direction: column; }
.product-image {
  position: relative; aspect-ratio: 1; background: var(--secondary);
  border-radius: 18px; overflow: hidden;
}
.product-image img {
  width: 100%; height: 100%; object-fit: contain; padding: 24px;
  transition: transform 0.5s;
}
.product:hover .product-image img { transform: scale(1.05); }
.fav-btn {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--bg); display: grid; place-items: center;
  box-shadow: var(--shadow-soft); transition: transform 0.2s;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.active svg { fill: var(--destructive); color: var(--destructive); }
.product-head { padding-top: 16px; display: flex; justify-content: space-between; gap: 12px; }
.product-head h3 { font-weight: 700; font-size: 15px; line-height: 1.2; }
.product-price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.product-desc { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }
.rating { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 8px; }
.stars { display: flex; gap: 2px; color: var(--rating); }
.stars svg { width: 14px; height: 14px; }
.add-btn {
  margin-top: 16px; align-self: flex-start;
  border-radius: 999px; padding: 8px 20px;
  font-size: 12px; font-weight: 600;
  border: 1px solid rgba(15, 48, 36, 0.2);
  transition: all 0.2s;
}
.add-btn:hover { background: var(--fg); color: var(--bg); }
.add-btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.add-btn.primary:hover { background: var(--primary-hover); }

/* ==== Footer ==== */
.footer { background: var(--primary); color: var(--primary-fg); margin-top: 40px; }
.footer .container { padding-top: 56px; padding-bottom: 56px; }
@media (min-width: 1024px) { .footer .container { padding-top: 80px; padding-bottom: 80px; } }
.footer-simple { display: flex; flex-direction: column; gap: 20px; }
.footer .logo-mark { background: rgba(251, 249, 238, 0.1); }
.footer-tag { margin-top: 16px; font-size: 14px; color: rgba(251, 249, 238, 0.7); max-width: 24rem; }
.footer-bottom {
  margin-top: 8px; padding-top: 24px;
  border-top: 1px solid rgba(251, 249, 238, 0.1);
  display: flex; align-items: center; justify-content: flex-start;
}
.footer-bottom .copy { font-size: 12px; color: rgba(251, 249, 238, 0.6); }

/* ==== Cart Drawer ==== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: 100%; background: var(--bg); z-index: 70;
  box-shadow: -10px 0 40px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s;
}
@media (min-width: 640px) { .drawer { width: 420px; } }
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.drawer-head .count { font-size: 12px; color: var(--muted-fg); font-weight: 500; }
.close-btn { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; transition: background 0.2s; }
.close-btn:hover { background: var(--secondary); }

.cart-empty { flex: 1; display: grid; place-items: center; padding: 32px; text-align: center; }
.cart-empty .icon-circle { width: 80px; height: 80px; border-radius: 999px; background: var(--secondary); display: grid; place-items: center; margin: 0 auto 16px; color: var(--muted-fg); }
.cart-empty p.t { font-weight: 600; }
.cart-empty p.s { font-size: 14px; color: var(--muted-fg); margin-top: 4px; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.cart-item:last-child { border-bottom: 0; margin-bottom: 0; }
.cart-thumb { width: 80px; height: 80px; border-radius: 12px; background: var(--secondary); flex-shrink: 0; overflow: hidden; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-top { display: flex; justify-content: space-between; gap: 8px; }
.cart-item h3 { font-size: 14px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-desc { font-size: 12px; color: var(--muted-fg); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-row { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.qty {
  display: flex; align-items: center; gap: 8px;
  background: var(--secondary); border-radius: 999px; padding: 4px;
}
.qty button {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--bg); display: grid; place-items: center;
  transition: all 0.2s;
}
.qty button:hover { background: var(--primary); color: var(--primary-fg); }
.qty span { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-total { font-weight: 700; font-size: 14px; }
.remove-btn { color: var(--muted-fg); transition: color 0.2s; }
.remove-btn:hover { color: var(--destructive); }

.drawer-foot { padding: 20px; border-top: 1px solid var(--border); background: rgba(241, 246, 243, 0.5); }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.summary-row .muted { color: var(--muted-fg); }
.summary-row .free { color: var(--rating); font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border); }
.drawer-foot .btn { margin-top: 12px; }

/* ==== Checkout page ==== */
.checkout-wrap { padding: 32px 0; flex: 1; }
@media (min-width: 1024px) { .checkout-wrap { padding: 48px 0; } }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted-fg); margin-bottom: 24px; transition: color 0.2s; }
.back-link:hover { color: var(--primary); }
.page-title { font-size: clamp(1.875rem, 4vw, 2.25rem); font-weight: 700; margin-bottom: 32px; }
.checkout-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 1024px) { .checkout-grid { grid-template-columns: 1fr 380px; gap: 48px; } }
.form-section { background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 24px; margin-bottom: 24px; }
@media (min-width: 640px) { .form-section { padding: 32px; } }
.form-section h2 {
  font-weight: 700; font-size: 18px;
  display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
}
.section-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--secondary); color: var(--primary); display: grid; place-items: center; }
.field { display: block; margin-bottom: 16px; }
.field-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted-fg); display: block; margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg);
  padding: 0 16px; font-size: 14px; outline: none; transition: all 0.2s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 61, 44, 0.12); }
.field input:disabled { background: #f6f8f6; color: #8a948e; cursor: not-allowed; }
.lock-note { font-size: 12px; color: var(--muted-fg); display: flex; align-items: center; gap: 6px; margin-top: 8px; }

.payment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.payment-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-fg);
  transition: all 0.2s;
  cursor: pointer;
}

.payment-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.payment-option.active {
  border-color: var(--primary);
  background: rgba(13, 61, 44, 0.06);
  color: var(--primary);
}

.payment-panel[hidden] {
  display: none;
}

.payment-note {
  font-size: 14px;
  color: var(--muted-fg);
  padding: 16px;
  border-radius: 14px;
  background: rgba(241, 246, 243, 0.7);
}

.summary-box { background: rgba(241, 246, 243, 0.5); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
@media (min-width: 1024px) { .summary-box { position: sticky; top: 96px; } }
.summary-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.summary-items { max-height: 256px; overflow-y: auto; padding-right: 8px; display: flex; flex-direction: column; gap: 12px; }
.summary-item { display: flex; gap: 12px; align-items: flex-start; }
.summary-item .thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--bg); flex-shrink: 0; overflow: hidden; }
.summary-item .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.summary-item .info { flex: 1; min-width: 0; }
.summary-item .info p { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-item .price { font-size: 16px; font-weight: 700; white-space: nowrap; color: var(--primary); }
.summary-item-tools { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary-qty { gap: 6px; padding: 3px; }
.summary-qty span { min-width: 48px; font-size: 12px; }
.summary-remove-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-fg);
}
.summary-remove-btn:hover {
  color: var(--destructive);
}
.payment-summary-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  color: var(--muted-fg);
}
.summary-totals { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; }
.summary-totals .row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.summary-totals .muted { color: var(--muted-fg); }
.summary-totals .free { color: var(--rating); font-weight: 600; }
.summary-totals .grand { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--border); }
.summary-box .btn { margin-top: 20px; }

/* ==== Success ==== */
.success-wrap { max-width: 768px; margin: 0 auto; padding: 40px 0; flex: 1; }
@media (min-width: 1024px) { .success-wrap { padding: 64px 0; } }
.success-head { text-align: center; margin-bottom: 32px; }
.success-icon { width: 64px; height: 64px; border-radius: 999px; background: rgba(34, 180, 85, 0.1); color: var(--rating); display: grid; place-items: center; margin: 0 auto 16px; }
.success-head h1 { font-size: clamp(1.875rem, 4vw, 2.25rem); font-weight: 700; }
.success-head p { color: var(--muted-fg); margin-top: 8px; }

.success-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .success-actions { flex-direction: row; } }
.success-actions .btn { flex: 1; }

.order-history-section {
  margin: 12px 0 20px;
}

.order-history-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.order-history-head h2 {
  font-size: 24px;
  font-weight: 700;
}

.order-history-head p {
  color: var(--muted-fg);
  font-size: 14px;
}

.order-history-list {
  display: grid;
  gap: 14px;
}

@media (min-width: 768px) {
  .order-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.history-card,
.history-empty {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(241, 246, 243, 0.55);
  padding: 18px;
}

.history-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-id {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.history-date {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-fg);
}

.history-total {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted-fg);
}

.history-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 61, 44, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.history-items {
  margin-top: 12px;
  font-size: 14px;
  color: var(--fg);
}

.history-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.history-empty p {
  font-size: 15px;
  font-weight: 600;
}

.history-empty span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted-fg);
}

.invoice-capture {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 760px;
  pointer-events: none;
  opacity: 0;
}

.invoice-sheet {
  background: #ffffff;
  color: var(--fg);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid #d9e3de;
  box-shadow: 0 24px 60px -40px rgba(15, 48, 36, 0.2);
}

.invoice-sheet-head,
.invoice-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.invoice-sheet-head {
  padding-bottom: 26px;
  border-bottom: 1px solid #d9e3de;
}

.invoice-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.invoice-brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.invoice-meta,
.invoice-order-meta,
.invoice-customer p,
.invoice-ship p {
  color: var(--muted-fg);
  font-size: 13px;
}

.invoice-order-meta {
  text-align: right;
}

.invoice-order-id {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}

.invoice-sections {
  margin-top: 28px;
}

.invoice-panel {
  padding: 0 0 28px;
  border-bottom: 1px solid #d9e3de;
  background: #ffffff;
}

.invoice-contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 18px;
}

.invoice-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 10px;
}

.invoice-ship-block {
  text-align: right;
}

.invoice-customer-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
}

.invoice-customer,
.invoice-items,
.invoice-summary {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.invoice-customer {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.invoice-items {
  display: grid;
  gap: 10px;
  border-top: 0;
}

.invoice-items-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 140px 140px;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.invoice-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 140px 140px;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid #edf2ee;
}

.invoice-item-row span:last-child,
.invoice-items-head span:last-child,
.invoice-summary .invoice-row span:last-child {
  text-align: right;
}

.invoice-item-row span:nth-child(2),
.invoice-items-head span:nth-child(2) {
  text-align: center;
}

.invoice-item-row span:nth-child(3),
.invoice-items-head span:nth-child(3) {
  text-align: right;
}

.invoice-summary {
  display: grid;
  gap: 10px;
}

.invoice-row.total {
  font-weight: 700;
  color: var(--primary);
  font-size: 16px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid #d9e3de;
}

.invoice-free {
  color: #1ea85c;
  font-weight: 700;
}

.invoice-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #d9e3de;
  text-align: center;
  color: var(--muted-fg);
  font-size: 13px;
}

@media (max-width: 767px) {
  .invoice-sheet {
    padding: 22px;
  }

  .invoice-contact-panel {
    grid-template-columns: 1fr;
  }

  .invoice-ship-block {
    text-align: left;
  }

  .invoice-items-head,
  .invoice-item-row {
    grid-template-columns: minmax(0, 1fr) 64px 96px 96px;
  }
}

/* ==== Toast ==== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--primary); color: var(--primary-fg);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 100;
  opacity: 0; transition: all 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==== Catalog refresh ==== */
body {
  background: var(--bg);
}

.header {
  background: var(--bg);
  backdrop-filter: none;
}

.mainnav {
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  background: var(--primary);
  color: var(--accent);
  box-shadow: none;
}

.logo-text {
  color: var(--primary);
}

.nav-links {
  gap: 20px;
}

.search-wrap input {
  background: var(--secondary);
  border: 0;
  box-shadow: none;
}

.search-wrap svg {
  color: var(--muted-fg);
}

.icon-btn {
  color: inherit;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-size: 14px;
  font-weight: 500;
}

.nav-dropdown-toggle svg {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-toggle svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 260px;
  padding: 10px;
  border: 1px solid #e4ece7;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 60px -40px rgba(16, 45, 39, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  color: #1c2a25;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item small {
  color: #7d8a83;
  font-size: 11px;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: #eefbfd;
  color: #1b7582;
}

.mobile-menu-group {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.mobile-menu-group p {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7c8a83;
}

.mobile-category-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e6ede8;
  text-align: left;
}

.mobile-category-link small {
  color: #7c8a83;
}

.mobile-category-link.active {
  color: #1b7582;
}

.catalog-section {
  padding: 32px 0 72px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #89a09a;
}

.breadcrumb a {
  color: #55b5c3;
}

.catalog-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 28px;
}

.catalog-title-row h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  color: #1b2924;
}

.catalog-title-row p {
  max-width: 720px;
  margin-top: 12px;
  font-size: 15px;
  color: #73827c;
}

.catalog-shell {
  display: grid;
  gap: 24px;
}

@media (min-width: 1024px) {
  .catalog-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    align-items: start;
  }
}

.catalog-sidebar {
  min-width: 0;
}

@media (min-width: 1024px) {
  .catalog-sidebar {
    position: sticky;
    top: 102px;
  }
}

.filter-card {
  border: 1px solid #e4ebe6;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 32px 70px -52px rgba(15, 46, 39, 0.65);
  overflow: hidden;
}

.filter-card-head,
.filter-group {
  padding: 22px 20px;
}

.filter-group {
  border-top: 1px solid #edf2ee;
}

.filter-group:first-child {
  border-top: 0;
}

.filter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-card-head h2,
.filter-group label,
.filter-group p {
  font-size: 14px;
  font-weight: 700;
  color: #182822;
}

.filter-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-group-head span {
  font-size: 12px;
  color: #87a199;
}

.text-btn {
  font-size: 13px;
  font-weight: 700;
  color: #4ab5c3;
}

.text-btn:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #8da09a;
  border-bottom: 2px solid #8da09a;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 14px;
  border: 1px solid #e3ebe6;
  border-radius: 14px;
  background: #f7faf8;
  color: #18312a;
  appearance: none;
  outline: none;
}

.select-wrap select:focus {
  border-color: #69cfdb;
  box-shadow: 0 0 0 3px rgba(105, 207, 219, 0.16);
}

.select-wrap-small select {
  min-width: 190px;
  background: #ffffff;
}

.price-filter {
  display: grid;
  gap: 14px;
}

.price-slider-wrap {
  position: relative;
  height: 84px;
}

.price-bars {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 26px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 0 10px;
}

.price-bars span {
  flex: 1;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(121, 218, 230, 0.08), rgba(121, 218, 230, 0.28));
}

.price-bars span:nth-child(1) { height: 18px; }
.price-bars span:nth-child(2) { height: 24px; }
.price-bars span:nth-child(3) { height: 30px; }
.price-bars span:nth-child(4) { height: 22px; }
.price-bars span:nth-child(5) { height: 34px; }
.price-bars span:nth-child(6) { height: 42px; }
.price-bars span:nth-child(7) { height: 28px; }
.price-bars span:nth-child(8) { height: 20px; }

.price-track,
.price-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 17px;
  height: 4px;
  border-radius: 999px;
}

.price-track {
  background: #d6e6e8;
}

.price-progress {
  right: auto;
  background: #59cad9;
}

.price-range-input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 34px;
  background: none;
  pointer-events: none;
}

.price-range-max {
  z-index: 2;
}

.price-range-input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.price-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  border: 3px solid #59cad9;
  box-shadow: 0 6px 18px -10px rgba(52, 165, 180, 0.95);
  cursor: pointer;
  pointer-events: auto;
  margin-top: -5px;
}

.price-range-input::-moz-range-track {
  height: 4px;
  background: transparent;
}

.price-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  border: 3px solid #59cad9;
  box-shadow: 0 6px 18px -10px rgba(52, 165, 180, 0.95);
  cursor: pointer;
  pointer-events: auto;
}

.price-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
  font-size: 12px;
  font-weight: 700;
  color: #687873;
}

.price-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.price-input-separator {
  font-size: 12px;
  font-weight: 700;
  color: #7c8a83;
  text-transform: uppercase;
}

.price-input-box input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #e3ebe6;
  border-radius: 16px;
  background: #ffffff;
  color: #1b312a;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.price-input-box input[readonly] {
  cursor: default;
  background: #ffffff;
}

.price-input-box input:focus {
  outline: none;
  border-color: #69cfdb;
  box-shadow: 0 0 0 3px rgba(105, 207, 219, 0.16);
}

.catalog-main {
  min-width: 0;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

@media (max-width: 767px) {
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

.catalog-view {
  display: inline-flex;
  gap: 10px;
}

.view-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid #e0e8e3;
  background: rgba(255, 255, 255, 0.96);
  color: #62756f;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.view-btn:hover,
.view-btn.active {
  color: #1d7784;
  border-color: #6bcfdc;
  background: #effbfd;
  box-shadow: 0 16px 26px -22px rgba(34, 137, 149, 0.75);
}

.toolbar-select {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #73847e;
}

@media (max-width: 767px) {
  .toolbar-select {
    justify-content: space-between;
  }
}

.catalog-main .products-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

@media (min-width: 680px) {
  .catalog-main .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1220px) {
  .catalog-main .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1380px) {
  .catalog-main .products-grid.compact-view {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-brand {
  margin-top: 12px;
  font-size: 12px;
  color: #93a49e;
}

.product-price {
  color: var(--primary);
}

.product-image img[data-fit="contain"] {
  object-fit: contain;
  padding: 24px;
}

.product-image img[data-fit="cover"] {
  object-fit: cover;
  padding: 0;
}

.empty-products {
  grid-column: 1 / -1;
  padding: 44px 20px;
  border: 1px dashed #cfdcd6;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.empty-products h3 {
  font-size: 20px;
  color: #17312a;
}

.empty-products p {
  margin-top: 8px;
  color: #7c8b85;
}

body.drawer-open {
  overflow: hidden;
}

.overlay {
  background: rgba(12, 26, 23, 0.44);
  backdrop-filter: blur(4px);
}

.drawer {
  border-left: 1px solid #e5ece7;
}

.drawer-head,
.cart-items,
.drawer-foot {
  background: rgba(255, 255, 255, 0.97);
}

.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 22px 40px -24px rgba(15, 48, 36, 0.75);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  z-index: 40;
}

.scroll-top:hover {
  background: var(--primary-hover);
}

.scroll-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 767px) {
  .scroll-top {
    right: 14px;
    bottom: 18px;
    width: 42px;
    height: 42px;
  }
}

/* ==== Price Slider Tooltips ==== */
.price-tooltip {
  position: absolute;
  bottom: 24px;
  transform: translateX(-50%);
  background: #18312a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.price-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: #18312a transparent transparent transparent;
}

/* Reveal tooltips on hover or drag */
.price-slider-wrap:hover .price-tooltip,
.price-range-input:active ~ .price-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}