/* ==========================================================================
   AHORRO TJ - MODERN DESIGN SYSTEM & STYLESHEET
   Aesthetics: Modern Slate & Emerald Glassmorphism, Premium Typography
   ========================================================================== */

:root {
  color-scheme: light;

  /* Primary Palette: Emerald & Slate */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-dark: #064e3b;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.25);

  --accent-lime: #84cc16;
  --accent-amber: #f59e0b;
  --accent-sky: #0284c7;

  /* Store Brand Colors */
  --store-walmart: #0071dc;
  --store-aurrera: #007837;
  --store-ley: #e31837;
  --store-soriana: #e65100;
  --store-calimax: #002f6c;
  --store-chedraui: #ff6600;
  --store-florido: #d32f2f;

  /* Neutral Surface Palette */
  --bg-app: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Typography Colors */
  --ink: #0f172a;
  --ink-secondary: #475569;
  --muted: #64748b;
  --soft: #94a3b8;

  /* Feedback Colors */
  --saving: #059669;
  --saving-bg: #d1fae5;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;

  /* Elevated Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
  --shadow-emerald: 0 12px 28px -6px rgba(5, 150, 105, 0.35);

  /* Radius & Glass */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(226, 232, 240, 0.8);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 1rem;
  left: 1rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Container & Shell */
.app-shell {
  max-width: 1160px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Topbar Header */
.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.brand strong {
  color: var(--primary);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: var(--shadow-emerald);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-chip {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  padding: 4px 14px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.location-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.location-chip svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
}

.location-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.icon-button:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Layout & Views */
main {
  flex: 1;
  padding-bottom: calc(100px + var(--safe-bottom));
}

.view {
  animation: fadeIn 0.3s ease-out;
}

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

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  margin: 16px 16px 24px;
  padding: 40px clamp(24px, 5vw, 56px) 32px;
  border-radius: var(--radius-xl);
  color: #ffffff;
  background: linear-gradient(135deg, #064e3b 0%, #059669 50%, #0f172a 100%);
  box-shadow: var(--shadow-lg);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 14px;
}

.hero-copy h1 em {
  font-style: normal;
  color: #6ee7b7;
  background: linear-gradient(120deg, #a7f3d0, #6ee7b7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy p {
  font-size: 1.05rem;
  color: #e2e8f0;
  margin: 0;
  line-height: 1.6;
}

/* Search Box */
.search-box {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: all 0.2s ease;
}

.search-box:focus-within {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(110, 231, 183, 0.4);
}

.search-box svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--soft);
}

.search-box button[type="submit"] {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-emerald);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.compare-hero {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  color: #ffffff;
  text-align: left;
  transition: all 0.2s ease;
}

.compare-hero:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.compare-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.compare-hero-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
}

.compare-hero span {
  flex: 1;
}

.compare-hero strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.compare-hero small {
  display: block;
  font-size: 0.85rem;
  color: #d1fae5;
}

.compare-hero svg.arrow {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
}

/* Content Layout Stack */
.content-stack {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 4px;
}

.section-heading h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}

.text-button {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.text-button:hover {
  background: var(--primary-light);
}

/* Store Strip */
.store-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.store-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.store-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--store-color, var(--primary));
}

.store-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.store-chip-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.store-chip-count {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Product Rail & Cards */
.product-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product-card-main {
  text-align: left;
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
}

.product-image-wrap {
  position: relative;
  width: 100%;
  height: 120px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.match-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.product-category {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-copy h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 4px 0 8px;
}

.product-price-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin: 8px 0 12px;
  font-size: 0.85rem;
}

.product-price-badge.best {
  background: var(--saving-bg);
  border-color: #a7f3d0;
  color: var(--primary-dark);
}

.product-price-badge strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.product-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 40px;
  width: 100%;
  justify-content: space-between;
}

.qty-stepper button {
  width: 40px;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  transition: background 0.15s ease;
}

.qty-stepper button:hover {
  background: var(--border);
}

.qty-stepper span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.category-grid, .department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.category-card, .department-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.category-card:hover, .department-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.department-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.department-card.active span strong {
  color: var(--primary-dark);
}

/* Subcategory Filter Chips */
.subcategory-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 16px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.subcategory-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

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

.subcategory-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-emerald);
}

.profeco-chain-filter {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: none;
  cursor: pointer;
}

.category-icon, .department-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--category-bg, var(--primary-light));
}

.category-card span strong, .department-card span strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.category-card span small, .department-card span small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.ticket-contribution-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-xl);
  padding: 32px clamp(20px, 4vw, 40px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-lg);
}

.ticket-card-copy h2 {
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.ticket-card-copy p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  box-shadow: var(--shadow-emerald);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(5, 150, 105, 0.5);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.button.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.button.whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 10px 24px -4px rgba(37, 211, 102, 0.4);
}

.button.whatsapp:hover {
  background: #1eb956;
  transform: translateY(-2px);
}

.button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* Catalog View & Filters */
.catalog-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.catalog-toolbar label {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.catalog-toolbar span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.catalog-toolbar select {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.profeco-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.profeco-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.profeco-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.profeco-offers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.profeco-offer-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.profeco-offer-chip.cheapest {
  background: var(--saving-bg);
  border-color: #a7f3d0;
  color: var(--primary-dark);
  font-weight: 700;
}

/* Live store catalog */
.catalog-source-toggle {
  margin-top: -4px;
}

.store-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--store-color, var(--primary));
  margin-right: 6px;
  flex-shrink: 0;
}

.live-store-chips {
  margin-bottom: 12px;
}

.live-list-price {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
}

.profeco-offer-price {
  text-align: right;
}

.live-detail-kicker {
  margin: 10px 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Shopping List View ("Mi Lista") */
.savings-card {
  background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
  color: #ffffff;
  box-shadow: var(--shadow-emerald);
  margin-bottom: 24px;
}

.savings-card h2 {
  color: #ffffff;
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.savings-card p {
  color: #a7f3d0;
  font-size: 1rem;
  margin: 0;
}

.compare-toggle {
  display: flex;
  background: var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  margin-bottom: 20px;
}

.compare-toggle button {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  transition: all 0.2s ease;
}

.compare-toggle button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.shopping-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.list-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.list-item-image {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.list-item > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.list-item h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}

.list-item-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

.list-item-price small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.list-source-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  height: 40px;
}

.quantity button {
  width: 28px;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  transition: background 0.15s ease;
}

.quantity button:hover {
  background: var(--border);
  border-radius: 6px;
}

.quantity span {
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

.remove-item {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--danger);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.remove-item:hover {
  background: var(--danger-bg);
}

.purchase-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s ease;
}

.plan-card.best-deal {
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-light) 100%);
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.plan-card-store {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.plan-card-total {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Compare Drawer Styles */
.compare-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  width: min(100%, 420px);
  background: var(--surface);
  box-shadow: -10px 0 35px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.compare-drawer-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.compare-drawer-header p {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 2px;
}

.compare-drawer-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 2px;
}

.compare-drawer-header small {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  display: block;
}

#compareDrawerClose {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  color: var(--ink);
  transition: all 0.2s ease;
}

#compareDrawerClose:hover {
  background: var(--border);
}

.compare-drawer-summary {
  padding: 16px 24px;
  background: linear-gradient(135deg, #064e3b 0%, #059669 100%);
  color: #ffffff;
}

.compare-drawer-summary p {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a7f3d0;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.compare-drawer-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-drawer-summary strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.compare-drawer-summary b {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.compare-drawer-summary small {
  font-size: 0.85rem;
  color: #d1fae5;
  display: block;
  margin-top: 4px;
}

.compare-drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.compare-drawer-section {
  display: flex;
  flex-direction: column;
}

.compare-drawer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.compare-drawer-section-title h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.compare-drawer-section-title span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

#compareClearButton {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

#compareClearButton:hover {
  background: var(--danger-bg);
}

.compare-drawer-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.compare-drawer-item:hover {
  border-color: var(--border-strong);
}

.compare-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: var(--primary-light);
}

.compare-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.compare-item-copy strong {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compare-item-copy small {
  font-size: 0.78rem;
  color: var(--muted);
}

.compare-item-copy span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}

.compare-item-quantity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  height: 32px;
}

.compare-item-quantity button {
  width: 24px;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
}

.compare-item-quantity button:hover {
  background: var(--surface-hover);
}

.compare-item-quantity b {
  font-size: 0.85rem;
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.compare-item-remove {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--soft);
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.compare-item-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.compare-store-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-store-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.compare-store-total.winner {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
  box-shadow: var(--shadow-md);
}

.compare-store-total.winner strong {
  color: var(--primary-dark);
}

.compare-store-total b {
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

.compare-store-total small {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.compare-store-total div:last-child {
  text-align: right;
}

.compare-store-total div:last-child strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.compare-drawer-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
  font-style: italic;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.compare-drawer-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-peek {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  right: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  box-shadow: var(--shadow-emerald);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.compare-peek:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 32px -4px rgba(5, 150, 105, 0.5);
}

.compare-peek span {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.compare-peek small {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a7f3d0;
}

.compare-peek strong {
  font-size: 0.9rem;
  font-weight: 800;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 8px 12px calc(8px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -10px 25px rgba(15, 23, 42, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

/* Drawers, Modals & Sheets */
.compare-drawer-backdrop, .sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.bottom-sheet, .ticket-modal, .scanner-modal {
  position: fixed;
  z-index: 101;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.bottom-sheet {
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 88vh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  animation: slideUp 0.3s ease;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 200;
  background: var(--ink);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive Tweaks */
@media (min-width: 768px) {
  .app-shell {
    padding: 0 20px;
  }
  .hero {
    margin: 20px 0 32px;
  }
  .content-stack {
    padding: 0;
  }
  .bottom-nav {
    display: none;
  }
  main {
    padding-bottom: 40px;
  }
}
