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

:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --border: rgba(0, 0, 0, 0.08);
  --border-med: rgba(0, 0, 0, 0.15);
  --text-primary: #1A1A18;
  --text-secondary: #6B6B66;
  --text-tertiary: #A8A8A3;
  --accent: #1A1A18;
  --accent-light: #E8E8E4;
  --blue: #1A5FBF;
  --blue-light: #E6EEF8;
  --exito: #F5A800;
  --exito-light: #FFF7E0;
  --alkosto: #E8212B;
  --alkosto-light: #FEE9EA;
  --compulago: #1a7a1a;
  --compulago-light: #e8f4e8;
  --falabella-badge: #0763169c;
  --falabella-light: #87b304ac;
  --computerworking-badge: #1546e98b;
  --computerworking-light: #8bbaedb6;
  --tauretcomputadores-badge: #63165f;
  --tauretcomputadores-light: #63165f29;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

html,
body {
  min-height: 100vh;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.topbar-logo:hover .logo-img {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
  transform: scale(1.05);
}

/* ══════════════════════════════
   TOPBAR
══════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border-med);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 58px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--text-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: all .15s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--bg);
  color: var(--text-primary);
}

.topbar-stores {
  display: flex;
  gap: 6px;
}

/* Store badges */
.store-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 0.5px solid var(--border-med);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.store-badge:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.exito-badge {
  background: var(--exito-light);
  color: #a06b00;
  border-color: rgba(245, 168, 0, 0.3);
}

.alkosto-badge {
  background: var(--alkosto-light);
  color: var(--alkosto);
  border-color: rgba(232, 33, 43, 0.2);
}

.compulago-badge {
  color: var(--compulago);
  border-color: var(--compulago);
  background: var(--compulago-light);
}

.computerworking-badge {
  color: var(--computerworking-badge);
  border-color: var(--computerworking-badge);
  background: var(--computerworking-light);
}

.falabella-badge {
  color: var(--falabella-badge);
  border-color: var(--falabella-badge);
  background: var(--falabella-light);
}
.tauretcomputadores-badge {
  color: var(--tauretcomputadores-badge);
  border-color: var(--tauretcomputadores-badge);
  background: var(--tauretcomputadores-light);
}

.default-badge {
  color: #333;
  border-color: transparent;
  background: transparent;
}

/* En tarjetas con imagen o fondo oscuro, quiza necesiten un fondito, 
   pero según la imagen del usuario son texto plano negro sin fondo. */

/* Search bar (category page) */
.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 0.5px solid var(--border-med);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 36px;
  color: var(--text-tertiary);
}

.topbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
}

.topbar-search input::placeholder {
  color: var(--text-tertiary);
}

.results-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.topbar-actions select {
  border: 0.5px solid var(--border-med);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}

/* ── Profile Icon ─────────────────────────────────── */
.profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-med);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
  cursor: pointer;
}

.profile-icon:hover {
  transform: scale(1.05);
  border-color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: var(--accent-light);
}

.boton-favoritos {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

.favoritos-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-med);
  color: var(--alkosto);
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.favoritos-link:hover {
  transform: scale(1.05);
  border-color: var(--alkosto);
  box-shadow: 0 2px 8px rgba(216, 13, 23, 0.489);
}

.favoritos-link svg {
  width: 18px;
  height: 18px;
}

/* ── Profile Modal ────────────────────────────────── */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.profile-modal {
  background: var(--surface);
  width: 100%;
  max-width: 360px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.profile-modal-overlay.active .profile-modal {
  transform: translateY(0);
}

.profile-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  z-index: 10;
}

.profile-modal-close:hover {
  background: var(--accent-light);
  color: var(--text-primary);
}

.profile-modal-header {
  padding: 40px 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--surface) 100%);
}

.modal-user-img-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

#modal-user-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

#modal-user-email {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.profile-modal-body {
  padding: 0 32px 32px;
}

.btn-logout {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--alkosto);
  background: transparent;
  color: var(--alkosto);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-logout:hover {
  background: var(--alkosto);
  color: #fff;
}

.btn-logout svg {
  width: 18px;
  height: 18px;
}

/* ══════════════════════════════
   HERO
══════════════════════════════ */
.hero {
  position: relative;
  background: var(--text-primary);
  color: #fff;
  padding: 72px 28px 64px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.hero-label {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 36px;
  font-weight: 300;
}

.hero-sub strong {
  color: #fff;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.12);
}

/* Decorative background grid */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ══════════════════════════════
   SECTIONS (lobby)
══════════════════════════════ */
.section {
  padding: 48px 28px;
}

.section+.section {
  padding-top: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.section-link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .15s;
}

.section-link:hover {
  color: var(--text-primary);
}

/* ══════════════════════════════
   CATEGORY CARDS GRID (lobby)
══════════════════════════════ */
.cat-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.cat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.cat-card:hover {
  border-color: var(--border-med);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.cat-card-thumbs {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.cat-card-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  background: #fff;
}

.cat-card-icon-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  grid-column: 1/-1;
  padding: 20px;
  color: var(--text-tertiary);
  opacity: .5;
}

.cat-card-body {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 0.5px solid var(--border);
}

.cat-card-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cat-card-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.cat-card-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ══════════════════════════════
   FEATURED GRID (lobby)
══════════════════════════════ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.store-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.store-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  animation: fadeUp .35s ease both;
}

.store-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-med);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.store-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
}

.store-card-image img {
  width: 100%;
  height: 100%;
  max-width: 160px;
  max-height: 72px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(218, 218, 83, 0.08));
}

.store-card-image--alkosto {
  padding: 0;  /* sin padding para que llegue a los bordes */
}

.store-card-image--alkosto img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;   /* cancela el max-width del base */
  max-height: none;  /* cancela el max-height del base */
  object-fit: cover;
  object-position: center;
}

.store-card-image--compulago {
  background-color: var(--compulago-light);
  padding: 14px 18px;
}

.store-card-image--compulago img {
  max-width: 180px;
  max-height: 72px;
}

.store-card-image--computerworking {
  padding: 0;
  background-color: #ffffff;
}

.store-card-image--computerworking img {
  position: absolute;
  top: 0;
  margin-top: 10px;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;   /* cancela el max-width del base */
  max-height: none;  /* cancela el max-height del base */
  object-fit: cover;
  object-position: center;
}

.store-card-image--exito {
  padding: 14px 18px;
  background-color: var(--exito);
}

.store-card-image--exito img {
  max-width: 152px;
  max-height: 60px;
}

.store-card-image--falabella {
  padding: 14px 18px;
  background-color: var(--falabella-badge);
}

.store-card-image--falabella img {
  max-width: 176px;
  max-height: 64px;
}

.store-card-image--tauretcomputadores {
  padding: 16px 18px;
  background-color: #202ec462;
}

.store-card-image--tauretcomputadores img {
  max-width: 156px;
  max-height: 60px;
}

.store-card-fallback {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--text-primary), #5a5a5a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.05em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.store-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.store-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.store-card-count {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

.store-card-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
}

.store-card-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111, #be1111);
}

.store-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.store-card-share {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.store-card-cta {
  color: var(--text-primary);
  font-weight: 700;
}

.featured-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  animation: fadeUp .35s ease both;
}

.featured-card:hover {
  border-color: var(--border-med);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feat-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feat-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.feat-placeholder {
  font-size: 40px;
  opacity: .4;
}

.feat-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 0.5px solid var(--border);
}

.feat-store {
  align-self: flex-start;
}

.feat-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-price {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.feat-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.feat-price-old {
  font-size: 10px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  font-family: var(--font-mono);
}

.feat-price-new {
  font-size: 15px;
  font-weight: 700;
  color: #be1111;
}

.feat-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #be1111;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(190, 17, 17, 0.3);
  z-index: 2;
}

/* ══════════════════════════════
   SKELETONS
══════════════════════════════ */
.skeleton-card {
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
}

.skeleton-card.tall {
  aspect-ratio: 3/4;
}

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

  to {
    background-position: -200% 0;
  }
}

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.footer {
  margin-top: auto;
  padding: 20px 28px;
  border-top: 0.5px solid var(--border);
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ══════════════════════════════
   CATEGORY PAGE LAYOUT
══════════════════════════════ */
.app-body {
  display: flex;
  flex: 1;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

.favorite-bar {
  width: 320px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
  border-left: 0.5px solid var(--border);
  padding: 18px 16px;
  position: fixed;
  right: 0;
  top: 58px;
  height: calc(100vh - 58px);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
}

body.favorites-open .favorite-bar {
  transform: translateX(0);
}

.favorite-bar::-webkit-scrollbar {
  width: 4px;
}

.favorite-bar::-webkit-scrollbar-thumb {
  background: var(--border-med);
  border-radius: 4px;
}

.favorites-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  height: 100%;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.18s ease 0.08s, transform 0.18s ease 0.08s;
}

body.favorites-open .favorites-panel {
  opacity: 1;
  transform: translateX(0);
}

.favorites-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.favorites-panel-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.favorites-panel-title {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
  color: var(--text-primary);
}

.favorites-count {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.favorites-panel-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.favorites-empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 20px 10px 16px;
}

.favorites-empty-illustration {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  margin: 4px 0 18px;
}

.favorites-empty-card {
  width: 122px;
  height: 122px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px dashed #d6dbe6;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.favorites-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.favorites-empty-text {
  margin: 0;
  max-width: 240px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.favorites-empty-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 2px;
  background: #111111;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.favorites-empty-btn:hover {
  background: #000;
}

.favorites-empty-ghost {
  width: 100%;
  margin-top: 26px;
  opacity: 0.28;
  filter: grayscale(1);
}

.favorites-empty-ghost svg {
  width: 100%;
  height: auto;
}

.favorites-panel-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px;
  border-radius: 12px;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.favorites-panel-btn:hover {
  filter: brightness(1.05);
}

/* ══════════════════════════════
   FAVORITES PAGE
══════════════════════════════ */
.favorites-page {
  background: var(--bg);
}

.favorites-page-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
}

.favorites-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 14px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 14px;
}

.favorites-page-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.favorites-page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.favorites-page-heart {
  color: #d11f2a;
  font-size: 0.9em;
}

.favorites-page-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.favorites-clear-btn {
  border: 0.5px solid #ef4444;
  background: transparent;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.favorites-clear-btn:hover {
  background: #ef4444;
  color: #fff;
}

.favorites-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 16px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 22px;
}

.favorites-toolbar-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.favorites-sort-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.favorites-sort-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.favorites-sort-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

.favorites-view-icons {
  display: flex;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 20px;
}

.favorites-page-empty {
  display: flex;
  justify-content: center;
  padding: 40px 0 24px;
}

.favorites-page-empty[hidden] {
  display: none;
}

.favorites-page-empty:not([hidden]) {
  animation: fadeUp 0.4s ease both;
}

.favorites-page-empty-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.favorites-page-empty-title {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.favorites-page-empty-text {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.favorites-page-empty-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 2px;
  background: #111111;
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding-bottom: 24px;
}

.favorite-card {
  position: relative;
}

.favorite-card .card-img-box {
  min-height: 184px;
}

.favorite-card .card-store {
  top: 10px;
  left: 10px;
  right: auto;
}

@media (max-width: 900px) {
  .favorites-page-main {
    padding: 20px 16px;
  }

  .favorites-page-header,
  .favorites-page-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .locations-container {
    flex-direction: column;
  }

  .locations-tabs {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .location-display {
    flex-direction: column;
  }

  .location-map {
    height: 300px;
  }

  .favorite-bar {
    position: fixed;
    top: 58px;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    max-width: 360px;
    height: calc(100vh - 58px);
    z-index: 120;
    transform: translateX(100%);
    pointer-events: none;
    box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12);
  }

  body.favorites-open .favorite-bar {
    width: min(360px, 92vw);
    padding: 18px 16px;
    border-left: 0.5px solid var(--border);
    transform: translateX(0);
    pointer-events: auto;
  }
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-med);
  border-radius: 4px;
}

.back-link-wrap {
  margin-bottom: -8px;
}

.back-link {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color .15s;
}

.back-link:hover {
  color: var(--text-primary);
}

.filter-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

#filter-group-subcategory {
  animation: slideDown 0.2s ease-out both;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 4px 10px;
  border-radius: 20px;
  border: 0.5px solid var(--border-med);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .12s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.chip.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.price-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

.price-display .mono {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--text-primary);
  height: 4px;
  cursor: pointer;
}

.clear-btn {
  font-size: 11px;
  font-family: var(--font-sans);
  color: var(--text-tertiary);
  background: none;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
  width: 100%;
  transition: all .12s;
}

.clear-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-med);
}

/* ── Toggle Switch ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-wrap input {
  cursor: pointer;
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Quick Prices ── */
.quick-prices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.price-chip {
  font-size: 11px;
  padding: 6px 4px;
  background: var(--bg);
  border: 0.5px solid var(--border-med);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}

.price-chip:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.price-chip.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

/* ── Main area ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 24px;
  gap: 16px;
}

/* Category title bar */
.cat-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.cat-title-icon {
  font-size: 20px;
}

.cat-title-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex: 1;
}

.cat-title-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--bg);
  border: 0.5px solid var(--border-med);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── Compare bar ── */
.compare-bar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 95%;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-xl);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  animation: compareFloatIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes compareFloatIn {
  from {
    opacity: 0;
    transform: translate(-50%, 30px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.compare-label {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.compare-items {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.compare-items::-webkit-scrollbar {
  display: none;
}

.compare-chip-item {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  color: var(--text-primary);
  white-space: nowrap;
}

.compare-action {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.compare-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  background: #000;
}

.compare-clear {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.compare-clear:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  transform: rotate(90deg);
}

/* ══════════════════════════════
   PRODUCT GRID & CATEGORY SECTIONS
══════════════════════════════ */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cat-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 10px 16px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .15s, background .15s;
}

.cat-header:hover {
  border-color: var(--border-med);
}

.cat-header.collapsed {
  background: var(--bg);
}

.cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.cat-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
}

.cat-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  background: var(--bg);
  border: 0.5px solid var(--border-med);
  border-radius: 20px;
  padding: 2px 9px;
}

.cat-toggle-icon {
  font-size: 9px;
  color: var(--text-tertiary);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 16px;
}

.load-more-btn {
  background: var(--surface);
  border: 1px solid var(--border-med);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.load-more-btn:hover {
  background: var(--bg);
  border-color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ══════════════════════════════
   PRODUCT CARD
══════════════════════════════ */
.product-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, box-shadow .15s;
  animation: fadeIn .25s ease both;
}

.product-card:hover {
  border-color: var(--border-med);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-img-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  position: relative;
  overflow: hidden;
}

.card-img-box.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.5s infinite;
}

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

.card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease-in-out, filter 0.4s ease-in-out;
  filter: blur(4px);
}

.card-img-box img.loaded {
  opacity: 1;
  filter: blur(0);
}

.card-img-box svg {
  opacity: .2;
}

.card-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-tertiary);
  opacity: .3;
}

.card-store {
  position: absolute;
  top: 7px;
  right: 7px;
}

.card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.card-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: -4px;
}

.card-price-old {
  font-size: 11px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  font-family: var(--font-mono);
}

.card-price-new {
  font-size: 16px;
  font-weight: 700;
  color: #be1111;
  font-family: var(--font-mono);
}

.card-discount-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  background: #be1111;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.btn-view {
  flex: 1;
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 7px 10px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: opacity .12s;
}

.btn-view:hover {
  opacity: .8;
}

.btn-compare {
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 7px 10px;
  background: transparent;
  color: var(--text-secondary);
  border: 0.5px solid var(--border-med);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}

.btn-compare:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-compare.active {
  background: var(--blue-light);
  color: var(--blue);
  border-color: var(--blue);
}

/* ══════════════════════════════
   LOADING & EMPTY STATES
══════════════════════════════ */
.loading-state {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: dot .8s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: .15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: .30s;
}

@keyframes dot {

  0%,
  80%,
  100% {
    opacity: .2;
    transform: scale(.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.empty-state {
  padding: 80px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ══════════════════════════════
   COMPARE MODAL
══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 200;
}

.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.compare-modal-inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.5px solid var(--border-med);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

.compare-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
}

.compare-modal-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
}

.compare-table-wrap {
  overflow: auto;
  padding: 20px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th {
  text-align: left;
  padding: 8px 12px;
  font-weight: 500;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
}

.compare-table td {
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--border);
  color: var(--text-secondary);
}

.compare-table td:first-child {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
  width: 100px;
  min-width: 100px;
}

/* Modal Improvements */
.modal-prod-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 5px;
  position: relative;
  min-width: 140px;
}

.best-badge {
  position: absolute;
  top: -12px;
  background: #22c55e;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  z-index: 2;
  letter-spacing: 0.02em;
}

.modal-prod-img {
  width: 100px;
  height: 90px;
  background: #fff;
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.modal-prod-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  filter: blur(2px);
}

.modal-prod-img img.loaded {
  opacity: 1;
  filter: blur(0);
}

.modal-prod-name {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
}

.best-price {
  background: rgba(34, 197, 94, 0.06);
}

.price-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sketch-msg {
  font-family: var(--font-sans);
  font-size: 11px;
  color: #16a34a;
  font-style: italic;
  margin-top: 6px;
  font-weight: 600;
  padding: 4px 8px;
  background: #dcfce7;
  border-radius: 4px;
  display: inline-block;
}

.modal-buy-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.modal-buy-btn:hover {
  background: #000;
  transform: translateY(-1px);
}

.sticky-col {
  position: sticky;
  left: 0;
  background: #fdfdfd !important;
  z-index: 5;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.compare-table .price-cell {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 500;
}

.compare-table .best {
  color: #1a7a1a;
  background: #eaf6ea;
}

/* ══════════════════════════════
   BACK TO TOP BUTTON
══════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--text-secondary);
  transform: translateY(-3px);
}

/* ══════════════════════════════
   LOCATIONS SECTION
   ══════════════════════════════ */
.locations-container {
  display: flex;
  gap: 24px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  min-height: 450px;
  margin-top: 20px;
}

.locations-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
  flex-shrink: 0;
  border-right: 0.5px solid var(--border);
  padding-right: 24px;
}

.loc-tab {
  background: none;
  border: 1px solid transparent;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.loc-tab:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.loc-tab.active {
  background: var(--text-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-display {
  flex: 1;
  display: flex;
  gap: 24px;
}

.location-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.loc-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loc-info-header h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.loc-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #16a34a;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 20px;
}

.loc-address-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loc-address-item {
  cursor: pointer;
  transition: all 0.2s;
}

.loc-address-item.active {
  background: #e2e8f0;
  border-color: var(--text-primary);
  color: var(--text-primary);
  font-weight: 600;
}

#loc-map-iframe {
  transition: opacity 0.3s ease;
}

.loc-address-item svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.loc-btn-maps {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.loc-btn-maps:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.location-map {
  flex: 1.2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 0.5px solid var(--border);
  background: #f1f5f9;
}

/* -- Favorites Styles ------------------------------ */
.card-fav-btn {
  position: absolute;
  top: 35px;
  right: 10px;
  background: #ffffff;
  border: 2px solid #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  /* Darker slate for better visibility */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.card-fav-btn:hover {
  transform: scale(1.15);
  color: #ef4444;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.card-fav-btn.active {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.modal-favorites-section {
  margin-top: 24px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.modal-favorites-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-favorites-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-height: max-content;
  overflow-y: auto;
  padding-right: 4px;
}
 
.modal-favorites-list::-webkit-scrollbar {
  width: 6px;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.fav-item:hover {
  background: var(--accent-light);
}

.fav-img {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fav-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fav-info {
  flex: 1;
  min-width: 0;
}

.fav-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.fav-price {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.fav-btn {
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  color: var(--blue);
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--blue-light);
}

.empty-favs {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 20px 0;
  font-style: italic;
}

/* ── Product Detail Modal ────────────────────────── */
.product-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pd-modal-inner {
  background: var(--surface);
  width: 95%;
  max-width: 1100px;
  max-height: 92vh;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hide horizontal scrollbar and style vertical one */
.pd-modal-inner::-webkit-scrollbar {
  width: 6px;
}

.pd-modal-inner::-webkit-scrollbar-track {
  background: transparent;
}

.pd-modal-inner::-webkit-scrollbar-thumb {
  background: var(--border-med);
  border-radius: 10px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pd-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

.pd-modal-content {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  padding: 80px 60px 60px;
}

.pd-left {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
}

.pd-img-box {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.pd-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.pd-img-box img[style*="opacity: 1"] {
  opacity: 1;
}

.pd-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pd-store-badge {
  display: inline-flex;
  align-self: flex-start;
}

.pd-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.pd-price-section {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin: 12px 0;
}

.pd-price-old {
  font-size: 16px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.pd-price-row {
  display: flex;
  align-items: center;
}

.pd-price-new {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
}

.pd-discount-pct {
  background: #be1111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.pd-actions {
  display: flex;
  gap: 12px;
}

.pd-btn-buy {
  flex: 2;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all 0.2s;
}

.pd-btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pd-btn-fav {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pd-btn-fav:hover {
  background: var(--bg);
}

.pd-btn-fav.active {
  color: #ff4d4d;
  border-color: #ff4d4d;
}

.pd-info-extra {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-top: 10px;
}

.pd-similar-section {
  padding: 40px;
  background: linear-gradient(to bottom, #fff 0%, var(--bg) 100%);
  border-top: 1px solid var(--border);
}

.pd-similar-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.pd-similar-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 15px;
  /* Space for potential scrollbar if not hidden */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide horizontal scrollbar for the ribbon */
.pd-similar-grid::-webkit-scrollbar {
  height: 0;
  display: none;
}

.pd-similar-grid .product-card,
.pd-similar-grid .featured-card {
  flex: 0 0 200px;
  /* Fixed width for ribbon items */
  min-width: 200px;
}

@media (max-width: 768px) {
  .pd-modal-content {
    grid-template-columns: 1fr;
    padding: 40px 24px 24px;
  }

  .pd-modal-inner {
    max-height: 95vh;
  }
}

/* ── Chatbot ────────────────────────────────────── */
.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When back-to-top is visible, move chatbot up to avoid overlap */
.chatbot-container.chat-with-backtop {
  bottom: 100px; /* raise above the back-to-top button */
}

.chat-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-toggle-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.chatbot-window {
  width: 360px;
  height: 500px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border);
}

@keyframes chatOpen {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-header {
  padding: 20px;
  background: var(--text-primary);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.chat-name {
  font-weight: 700;
  font-size: 14px;
}

.chat-status {
  font-size: 11px;
  opacity: 0.8;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message.user {
  align-self: flex-end;
  background: var(--text-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: #fff;
}

.chat-input-area input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s;
}

.chat-input-area input:focus {
  border-color: var(--text-primary);
}

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.chat-send:hover {
  background: var(--text-primary);
  color: #fff;
}

.chat-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-product-card:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 40px);
    height: 400px;
  }

  .chatbot-container {
    bottom: 20px;
    right: 20px;
  }
}

/* --- Chatbot Enhancements --- */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 4px;
}

.quick-chip {
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-secondary);
  white-space: nowrap;
}

.quick-chip:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.quick-chip:active {
  transform: translateY(0);
}

/* ══════════════════════════════
   STATS STRIP
══════════════════════════════ */
.stats-strip-section {
  padding: 0 28px 32px;
}

.stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0;
  background: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 28px 40px;
  overflow: hidden;
  position: relative;
}

/* Subtle shimmer overlay */
.stats-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.stats-strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  animation: fadeUp 0.5s ease both;
}

.stats-strip-item:nth-child(1) { animation-delay: 0.05s; }
.stats-strip-item:nth-child(3) { animation-delay: 0.10s; }
.stats-strip-item:nth-child(5) { animation-delay: 0.15s; }
.stats-strip-item:nth-child(7) { animation-delay: 0.20s; }

.stats-strip-num {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1;
}

.stats-strip-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.stats-strip-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .stats-strip {
    flex-wrap: wrap;
    gap: 24px;
    padding: 24px;
  }

  .stats-strip-divider {
    display: none;
  }

  .stats-strip-item {
    flex: 0 0 calc(50% - 24px);
  }
}
