/* =============================================
   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;
}

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

.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  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;
  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;
}
.product-card:hover .product-thumb img {
  transform: scale(1.06);
}
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  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);
}
.wishlist-btn:hover {
  color: #ef4444;
  background: #fff;
}
.wishlist-btn svg {
  width: 17px;
  height: 17px;
}

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

.add-cart-btn {
  width: 38px;
  height: 38px;
  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 {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
}
.add-cart-btn:active {
  transform: scale(0.92);
}
.add-cart-btn svg {
  width: 18px;
  height: 18px;
}

.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;
}

/* =============================================
   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) }
}

/* =============================================
   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);
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
  }
  .product-name {
    font-size: var(--fs-base);
    min-height: 48px;
  }
  .price-now {
    font-size: var(--fs-md);
  }
  .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;
  }
}

/* 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%; }