:root {
  --brand: #4338CA;
  --brand-2: #6366F1;
  --accent: #0EA5E9;
  --bg: #fff;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --subtle: #94A3B8;
  --green: #10B981;
  --red: #EF4444;
  --border: #E2E8F0;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 64px;
  --safe-bot: env(safe-area-inset-bottom, 0px);

  /* shadow system */
  --sh-xs: 0 1px 2px rgba(15,23,42,0.05);
  --sh-sm: 0 2px 8px rgba(15,23,42,0.07), 0 0 0 1px rgba(15,23,42,0.03);
  --sh-md: 0 8px 24px rgba(67,56,202,0.10), 0 2px 8px rgba(15,23,42,0.05);
  --sh-lg: 0 20px 48px rgba(67,56,202,0.14), 0 4px 16px rgba(15,23,42,0.06);
  --sh-brand: 0 4px 16px rgba(67,56,202,0.32);
  --sh-inner: inset 0 1px 3px rgba(15,23,42,0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  overscroll-behavior: none;
}

/* ── LOGO ── */
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo .e { color: var(--accent); }
.logo .t { color: var(--brand); font-style: normal; }
.logo-tagline { font-size: 11px; color: var(--muted); line-height: 1; }

/* ── DESKTOP HEADER ── */
#d-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 1px 20px rgba(67,56,202,0.07);
  height: 68px;
}

.d-hdr-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.d-logo {
  flex-shrink: 0;
  font-size: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 2px rgba(67,56,202,0.12));
}
.d-logo .e, .d-logo .t { color: inherit; -webkit-text-fill-color: inherit; }

.d-hdr-search {
  flex: 1;
  position: relative;
  max-width: 520px;
}

.d-hdr-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  width: 17px;
  height: 17px;
  pointer-events: none;
  transition: color 0.2s;
}

.d-hdr-search:focus-within svg { color: var(--brand); }

#d-search-input {
  width: 100%;
  height: 44px;
  border: 1.5px solid rgba(67,56,202,0.14);
  border-radius: 9999px;
  padding: 0 18px 0 42px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #F5F7FF;
  outline: none;
  box-shadow: var(--sh-inner);
  transition: all 0.2s var(--ease);
}
#d-search-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(67,56,202,0.10), var(--sh-inner);
}
#d-search-input::placeholder { color: var(--subtle); }

.d-hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.d-hdr-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(67,56,202,0.14);
  background: #F5F7FF;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.2s var(--ease);
  box-shadow: var(--sh-xs);
}
.d-hdr-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--sh-brand);
  transform: translateY(-1px);
}
.d-hdr-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.d-hdr-btn .nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  box-shadow: 0 0 0 2px white;
}

/* ── DESKTOP SIDEBAR ── */
#d-sidebar { display: none; }

.sf-section { margin-bottom: 20px; }
.sf-section:last-child { margin-bottom: 0; }

.sf-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--subtle);
  margin-bottom: 8px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sf-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sf-list { display: flex; flex-direction: column; gap: 2px; }

.sf-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  border: none;
  border-radius: 12px;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.sf-item:hover {
  background: #EEF2FF;
  color: var(--brand);
  padding-left: 16px;
}
.sf-item.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  box-shadow: var(--sh-brand);
  font-weight: 600;
}

.sf-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: 12px;
  transition: background 0.15s;
}
.sf-toggle-row:hover { background: #EEF2FF; }
.sf-toggle-row input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); }

/* ── MOBILE HEADER ── */
#m-cat-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,0.7);
  padding: 12px 16px 0;
  box-shadow: 0 1px 12px rgba(67,56,202,0.06);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-wrap { flex: 1; position: relative; }

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  width: 17px;
  height: 17px;
  pointer-events: none;
}

#search-input {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 12px 0 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.8);
  outline: none;
  transition: all 0.2s var(--ease);
}
#search-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(67,56,202,0.08);
}
#search-input::placeholder { color: var(--subtle); }

.btn-filter {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.8);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.btn-filter:hover { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn-filter svg { width: 18px; height: 18px; }

.cats-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 10px;
}
.cats-scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: #EEF2FF; }
.chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}

/* ── BRANDS (mobile) ── */
.brands-section { padding: 14px 16px 6px; }

.section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--subtle);
  margin-bottom: 10px;
}

.brands-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.brands-scroll::-webkit-scrollbar { display: none; }

.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
  box-shadow: var(--sh-xs);
}
.brand-pill:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--sh-sm); }
.brand-pill.active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}

/* ── RESULTS ROW ── */
.results-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}

.results-count {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
  font-weight: 500;
}
.results-count strong { color: var(--text); font-weight: 700; }

.stock-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.stock-toggle input { display: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background 0.25s var(--ease);
  box-shadow: var(--sh-inner);
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.stock-toggle input:checked + .toggle-track { background: var(--green); }
.stock-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.stock-label { font-size: 12px; font-weight: 500; color: var(--muted); }

.sort-select {
  height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 26px 0 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.2s;
}
.sort-select:focus { border-color: var(--brand); outline: none; }

/* ── PRODUCT GRID ── */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}

.product-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  border: none;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}
.product-card:active { transform: scale(0.97); box-shadow: var(--sh-xs); }

.card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #fff;
}
.card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,0.18) 0%, transparent 55%);
  pointer-events: none;
}

.card-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body { padding: 12px 12px 14px; }

.card-brand {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 6px;
  background: #EEF2FF;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 5px;
}

.card-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  min-height: 34px;
}

.card-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.3px;
  margin-bottom: 5px;
}

.card-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  background: #ECFDF5;
  border-radius: 8px;
}

.stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
}

.stock-text { font-size: 11px; font-weight: 600; color: var(--green); }

/* ── LOAD MORE ── */
#load-more-wrap { padding: 4px 16px 16px; }

.btn-load-more {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: var(--sh-brand);
  opacity: 0.9;
}
.btn-load-more:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(67,56,202,0.38); }
.btn-load-more:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, #E8EEFF 25%, #F0F4FF 50%, #E8EEFF 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skel-card { background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: var(--sh-sm); }
.skel-img { aspect-ratio: 4/3; }
.skel-body { padding: 12px; }
.skel-line { height: 10px; margin-bottom: 6px; }
.skel-line.w70 { width: 70%; }
.skel-line.w90 { width: 90%; }
.skel-line.w50 { width: 50%; }

/* ── BOTTOM NAV ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226,232,240,0.7);
  display: flex;
  align-items: flex-start;
  z-index: 20;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 -4px 24px rgba(67,56,202,0.06);
}

#bottom-nav.hidden { transform: translateY(100%); }

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--nav-h);
  cursor: pointer;
  border: none;
  background: none;
  color: var(--subtle);
  transition: color 0.2s var(--ease);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.nav-tab svg { width: 22px; height: 22px; }
.nav-tab span { font-size: 10px; font-weight: 500; }
.nav-tab.active { color: var(--brand); }
.nav-tab.active span { font-weight: 700; }

.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 20px);
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  box-shadow: 0 0 0 2px white;
}
.nav-badge.hidden { display: none; }

/* ── OVERLAYS BASE ── */
.overlay {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* ── OVERLAY HEADER ── */
.ov-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ov-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.3px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.btn-icon:active { transform: scale(0.9); }
.btn-icon:hover { background: #E0E7FF; color: var(--brand); }
.btn-icon svg { width: 20px; height: 20px; }

/* ── DETAIL ── */
.detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.carousel { position: relative; background: #f1f5f9; }

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  scroll-snap-align: start;
  aspect-ratio: 4/3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 4px;
  background: var(--surface);
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all 0.2s var(--ease); }
.dot.active { width: 18px; border-radius: 3px; background: var(--brand); }

/* ── CAROUSEL ARROWS ── */
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
  transition: all 0.18s var(--ease);
  color: var(--text);
}
.car-arrow svg { width: 18px; height: 18px; }
.car-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.1); box-shadow: 0 4px 20px rgba(0,0,0,0.22); }
.car-arrow:active { transform: translateY(-50%) scale(0.95); }
.car-prev { left: 14px; }
.car-next { right: 14px; }

.detail-info { padding: 18px 18px 100px; background: var(--surface); }

.detail-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.detail-cat-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  background: #EEF2FF;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
}

.detail-stock { display: flex; align-items: center; gap: 5px; }
.detail-stock .stock-dot { width: 8px; height: 8px; }
.detail-stock .stock-text { font-size: 12px; }

.detail-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.4px;
}

.detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 22px;
  letter-spacing: -0.8px;
}

.detail-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.description-text { font-size: 13.5px; line-height: 1.65; color: var(--muted); white-space: pre-line; }

.desc-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0;
  line-height: 1.5;
}

.desc-check-icon {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Specs */
.specs-section { margin-top: 4px; border-top: 1px solid var(--border); }
.specs-group { border-bottom: 1px solid var(--border); }

.specs-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.specs-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}
.specs-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.specs-body { display: none; padding-bottom: 12px; }
.specs-body.open { display: block; }

.spec-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid var(--bg);
}

.spec-key { font-size: 12.5px; color: var(--muted); flex: 0 0 45%; line-height: 1.4; }
.spec-val { font-size: 12.5px; color: var(--text); font-weight: 500; flex: 1; line-height: 1.4; }

/* Detail footer */
.detail-footer {
  flex-shrink: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(15,23,42,0.06);
}

.footer-price { flex: 1; }
.footer-price-label { font-size: 11px; color: var(--muted); }
.footer-price-val { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: var(--brand); }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  padding: 0 22px;
  white-space: nowrap;
  box-shadow: var(--sh-brand);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(67,56,202,0.38); }
.btn-primary:active { transform: scale(0.97); }

.qty-controls {
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.qty-btn {
  width: 42px;
  height: 100%;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: #E0E7FF; color: var(--brand); }
.qty-btn:active { background: var(--brand); color: #fff; }

.qty-val {
  min-width: 36px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.in-cart-label { font-size: 12px; color: var(--green); font-weight: 700; white-space: nowrap; }

/* ── CART ── */
.cart-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px 0;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 40px 32px;
  text-align: center;
}
.cart-empty svg { color: var(--border); }
.cart-empty h3 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; }
.cart-empty p { font-size: 14px; color: var(--muted); }

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  box-shadow: var(--sh-xs);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-img .card-fallback { width: 100%; height: 100%; }

.cart-item-body { flex: 1; min-width: 0; }

.cart-item-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--brand);
  margin-bottom: 3px;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 6px;
}

.cart-item-price { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.cart-item-controls { display: flex; align-items: center; gap: 8px; }

.cart-item-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: 34px;
  background: var(--surface);
}
.cart-item-qty .qty-btn { width: 32px; font-size: 15px; }
.cart-item-qty .qty-val { min-width: 28px; font-size: 13px; }

.cart-item-del {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #FEF2F2;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin-left: auto;
}
.cart-item-del:hover { background: #FEE2E2; transform: scale(1.05); }
.cart-item-del svg { width: 16px; height: 16px; }

.cart-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(15,23,42,0.06);
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cart-total-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.cart-total-val { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; color: var(--brand); }

.cart-checkout-btn {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--sh-brand);
}
.cart-checkout-btn:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(67,56,202,0.38); }
.cart-checkout-btn:active { transform: scale(0.98); }

.cart-continue {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.cart-continue:hover { opacity: 1; }

/* LightLeasing installment button */
.cart-installment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 54px;
  margin-top: 10px;
  border-radius: 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--brand);
  background: transparent;
  color: var(--brand);
  box-sizing: border-box;
  transition: all 0.2s var(--ease);
}
.cart-installment-btn:hover { background: rgba(67,56,202,0.07); transform: translateY(-1px); }
.cart-installment-btn:active { transform: scale(0.98); }

/* LLS modal */
#lls-modal-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(10,14,30,0.55); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 768px) {
  #lls-modal-overlay { align-items: center; }
}
#lls-modal {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 520px;
  padding: 28px 24px 32px;
  box-shadow: var(--sh-lg);
  max-height: 90vh; overflow-y: auto;
}
@media (min-width: 768px) {
  #lls-modal { border-radius: 24px; }
}
.lls-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.lls-title { font-size: 18px; font-weight: 700; color: var(--text); }
.lls-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 18px; line-height: 1; }
.lls-close:hover { background: var(--brand); color: #fff; }
.lls-offers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.lls-offer {
  border: 2px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: all 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.lls-offer:hover { border-color: var(--brand); }
.lls-offer.active { border-color: var(--brand); background: rgba(67,56,202,0.06); }
.lls-offer-term { font-size: 14px; color: var(--text-2); }
.lls-offer-payment { font-size: 17px; font-weight: 700; color: var(--brand); }
.lls-form { display: flex; flex-direction: column; gap: 12px; }
.lls-form input {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 15px; background: var(--surface);
  color: var(--text); outline: none; transition: border-color 0.15s;
  box-sizing: border-box;
}
.lls-form input:focus { border-color: var(--brand); }
.lls-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; border-radius: 14px; font-size: 15px;
  font-weight: 600; cursor: pointer; border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; transition: all 0.18s;
}
.lls-submit:hover { opacity: 0.92; transform: translateY(-1px); }
.lls-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.lls-msg { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 8px; }
.lls-msg.ok { color: #22c55e; font-weight: 600; }
.lls-msg.err { color: #ef4444; }

/* ── ORDER ── */
.order-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 16px 100px;
}

.order-summary {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(67,56,202,0.1);
}

.order-summary-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--brand);
  margin-bottom: 10px;
}

.order-summary-item {
  font-size: 12.5px;
  color: var(--text);
  padding: 3px 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(67,56,202,0.15);
}
.order-summary-total span { font-size: 13px; font-weight: 700; color: var(--text); }
.order-summary-total strong { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; color: var(--brand); }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: all 0.2s var(--ease);
  box-shadow: var(--sh-inner);
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(67,56,202,0.1), var(--sh-inner);
}
.form-textarea { resize: vertical; min-height: 76px; }

.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill input { display: none; }

.radio-pill label {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
}
.radio-pill label:hover { border-color: var(--brand); color: var(--brand); background: #EEF2FF; }
.radio-pill input:checked + label {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}

.order-footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(15,23,42,0.06);
}

.btn-submit {
  width: 100%;
  height: 54px;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--sh-brand);
}
.btn-submit:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.order-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 32px;
  text-align: center;
}

.success-circle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(16,185,129,0.4);
}

.order-success h2 { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.order-success p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.order-success .phone-highlight { font-size: 17px; font-weight: 700; color: var(--brand); }

/* ── FAVORITES ── */
.favs-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px;
}

.favs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 40px 32px;
  text-align: center;
}
.favs-empty svg { color: var(--border); }
.favs-empty h3 { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; }
.favs-empty p { font-size: 14px; color: var(--muted); }

/* ── SPINNER ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 100;
  white-space: nowrap;
  max-width: calc(100% - 32px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── BACKDROP ── */
#backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

/* ── MISC ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.hidden { display: none !important; }
.fav-btn-active svg { color: #ef4444; }
.error-state { padding: 32px 16px; text-align: center; color: var(--muted); }
.error-state h3 { font-size: 15px; margin-bottom: 6px; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.error-state p { font-size: 13px; }

/* ══════════════════════════════════
   MOBILE (< 768px)
══════════════════════════════════ */
@media (max-width: 767px) {
  body { background: #fff; }

  #view-catalog {
    position: relative;
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-h) + var(--safe-bot));
  }

  @media (min-width: 430px) {
    body { display: flex; justify-content: center; align-items: flex-start; padding: 24px 0; min-height: 100vh; }
    #view-catalog {
      border-radius: 44px;
      box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08);
      overflow: hidden;
      min-height: calc(100vh - 48px);
    }
  }

  #d-header { display: none !important; }
  #d-sidebar { display: none !important; }
  #m-brands { display: block; }

  #backdrop { display: none !important; }

  #bottom-nav {
    max-width: 430px;
    left: 50%;
    transform: translateX(-50%);
  }
  #bottom-nav.hidden { transform: translateX(-50%) translateY(100%); }

  .overlay {
    position: fixed;
    left: 50%;
    top: 0;
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-50%) translateY(100%);
    transition: transform 0.35s var(--ease);
    z-index: 30;
  }
  .overlay.open { transform: translateX(-50%) translateY(0); }

  #ov-order { z-index: 35; }

  .detail-footer { position: sticky; bottom: 0; }
  .order-footer { position: sticky; bottom: 0; }
}

/* ══════════════════════════════════
   DESKTOP (≥ 768px)
══════════════════════════════════ */
@media (min-width: 768px) {
  body {
    background: #fff;
    min-height: 100vh;
  }

  #d-header { display: flex; }

  #m-cat-header { display: none; }
  #m-brands { display: none; }
  #bottom-nav { display: none !important; }

  #view-catalog {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-areas: "sidebar body";
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px;
    gap: 0 28px;
    align-items: start;
  }

  #d-sidebar {
    grid-area: sidebar;
    display: block;
    position: sticky;
    top: 88px;
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--sh-sm);
  }

  #catalog-body {
    grid-area: body;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    padding: 0 0 12px;
  }

  #load-more-wrap { padding: 4px 0 16px; }
  .results-row { padding: 0 0 14px; }

  /* Backdrop */
  #backdrop {
    display: block;
  }
  #backdrop.show { opacity: 1; pointer-events: all; }

  /* Overlays: right panel */
  .overlay {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(520px, 95vw);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 50;
    box-shadow: -12px 0 48px rgba(15,23,42,0.14);
  }
  .overlay.open { transform: translateX(0); }

  #ov-order { z-index: 55; }

  .detail-footer { position: sticky; bottom: 0; }
  .order-footer { position: sticky; bottom: 0; }

  #ov-detail .detail-info { padding: 24px 24px 16px; }

  /* Toast: bottom center, no nav offset */
  #toast { bottom: 24px; }

  /* Larger cards on desktop */
  .card-name { font-size: 13px; min-height: 36px; }
  .card-price { font-size: 17px; }
}
