/* =============================================
   CSS CUSTOM PROPERTIES
============================================= */
:root {
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-200: #bae6fd;
  --brand-300: #7dd3fc;
  --brand-400: #38bdf8;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-800: #075985;
  --brand-900: #0c4a6e;

  --accent: #06b6d4;
  --accent-light: #cffafe;

  --bg-page: #f4faff;
  --bg-card: #ffffff;
  --bg-hover: #e0f2fe;
  --bg-active: #bae6fd;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2eef7;
  --border-focus: var(--brand-400);

  --topbar-h: 64px;
  --catbar-h: 56px;
  --bottom-nav-h: 68px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(14, 165, 233, .08), 0 1px 2px rgba(14, 165, 233, .04);
  --shadow-md: 0 4px 16px rgba(14, 165, 233, .12), 0 2px 6px rgba(14, 165, 233, .06);
  --shadow-lg: 0 12px 40px rgba(14, 165, 233, .18), 0 4px 14px rgba(14, 165, 233, .08);

  --transition: 0.22s cubic-bezier(.4, 0, .2, 1);

  --font-base: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Font size scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 26px;
  --fs-2xl: 32px;
}

/* =============================================
   RESET & BASE
============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-base);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bottom-nav-h);
  font-size: var(--fs-base);
  line-height: 1.5;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* =============================================
   PAGE LOADER
============================================= */
#pageLoader {
  position: fixed;
  inset: 0;
  background: rgba(224, 242, 254, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.loader-content {
  text-align: center;
}
.loader-logo {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--brand-500);
  letter-spacing: -1px;
  margin-bottom: 14px;
  animation: bounce 1.6s infinite ease-in-out;
}
.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--brand-100);
  border-top: 4px solid var(--brand-500);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
.loader-text {
  font-size: var(--fs-base);
  color: var(--text-primary);
  font-weight: 500;
}
@keyframes spin {
  0% { transform: rotate(0deg) }
  100% { transform: rotate(360deg) }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-10px) }
}

/* =============================================
   TOP NAVBAR
============================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}
.brand-logo,
.footer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.brand-icon-fallback svg {
  width: 40px;
  height: 40px;
  color: var(--brand-500);
}
.brand-name {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--brand-700), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-search {
  flex: 1;
  max-width: 560px;
  position: relative;
  margin: 0 auto;
}
.nav-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg-page);
  font-family: var(--font-base);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.nav-search input::placeholder {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.nav-search input:focus {
  border-color: var(--brand-400);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .15);
}
.nav-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Login dropdown */
.login-dropdown {
  position: relative;
}
.login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all var(--transition);
}
.login-btn:hover {
  background: var(--bg-hover);
  border-color: var(--brand-300);
  color: var(--brand-700);
}
.login-btn svg {
  width: 18px;
  height: 18px;
}
.login-btn .chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}
.login-dropdown.open .login-btn .chevron {
  transform: rotate(180deg);
}

.login-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 210;
}
.login-dropdown.open .login-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.login-menu-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 6px;
}
.login-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.login-option:hover {
  background: var(--bg-hover);
  color: var(--brand-700);
}
.login-option svg {
  width: 18px;
  height: 18px;
  opacity: .85;
  flex-shrink: 0;
}
.login-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Cart button in navbar */
.cart-btn-nav {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  flex-shrink: 0;
}
.cart-btn-nav:hover {
  background: var(--bg-hover);
  border-color: var(--brand-300);
  color: var(--brand-600);
}
.cart-btn-nav svg {
  width: 20px;
  height: 20px;
}
.cart-badge-nav {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, .4);
}

/* =============================================
   CATEGORY BAR
============================================= */
.category-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar {
  display: none;
}
.cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
}
.cat-btn svg {
  width: 16px;
  height: 16px;
  opacity: .8;
  flex-shrink: 0;
}
.cat-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-700);
  background: var(--brand-50);
}
.cat-btn.active {
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 14px rgba(14, 165, 233, .35);
}

/* =============================================
   PAGE CONTAINER & SECTIONS
============================================= */
.page-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.page-section {
  display: none;
  padding: 22px 18px 28px;
  animation: fadePage 0.3s ease;
}
.page-section.active {
  display: block;
}

@keyframes fadePage {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-heading h2 {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.section-heading .result-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Sort-by control (Home / Categories product grids) ---- */
.section-heading-sortable {
  align-items: center;
}
.heading-right-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.sort-select-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1.5px solid var(--border);
  background: var(--bg-card) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 14px;
  border-radius: var(--radius-sm);
  padding: 8px 30px 8px 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}
.sort-select:hover {
  border-color: var(--brand-300);
}
.sort-select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .15);
}
@media (max-width: 480px) {
  .heading-right-cluster {
    width: 100%;
    justify-content: space-between;
  }
  .sort-select-label {
    display: none;
  }
  .sort-select {
    padding: 7px 26px 7px 10px;
    font-size: 11.5px;
  }
}

/* =============================================
   PRODUCT GRID
   Mobile-first default below; desktop breakpoints further down
   force a clean 5-per-row layout with slightly taller cards.
============================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--brand-200);
}

.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease, filter .3s ease;
}
.product-card:hover .product-thumb img {
  transform: scale(1.06);
}
.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.wishlist-btn:hover {
  color: #ef4444;
  background: #fff;
}
.wishlist-btn svg {
  width: 13px;
  height: 13px;
}

/* --- Out of stock: blurred thumbnail + centered badge, directly
   on the product card in the grid (no need to open the modal) --- */
.product-card.out-of-stock .product-thumb img {
  filter: blur(3px) grayscale(0.35) brightness(0.92);
  transform: scale(1.04);
}
.product-card.out-of-stock:hover .product-thumb img {
  transform: scale(1.04);
}
.product-card.out-of-stock .product-thumb {
  position: relative;
}
.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.16);
}
.oos-badge {
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .18);
}
.product-card.out-of-stock .product-name,
.product-card.out-of-stock .product-price,
.product-card.out-of-stock .product-cat,
.product-card.out-of-stock .product-rating {
  opacity: .55;
}
.product-card.out-of-stock:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.product-body {
  padding: 9px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.product-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--brand-600);
}
.product-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.product-rating svg {
  width: 12px;
  height: 12px;
  color: #f59e0b;
  fill: #f59e0b;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  gap: 6px;
}
.product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.price-now {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.price-old {
  font-size: 10.5px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-family: var(--font-mono);
}

.add-cart-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(14, 165, 233, .35);
  transition: background var(--transition), transform var(--transition);
}
.add-cart-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
}
.add-cart-btn:active {
  transform: scale(0.92);
}
.add-cart-btn svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  opacity: .4;
}
.empty-state p {
  font-size: var(--fs-base);
  font-weight: 500;
}

/* =============================================
   PRODUCT DETAIL MODAL — premium redesign...
============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(8, 15, 30, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  overscroll-behavior: contain;
}
@media (max-width: 719px) {
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 900px;
  /* vh fallback for older browsers, then the real measured height */
  max-height: 90vh;
  max-height: calc(var(--app-height, 100vh) * 0.90);
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(2, 8, 23, .35), 0 8px 24px rgba(2, 8, 23, .15);
  display: flex;
  flex-direction: column;
  transform: scale(.94) translateY(18px);
  transition: transform .32s cubic-bezier(.16, 1, .3, 1), opacity .32s ease;
}
.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
}
@media (min-width: 720px) {
  .modal-box {
    flex-direction: row;
    max-height: 88vh;
    max-height: calc(var(--app-height, 100vh) * 0.88);
  }
}
@media (max-width: 719px) {
  /* Bottom-sheet feel on mobile: use nearly the full viewport height
     instead of a small centered card, so the info panel has real
     room to breathe below the (now-shorter) gallery image.
     --app-height (set in script1.js from window.innerHeight) is
     used instead of vh so the sheet never overshoots the actual
     visible area when the browser's address bar is showing —
     that overshoot was what made the gallery image look like it
     was merging into the top browser chrome. */
  .modal-box {
    max-height: 92vh;
    max-height: calc(var(--app-height, 100vh) * 0.92);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(24px);
  }
  .modal-overlay.show .modal-box {
    transform: translateY(0);
  }
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-md);
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.modal-close:hover {
  background: #fff;
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* --- Gallery: main image + thumbnail strip --- */
.modal-gallery {
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--brand-50), var(--brand-100) 65%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 12px;
  width: 100%;
}
@media (min-width: 720px) {
  .modal-gallery {
    width: 340px;
    padding: 30px 22px;
    overflow-y: auto;
  }
}
.modal-main-img {
  position: relative;
  width: 100%;
  /* Mobile: fixed, modest height instead of a full square, so the
     image doesn't push the info panel (price/desc/CTA) off-screen. */
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(2, 8, 23, .08);
  cursor: zoom-in;
}
@media (min-width: 720px) {
  .modal-main-img {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}
.modal-main-img img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), filter .3s ease;
  cursor: zoom-in;
}
.modal-main-img:hover img {
  transform: scale(1.08);
}
.modal-oos-ribbon {
  position: absolute;
  top: 18px;
  left: -38px;
  transform: rotate(-45deg);
  width: 160px;
  text-align: center;
  padding: 6px 0;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(220, 38, 38, .35);
  display: none;
  z-index: 2;
}
.modal-main-img.is-out-of-stock img {
  filter: blur(2.5px) grayscale(0.4) brightness(0.9);
}
.modal-main-img.is-out-of-stock .modal-oos-ribbon {
  display: block;
}
.modal-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-thumb-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.modal-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-thumb-btn.active,
.modal-thumb-btn:hover {
  border-color: var(--brand-500);
  transform: translateY(-2px);
}

/* --- Info column: title, price, description, features, reviews --- */
.modal-info {
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  /* No overflow-y here on purpose: .modal-box is the single scroll
     container. Two nested auto-scroll flex children fight for space
     and the inner one (this) collapses to a sliver on mobile where
     everything stacks in one column. */
}
@media (min-width: 720px) {
  .modal-info {
    overflow-y: auto;
  }
}
.modal-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-cat {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--brand-600);
  background: var(--brand-50);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--brand-200);
}
.modal-sku {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.modal-info h3 {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -.4px;
  margin-top: 8px;
}
.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.modal-brand {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 600;
}
.modal-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-primary);
  width: fit-content;
  background: #fff7ed;
  border: 1px solid #fde5c8;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
}
.modal-rating svg {
  width: 14px;
  height: 14px;
  color: #f59e0b;
  fill: #f59e0b;
}
.modal-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  margin-top: 14px;
  flex-wrap: wrap;
}
.modal-price-now {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.5px;
}
.modal-price-old {
  font-size: var(--fs-base);
  color: var(--text-muted);
  text-decoration: line-through;
}
.modal-discount-badge {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  padding: 3px 10px;
  border-radius: 999px;
}
.modal-savings {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #16a34a;
  margin-top: 2px;
}
.modal-stock {
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.modal-stock::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px currentColor22;
}
.modal-stock.in {
  color: #16a34a;
}
.modal-stock.out {
  color: #ef4444;
}

.modal-trust-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.modal-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
}
.modal-trust-item svg {
  width: 15px;
  height: 15px;
  color: var(--brand-500);
  flex-shrink: 0;
}

.modal-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.modal-section h4 {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.modal-section p#modalDesc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
}

.modal-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-features-list li {
  list-style: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  padding: 7px 13px;
  border-radius: 999px;
}
.modal-features-list li::before {
  content: '✓ ';
  color: var(--brand-500);
  font-weight: 800;
}

#modalReviewsList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.review-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
}
.review-stars svg {
  width: 14px;
  height: 14px;
  color: var(--border);
  fill: var(--border);
}
.review-stars svg.filled {
  color: #f59e0b;
  fill: #f59e0b;
}
.review-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Sticky action row: qty stepper + Add to Cart + Buy Now --- */
.modal-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: -24px;
  background: var(--bg-card);
}
.modal-qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.modal-qty-btn {
  width: 38px;
  height: 100%;
  min-height: 48px;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: var(--fs-md);
  font-weight: 700;
  transition: all var(--transition);
}
.modal-qty-btn:hover {
  background: var(--bg-hover);
  color: var(--brand-600);
}
.modal-qty-num {
  width: 34px;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: var(--fs-base);
}
.modal-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: 700;
  text-align: center;
  transition: all var(--transition);
}
.modal-btn-cart {
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  color: var(--brand-700);
}
.modal-btn-cart:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--brand-300);
}
.modal-btn-buy {
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff;
  box-shadow: 0 4px 18px rgba(14, 165, 233, .4);
}
.modal-btn-buy:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(14, 165, 233, .45);
}
.modal-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.modal-qty-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
@media (max-width: 719px) {
  .modal-info {
    padding: 18px 16px 16px;
    gap: 5px;
  }
  .modal-gallery {
    padding: 14px 14px 10px;
    gap: 8px;
  }
  .modal-main-img {
    height: 180px;
  }
  .modal-thumb-btn {
    width: 46px;
    height: 46px;
  }
  .modal-info h3 {
    font-size: var(--fs-md);
    margin-top: 4px;
  }
  .modal-price-now {
    font-size: 24px;
  }
  .modal-section {
    margin-top: 10px;
    padding-top: 10px;
  }
  .modal-trust-row {
    margin-top: 12px;
    gap: 8px;
  }
  .modal-trust-item {
    padding: 6px 9px;
    font-size: 10.5px;
  }
  .modal-actions {
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    /* Sticky along the modal-box's own scroll, so the CTA row
       stays reachable without hunting for it at the bottom. */
    position: sticky;
    bottom: -18px;
  }
  .modal-qty-stepper {
    order: 1;
  }
  .modal-btn-cart {
    order: 2;
    flex: 1 1 auto;
  }
  .modal-btn-buy {
    order: 3;
    flex-basis: 100%;
  }
}

/* =============================================
   CATEGORIES PAGE
============================================= */
.category-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.category-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 14px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.category-card.active {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}
.category-card .cat-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--brand-100);
  display: grid;
  place-items: center;
  color: var(--brand-600);
  transition: all var(--transition);
}
.category-card.active .cat-icon {
  background: var(--brand-500);
  color: #fff;
}
.category-card .cat-icon svg {
  width: 26px;
  height: 26px;
}
.category-card .cat-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-primary);
}
.category-card .cat-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 3px;
}

/* =============================================
   ACCOUNT PAGE
============================================= */
.account-container {
  max-width: 520px;
  margin: 0 auto;
}
.account-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px 36px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--brand-600);
}
.account-card h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 4px;
}
.account-card .sub {
  font-size: var(--fs-base);
  color: var(--text-muted);
  margin-bottom: 22px;
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.login-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}
.login-option-btn:hover {
  background: var(--bg-hover);
  border-color: var(--brand-300);
  color: var(--brand-700);
}
.login-option-btn svg {
  width: 20px;
  height: 20px;
  color: var(--brand-500);
  flex-shrink: 0;
}
.login-option-btn .role-badge {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-600);
}

.login-divider {
  height: 1.5px;
  background: var(--border);
  margin: 18px 0;
}

.create-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px dashed var(--brand-300);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--brand-600);
  transition: all var(--transition);
  width: 100%;
}
.create-account-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
}
.create-account-btn svg {
  width: 20px;
  height: 20px;
}

/* =============================================
   CART PAGE
============================================= */
.cart-container {
  max-width: 680px;
  margin: 0 auto;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.cart-empty svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  opacity: .3;
}
.cart-empty p {
  font-size: var(--fs-md);
  font-weight: 500;
}
.cart-empty .sub {
  font-size: var(--fs-base);
  color: var(--text-muted);
}

.cart-item {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  align-items: center;
}
.cart-item:hover {
  border-color: var(--brand-200);
}
.cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand-50);
}
.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-info .name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-info .price {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.cart-item-info .cat {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--brand-600);
  letter-spacing: .4px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cart-item-qty button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: var(--fs-md);
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.cart-item-qty button:hover {
  background: var(--bg-hover);
  border-color: var(--brand-300);
  color: var(--brand-600);
}
.cart-item-qty .qty-num {
  font-weight: 700;
  font-size: var(--fs-base);
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono);
}

.cart-item-remove {
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.cart-item-remove:hover {
  color: #ef4444;
  background: #fef2f2;
}
.cart-item-remove svg {
  width: 18px;
  height: 18px;
}

.cart-summary {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: var(--fs-base);
  color: var(--text-secondary);
}
.cart-summary-row.total {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--text-primary);
  border-top: 1.5px solid var(--border);
  padding-top: 14px;
  margin-top: 8px;
}
.cart-summary-row.total .amount {
  color: var(--brand-600);
}

.checkout-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 700;
  margin-top: 16px;
  box-shadow: 0 3px 16px rgba(14, 165, 233, .35);
  transition: all var(--transition);
  text-align: center;
}
.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, .4);
}
.checkout-btn:active {
  transform: scale(0.98);
}

/* =============================================
   BOTTOM NAVIGATION
============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  height: var(--bottom-nav-h);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, .06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: all var(--transition);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-width: 60px;
  flex: 1;
  max-width: 84px;
}
.nav-item svg {
  width: 24px;
  height: 24px;
  transition: all var(--transition);
}
.nav-item span {
  line-height: 1.2;
  font-size: var(--fs-xs);
  letter-spacing: .2px;
}
.nav-item:hover {
  color: var(--brand-500);
}
.nav-item.active {
  color: var(--brand-600);
}
.nav-item.active svg {
  stroke: var(--brand-500);
  fill: var(--brand-500);
  fill-opacity: 0.08;
}

.nav-item .nav-badge {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  border-radius: 999px;
  display: none;
  place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, .35);
}
.nav-item .nav-badge.show {
  display: grid;
}

/* =============================================
   TOAST
============================================= */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 440px;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn .28s cubic-bezier(.4, 0, .2, 1);
  pointer-events: auto;
  width: 100%;
  justify-content: center;
}
.toast.success {
  border-left: 4px solid #22c55e;
}
.toast.info {
  border-left: 4px solid var(--brand-400);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.96) }
  to { opacity: 1; transform: translateY(0) scale(1) }
}

/* =============================================
   IMAGE ZOOM MODAL - Full screen image viewer
============================================= */
.image-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  overscroll-behavior: contain;
}

.image-zoom-overlay.show {
  opacity: 1;
  visibility: visible;
}

.image-zoom-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 90vh;
  max-height: calc(var(--app-height, 100vh) * 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-zoom-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-zoom-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.image-zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.image-zoom-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.05);
}

.image-zoom-close svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
}

@media (max-width: 768px) {
  .image-zoom-overlay {
    padding: 10px;
  }

  .image-zoom-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .image-zoom-close svg {
    width: 22px;
    height: 22px;
  }

  .image-zoom-wrapper img {
    max-height: 85vh;
    max-height: calc(var(--app-height, 100vh) * 0.85);
  }
}

@media (max-width: 420px) {
  .image-zoom-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
  
  .image-zoom-close svg {
    width: 18px;
    height: 18px;
  }
}

/* =============================================
   FOOTER (desktop)
============================================= */
.site-footer {
  display: none;
  background: #ffffff;
  border-top: 1.5px solid var(--border);
  margin-top: 40px;
}
.footer-top {
  max-width: 1400px;
  margin: 0 auto;
  padding: 44px 28px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 32px;
}
.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-brand-row .footer-logo {
  height: 40px;
  width: auto;
}
.footer-about p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 340px;
}
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.footer-social a:hover {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.footer-social svg {
  width: 17px;
  height: 17px;
}

.footer-col h4 {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-col ul li a:hover {
  color: var(--brand-600);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.footer-contact svg {
  width: 17px;
  height: 17px;
  color: var(--brand-500);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  border-top: 1.5px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.footer-payments {
  display: flex;
  gap: 8px;
}
.footer-payments span {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 5px;
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* =============================================
   SCROLLBAR
============================================= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--brand-200);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-300);
}

/* =============================================
   RESPONSIVE
============================================= */

/* DESKTOP & TABLET — show footer, hide bottom nav */
@media (min-width: 769px) {
  body {
    padding-bottom: 0;
  }
  .bottom-nav {
    display: none !important;
  }
  .site-footer {
    display: block;
  }
  .navbar {
    padding: 0 32px;
    height: 72px;
  }
  .brand-name {
    font-size: var(--fs-lg);
  }
  .brand-icon-fallback svg {
    width: 44px;
    height: 44px;
  }
  .nav-search input {
    height: 48px;
    font-size: var(--fs-base);
    padding: 0 20px 0 48px;
  }
  .nav-search .search-icon {
    left: 16px;
    width: 20px;
    height: 20px;
  }
  .category-bar {
    padding: 12px 32px;
    top: 72px;
    gap: 12px;
  }
  .cat-btn {
    padding: 12px 24px;
    font-size: var(--fs-base);
  }
  .cat-btn svg {
    width: 18px;
    height: 18px;
  }
  .page-section {
    padding: 28px 32px 36px;
  }
  .section-heading h2 {
    font-size: var(--fs-xl);
  }
  /* Tablet range (769px - 1199px): comfortably auto-fit, 5-col kicks in below */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
  }
  .product-thumb {
    max-height: 165px;
  }
  .product-name {
    font-size: var(--fs-sm);
    min-height: 36px;
  }
  .price-now {
    font-size: var(--fs-base);
  }
  .category-grid-page {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
  }
  .cart-item {
    padding: 18px 24px;
  }
  .cart-item-img {
    width: 80px;
    height: 80px;
  }
  .account-card {
    padding: 40px 36px 44px;
  }
  .login-option-btn {
    font-size: var(--fs-base);
    padding: 16px 20px;
  }
  .footer-top {
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  }
}

/* WIDE DESKTOP — exactly 5 products per row, moderately taller cards */
@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  .product-thumb {
    max-height: 185px;
  }
  .product-name {
    min-height: 38px;
  }
}

/* MOBILE — show bottom nav, hide footer */
@media (max-width: 768px) {
  .site-footer {
    display: none !important;
  }
  .bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: var(--bottom-nav-h);
  }

  .navbar {
    padding: 0 14px;
    height: 58px;
    gap: 10px;
  }
  .brand-name {
    font-size: var(--fs-base);
  }
  .brand-icon-fallback svg {
    width: 34px;
    height: 34px;
  }
  .nav-search input {
    height: 38px;
    font-size: var(--fs-sm);
    padding: 0 12px 0 36px;
  }
  .nav-search .search-icon {
    left: 12px;
    width: 16px;
    height: 16px;
  }
  .login-btn .login-label {
    display: none;
  }
  .login-btn {
    padding: 8px 12px;
  }
  .cart-btn-nav {
    width: 38px;
    height: 38px;
  }
  .cart-btn-nav svg {
    width: 18px;
    height: 18px;
  }
  .cart-badge-nav {
    min-width: 18px;
    height: 18px;
    font-size: var(--fs-xs);
    top: -3px;
    right: -3px;
  }

  .category-bar {
    padding: 8px 14px;
    top: 58px;
    gap: 8px;
  }
  .cat-btn {
    padding: 8px 16px;
    font-size: var(--fs-sm);
  }
  .cat-btn svg {
    width: 14px;
    height: 14px;
  }

  .page-section {
    padding: 16px 14px 20px;
  }
  .section-heading h2 {
    font-size: var(--fs-md);
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-body {
    padding: 10px 12px 12px;
  }
  .product-name {
    font-size: var(--fs-sm);
    min-height: 36px;
  }
  .price-now {
    font-size: var(--fs-base);
  }
  .price-old {
    font-size: var(--fs-xs);
  }
  .add-cart-btn {
    width: 32px;
    height: 32px;
  }
  .add-cart-btn svg {
    width: 15px;
    height: 15px;
  }
  .product-badge {
    font-size: var(--fs-xs);
    padding: 2px 10px;
    top: 8px;
    left: 8px;
  }
  .wishlist-btn {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
  }
  .wishlist-btn svg {
    width: 14px;
    height: 14px;
  }

  .category-grid-page {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .category-card {
    padding: 16px 10px;
  }
  .category-card .cat-icon {
    width: 42px;
    height: 42px;
  }
  .category-card .cat-icon svg {
    width: 20px;
    height: 20px;
  }
  .category-card .cat-name {
    font-size: var(--fs-sm);
  }
  .category-card .cat-count {
    font-size: var(--fs-xs);
  }

  .cart-item {
    padding: 12px 14px;
    gap: 12px;
  }
  .cart-item-img {
    width: 54px;
    height: 54px;
  }
  .cart-item-info .name {
    font-size: var(--fs-sm);
  }
  .cart-item-info .price {
    font-size: var(--fs-base);
  }
  .cart-item-qty button {
    width: 28px;
    height: 28px;
    font-size: var(--fs-base);
  }
  .cart-item-qty .qty-num {
    font-size: var(--fs-sm);
    min-width: 20px;
  }

  .cart-summary {
    padding: 16px 18px;
  }
  .cart-summary-row {
    font-size: var(--fs-sm);
  }
  .cart-summary-row.total {
    font-size: var(--fs-base);
  }
  .checkout-btn {
    font-size: var(--fs-base);
    padding: 14px;
  }

  .account-card {
    padding: 24px 18px 28px;
  }
  .account-avatar {
    width: 64px;
    height: 64px;
    font-size: var(--fs-xl);
  }
  .account-card h3 {
    font-size: var(--fs-md);
  }
  .login-option-btn {
    font-size: var(--fs-sm);
    padding: 12px 14px;
  }
  .create-account-btn {
    font-size: var(--fs-sm);
    padding: 12px 14px;
  }

  .nav-item {
    min-width: 48px;
    padding: 6px 8px;
    font-size: var(--fs-xs);
  }
  .nav-item svg {
    width: 20px;
    height: 20px;
  }
  .nav-item .nav-badge {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    right: 2px;
    top: -1px;
  }
}

/* SMALL PHONES */
@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-name {
    font-size: var(--fs-xs);
    min-height: 30px;
  }
  .price-now {
    font-size: var(--fs-sm);
  }
  .price-old {
    font-size: 10px;
  }
  .product-body {
    padding: 8px 8px 10px;
  }
  .product-cat {
    font-size: 10px;
  }
  .product-rating {
    font-size: var(--fs-xs);
  }
  .product-rating svg {
    width: 11px;
    height: 11px;
  }
  .add-cart-btn {
    width: 26px;
    height: 26px;
  }
  .add-cart-btn svg {
    width: 13px;
    height: 13px;
  }
  .category-grid-page {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .category-card {
    padding: 12px 6px;
  }
  .category-card .cat-icon {
    width: 34px;
    height: 34px;
  }
  .category-card .cat-icon svg {
    width: 16px;
    height: 16px;
  }
  .category-card .cat-name {
    font-size: var(--fs-xs);
  }
  .category-card .cat-count {
    font-size: 10px;
  }
  .cart-item {
    padding: 10px 10px;
    gap: 10px;
  }
  .cart-item-img {
    width: 44px;
    height: 44px;
  }
  .cart-item-info .name {
    font-size: var(--fs-xs);
  }
  .cart-item-info .price {
    font-size: var(--fs-sm);
  }
  .cart-item-qty button {
    width: 24px;
    height: 24px;
    font-size: var(--fs-sm);
  }
  .cart-item-qty .qty-num {
    font-size: var(--fs-xs);
    min-width: 16px;
  }
  .cart-summary {
    padding: 14px 14px;
  }
  .cart-summary-row {
    font-size: var(--fs-xs);
  }
  .cart-summary-row.total {
    font-size: var(--fs-sm);
  }
  .checkout-btn {
    font-size: var(--fs-sm);
    padding: 12px;
  }
  .navbar {
    padding: 0 10px;
    height: 52px;
    gap: 6px;
  }
  .brand-name {
    font-size: var(--fs-sm);
  }
  .brand-icon-fallback svg {
    width: 28px;
    height: 28px;
  }
  .nav-search input {
    height: 32px;
    font-size: var(--fs-xs);
    padding: 0 10px 0 30px;
  }
  .nav-search .search-icon {
    left: 10px;
    width: 13px;
    height: 13px;
  }
  .login-btn {
    padding: 6px 10px;
    font-size: var(--fs-xs);
  }
  .login-btn svg {
    width: 15px;
    height: 15px;
  }
  .cart-btn-nav {
    width: 32px;
    height: 32px;
  }
  .cart-btn-nav svg {
    width: 15px;
    height: 15px;
  }
  .cart-badge-nav {
    min-width: 15px;
    height: 15px;
    font-size: 8px;
    top: -2px;
    right: -2px;
  }
  .category-bar {
    padding: 6px 10px;
    top: 52px;
    gap: 6px;
  }
  .cat-btn {
    padding: 6px 12px;
    font-size: var(--fs-xs);
  }
  .cat-btn svg {
    width: 12px;
    height: 12px;
  }
  .page-section {
    padding: 12px 10px 16px;
  }
  .section-heading h2 {
    font-size: var(--fs-base);
  }
  .section-heading .result-count {
    font-size: var(--fs-xs);
  }
  .account-card {
    padding: 18px 14px 22px;
  }
  .account-avatar {
    width: 52px;
    height: 52px;
    font-size: var(--fs-lg);
  }
  .account-card h3 {
    font-size: var(--fs-base);
  }
  .login-option-btn {
    font-size: var(--fs-xs);
    padding: 10px 12px;
    gap: 10px;
  }
  .login-option-btn svg {
    width: 16px;
    height: 16px;
  }
  .create-account-btn {
    font-size: var(--fs-xs);
    padding: 10px 12px;
  }
  .bottom-nav {
    height: 58px;
  }
  .nav-item {
    min-width: 40px;
    padding: 4px 6px;
    font-size: 9px;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .nav-item .nav-badge {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
    right: 1px;
    top: -1px;
  }
  #toast-container {
    bottom: 72px;
    width: 92%;
  }
  .toast {
    font-size: var(--fs-xs);
    padding: 12px 16px;
  }
}

/* UTILITY */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.w-full { width: 100%; }