/* ============================================================
   ROOT & RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #7B2FBE;
  --primary-dark: #6B21A8;
  --primary-light:#F3E8FF;
  --wa:           #25D366;
  --wa-dark:      #1DA851;
  --danger:       #EF4444;
  --warning:      #F59E0B;
  --success:      #10B981;
  --badge-hot:    #EF4444;
  --badge-new:    #3B82F6;
  --badge-sale:   #F59E0B;
  --badge-best:   #8B5CF6;
  --text-h:       #111827;
  --text-b:       #374151;
  --text-m:       #6B7280;
  --text-l:       #9CA3AF;
  --bg:           #F9FAFB;
  --card:         #FFFFFF;
  --border:       #E5E7EB;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.14);
  --radius:       14px;
  --radius-sm:    8px;
  --header-h:     64px;
  --cat-h:        60px;
  --mob-bar-h:    60px;
  --hero-grad2:   #D97706;
  --banner-bg:    #4F46E5;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-b);
  line-height: 1.5;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-h);
  letter-spacing: -.3px;
}

.search-wrap {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0 38px 0 16px;
  font-size: 14px;
  color: var(--text-b);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.search-wrap input::placeholder { color: var(--text-l); }
.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  color: var(--text-m);
}
.clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-m);
  display: none;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
}
.search-wrap input:not(:placeholder-shown) ~ .search-icon { display: none; }
.search-wrap input:not(:placeholder-shown) ~ .clear-search { display: flex; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.cart-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background .2s, transform .15s;
}
.cart-btn:hover { background: var(--primary); color: #fff; }
.cart-btn:active { transform: scale(.93); }

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card);
}

.btn-wa-header {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  background: var(--wa);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.btn-wa-header:hover { background: var(--wa-dark); }
.btn-wa-header:active { transform: scale(.96); }
.wa-icon { width: 18px; height: 18px; }

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--hero-grad2, #7C3AED) 100%);
  color: #fff;
  padding: 40px 24px 36px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.hero p {
  font-size: 15px;
  opacity: .85;
  margin-bottom: 20px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 22px; font-weight: 800; }
.hero-stat span { font-size: 12px; opacity: .75; }

/* ============================================================
   CATEGORY BAR
   ============================================================ */
.category-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

#category-list {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  width: max-content;
  min-width: 100%;
}

.cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-m);
  background: var(--bg);
  border: 1.5px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-btn:hover { color: var(--primary); background: var(--primary-light); }
.cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.cat-icon { font-size: 16px; line-height: 1; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-h);
}
.section-count {
  font-size: 13px;
  color: var(--text-m);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */
#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #F3F4F6;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.product-card:hover .card-img-wrap img { transform: scale(1.06); }

/* Badges */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #fff;
}
.badge--hot         { background: var(--badge-hot); }
.badge--new         { background: var(--badge-new); }
.badge--sale        { background: var(--badge-sale); }
.badge--best-seller { background: var(--badge-best); }

.disc-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.oos-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}
.card-category {
  font-size: 11px;
  color: var(--text-m);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-h);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 12.5px;
  color: var(--text-m);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.card-orig {
  font-size: 13px;
  color: var(--text-l);
  text-decoration: line-through;
}

.btn-add {
  margin-top: 10px;
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s, transform .15s;
}
.btn-add:hover:not(.disabled) { background: var(--primary-dark); }
.btn-add:active:not(.disabled) { transform: scale(.97); }
.btn-add.disabled {
  background: var(--border);
  color: var(--text-m);
  cursor: not-allowed;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; color: var(--text-m); }

/* ============================================================
   OVERLAY
   ============================================================ */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
#overlay.show { opacity: 1; pointer-events: all; }

/* ============================================================
   CART DRAWER
   ============================================================ */
#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100%;
  background: var(--card);
  z-index: 300;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  transform: translateX(110%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-h);
  display: flex;
  align-items: center;
  gap: 8px;
}
.close-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-m);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.close-cart:hover { background: var(--border); color: var(--text-h); }

#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
}
.cart-empty .empty-icon { font-size: 52px; margin-bottom: 14px; }
.cart-empty p { font-size: 16px; font-weight: 600; color: var(--text-h); }
.cart-empty small { color: var(--text-m); font-size: 13px; }

.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  position: relative;
}
.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.ci-info { flex: 1; min-width: 0; }
.ci-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 3px 0 8px;
}
.ci-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--card);
  border: 1.5px solid var(--border);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-b);
  transition: border-color .15s, background .15s;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ci-qty span { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }
.ci-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-l);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ci-remove:hover { background: #FEE2E2; color: var(--danger); }

.cart-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-total-row .label { font-size: 14px; color: var(--text-m); }
.cart-total-row .amount { font-size: 22px; font-weight: 800; color: var(--text-h); }

.btn-wa-order {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: var(--wa);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.btn-wa-order:hover { background: var(--wa-dark); }
.btn-wa-order:active { transform: scale(.97); }
.btn-wa-order svg { flex-shrink: 0; }

.cart-note {
  font-size: 11.5px;
  color: var(--text-m);
  text-align: center;
  line-height: 1.4;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1F2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   MOBILE BOTTOM BAR
   ============================================================ */
.mob-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mob-bar-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 80;
  padding: 8px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.mob-cart-trigger {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
#mob-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--card);
}
.mob-wa-btn {
  flex: 1;
  height: 44px;
  border-radius: 14px;
  background: var(--wa);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s;
}
.mob-wa-btn:hover { background: var(--wa-dark); }
#mob-cart-total { font-size: 12px; font-weight: 600; opacity: .85; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-m);
}
footer strong { color: var(--text-h); }
.footer-credit {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--text-l);
}
.footer-credit a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity .15s;
}
.footer-credit a:hover { opacity: .75; text-decoration: underline; }

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 900px) {
  #product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
  .btn-wa-header span { display: none; }
  .btn-wa-header { width: 40px; height: 40px; border-radius: 50%; padding: 0; justify-content: center; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 600px) {
  :root { --header-h: 56px; }
  .header { padding: 0 12px; gap: 10px; }
  .logo-text { font-size: 16px; }
  .logo-icon { width: 32px; height: 32px; font-size: 16px; }

  .search-wrap { max-width: none; }
  .btn-wa-header { display: none; }

  .hero { padding: 28px 16px 24px; }
  .hero-stats { gap: 20px; }

  .main { padding: 16px 12px 80px; }

  #product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card-body { padding: 10px 12px 12px; gap: 3px; }
  .card-title { font-size: 13.5px; }
  .card-desc { display: none; }
  .card-price { font-size: 16px; }
  .btn-add { height: 36px; font-size: 13px; margin-top: 8px; }

  .mob-bar { display: flex; }
  #toast { bottom: 72px; font-size: 13px; }
}

@media (max-width: 380px) {
  #product-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product-card {
  animation: fadeInUp .3s ease both;
}
/* stagger first 8 cards */
.product-card:nth-child(1)  { animation-delay: .05s; }
.product-card:nth-child(2)  { animation-delay: .08s; }
.product-card:nth-child(3)  { animation-delay: .11s; }
.product-card:nth-child(4)  { animation-delay: .14s; }
.product-card:nth-child(5)  { animation-delay: .17s; }
.product-card:nth-child(6)  { animation-delay: .20s; }
.product-card:nth-child(7)  { animation-delay: .23s; }
.product-card:nth-child(8)  { animation-delay: .26s; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.filter-select {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-b);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s;
  min-width: 140px;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.filter-price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 36px;
  transition: border-color .2s;
}
.filter-price-wrap:focus-within { border-color: var(--primary); }
.filter-currency { font-size: 13px; color: var(--text-m); font-weight: 600; }
.filter-dash { color: var(--text-l); font-size: 13px; }
.filter-price-input {
  width: 72px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-b);
  outline: none;
}
.filter-price-input::placeholder { color: var(--text-l); }

/* In-stock toggle */
.filter-stock-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-m);
  user-select: none;
}
.filter-stock-label input { display: none; }
.filter-stock-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 20px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.filter-stock-track::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.filter-stock-label input:checked ~ .filter-stock-track { background: var(--primary); }
.filter-stock-label input:checked ~ .filter-stock-track::after { transform: translateX(16px); }
.filter-stock-label input:checked ~ span:last-child { color: var(--primary); font-weight: 600; }

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  height: 36px;
  background: #FEE2E2;
  color: var(--danger);
  border: 1.5px solid #FECACA;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-clear-filters:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

@media (max-width: 600px) {
  .filter-bar { gap: 8px; padding: 8px 16px; }
  .filter-select { min-width: 120px; }
  .filter-price-input { width: 56px; }
}

/* ============================================================
   CARD LINK + RESTRUCTURED CARD
   ============================================================ */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.card-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-info {
  padding: 14px 14px 8px;
}

.card-actions {
  padding: 0 14px 14px;
}

/* Keep existing card-body padding behavior for card-info */
.product-card .card-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-l);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.product-card .card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .card-desc {
  font-size: 12px;
  color: var(--text-m);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .card-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

/* Card hover cursor */
.product-card[data-product-id] { cursor: pointer; }

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
#announcement-banner {
  background: var(--banner-bg, #4F46E5);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 9px 48px 9px 16px;
  position: relative;
  letter-spacing: .1px;
  line-height: 1.4;
}
#announcement-dismiss {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  font-family: inherit;
}
#announcement-dismiss:hover { background: rgba(255,255,255,.35); }

/* ============================================================
   CATALOG LAYOUT — sidebar + content
   ============================================================ */
.catalog-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Left Sidebar ── */
.cat-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-close-row { display: none; }

.sidebar-section {
  border-bottom: 1px solid var(--border);
  padding: 16px 14px;
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-l);
  margin-bottom: 12px;
}

/* Sidebar filter controls */
.sidebar-filters { display: flex; flex-direction: column; gap: 12px; }

.sf-group { display: flex; flex-direction: column; gap: 5px; }
.sf-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-m);
}
.sf-select {
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-b);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}
.sf-select:focus { outline: none; border-color: var(--primary); }

.sf-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  height: 34px;
}
.sf-price-row:focus-within { border-color: var(--primary); }
.sf-price-input {
  width: 60px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-b);
  outline: none;
}
.sf-price-input::placeholder { color: var(--text-l); }
.sf-price-row span { color: var(--text-l); font-size: 12px; }

.sf-stock-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-m);
  user-select: none;
}
.sf-stock-label input { display: none; }
.sf-stock-track {
  width: 32px;
  height: 18px;
  background: var(--border);
  border-radius: 18px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.sf-stock-track::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.sf-stock-label input:checked ~ .sf-stock-track { background: var(--primary); }
.sf-stock-label input:checked ~ .sf-stock-track::after { transform: translateX(14px); }
.sf-stock-label input:checked ~ span:last-child { color: var(--primary); font-weight: 600; }

/* Sidebar category buttons */
.sidebar-cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-b);
  background: transparent;
  text-align: left;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.sidebar-cat-btn:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-cat-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.sidebar-cat-icon { font-size: 16px; flex-shrink: 0; }
.sidebar-cat-name { flex: 1; }
.sidebar-sub-count {
  font-size: 11px;
  background: var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  color: var(--text-m);
}
.sidebar-cat-btn.active .sidebar-sub-count { background: rgba(255,255,255,.25); color: #fff; }

/* Sub-categories */
.sidebar-subs {
  padding: 4px 0 4px 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-sub-btn {
  display: block;
  width: 100%;
  padding: 5px 10px;
  text-align: left;
  font-size: 13px;
  color: var(--text-m);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-sub-btn:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-sub-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Main content area */
.cat-content {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 80px;
}

/* Mobile filter toggle row */
.mob-filter-row {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.mob-filter-toggle {
  height: 34px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color .2s, color .2s;
}
.mob-filter-toggle:hover { border-color: var(--primary); color: var(--primary); }
.mob-active-filters {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Desktop: sidebar visible, mobile bar hidden ── */
@media (min-width: 900px) {
  .category-bar { display: none; }
  .mob-filter-row { display: none !important; }
  .sidebar-close-row { display: none; }
}

/* ── Mobile: sidebar collapses, top bar shown ── */
@media (max-width: 899px) {
  .catalog-layout { display: block; }
  .cat-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 300;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    overflow-y: auto;
  }
  .cat-sidebar.open { display: block; }
  .sidebar-close-row {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px 4px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-close-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-m);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
  }
  .mob-filter-row { display: flex; }
  .cat-content { padding: 16px 16px 80px; }
  .category-bar { display: block; }
}

/* ============================================================
   COUPON CODE — cart drawer
   ============================================================ */
.coupon-section {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1.5px dashed var(--border);
}
.coupon-input-row {
  display: flex;
  gap: 8px;
}
.coupon-input-row input {
  flex: 1;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-b);
  background: var(--card);
  outline: none;
  transition: border-color .2s;
}
.coupon-input-row input:focus { border-color: var(--primary); }
.coupon-input-row button {
  height: 36px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.coupon-input-row button:hover { background: var(--primary-dark); }
#coupon-msg { margin-top: 6px; font-size: 12px; font-weight: 500; min-height: 16px; }
.coupon-success { color: var(--success); }
.coupon-error   { color: var(--danger); }

/* Cart discount row */
.cart-discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-discount-row .label { font-size: 13px; color: var(--success); }
.cart-discount-row .discount-label { font-weight: 600; }
.cart-discount-row .discount-amount { font-size: 16px; font-weight: 700; color: var(--success); }
.cart-final-row .amount { color: var(--primary) !important; }
