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

:root {
  color-scheme: light;

  /* Editorial type: elegant serif display (Canela-like) + clean sans body,
     à la Ferm Living / Signifly. */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* 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-florido: #d32f2f;

  /* Cooler white canvas — cream stays in the logo, not the whole page */
  --bg-app: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f4f7f5;
  --surface-alt: #f6f8f7;
  --border: #e6ece9;
  --border-strong: #d3ddd8;

  /* Typography Colors — soft charcoal, not cold slate */
  --ink: #141414;
  --ink-secondary: #383838;
  --muted: #706b60;
  --soft: #a8a196;

  /* 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:
    radial-gradient(900px 420px at 100% -12%, rgba(5, 150, 105, 0.07), transparent 58%),
    var(--bg-app);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ahorro TJ comparte el motor, pero conserva una identidad fronteriza propia. */
body.site-ahorrotj {
  --primary: #b4232f;
  --primary-hover: #8f1d27;
  --primary-dark: #66131b;
  --primary-light: #fff1f2;
  --primary-glow: rgba(180, 35, 47, 0.25);
  --accent-sky: #087ea4;
  --shadow-emerald: 0 12px 28px -6px rgba(180, 35, 47, 0.3);
  background:
    radial-gradient(880px 420px at 100% -12%, rgba(8, 126, 164, 0.11), transparent 58%),
    #fffdfb;
}

.site-ahorrotj .topbar {
  border-bottom-color: rgba(180, 35, 47, 0.18);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  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: var(--font-sans);
  font-size: 1.2rem;
  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(140deg, #05402f 0%, #059669 58%, #1c1917 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.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 14px;
}

.hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  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;
}

.search-box .scan-inline,
.search-box .ticket-inline {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-dark);
  margin: 0 4px 0 0;
}

.search-box .scan-inline svg,
.search-box .ticket-inline svg {
  width: 22px;
  height: 22px;
  margin: 0;
  stroke: currentColor;
  fill: none;
}

.search-box .scan-inline:hover,
.search-box .ticket-inline:hover {
  background: #d1fae5;
}

.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.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--primary);
  margin: 0 0 4px;
}

.section-heading h2 {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  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;
}

/* Static store list, "Cómo funciona" card & ad banner */
.store-strip-static {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--store-color, var(--primary));
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  box-shadow: 0 6px 16px -6px var(--store-color, var(--primary));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.store-name:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -8px var(--store-color, var(--primary));
}

.store-name::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.how-it-works {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.how-it-works h2 {
  margin: 2px 0 10px;
  font-size: 1.25rem;
}

.how-it-works ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.how-it-works li strong {
  color: var(--ink);
}

.ad-banner {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-strong);
  background: linear-gradient(135deg, #fff8e6 0%, #fdeec9 100%);
}

.ad-banner strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
}

.ad-banner small {
  color: var(--muted);
}

.ad-banner a {
  display: inline-block;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.ad-banner a:hover {
  opacity: 0.88;
}

.ad-pair {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  width: 100%;
}

main + .ad-pair {
  margin: 28px 16px 0;
  width: calc(100% - 32px);
}

.ad-carousel,
.ad-video-card,
.ad-image-card {
  max-width: none;
  width: 100%;
  padding: 12px 12px 14px;
  border-radius: var(--radius-lg);
  background: #071428;
  color: #e8fbff;
  box-shadow: var(--shadow-md);
}

.ad-video,
.ad-image {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: #04101f;
  aspect-ratio: 1 / 1;
  max-height: min(280px, 58vw);
}

.ad-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ad-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-carousel-frame {
  border-radius: 12px;
  overflow: hidden;
  background: #04101f;
  aspect-ratio: 1 / 1;
  max-height: min(280px, 58vw);
}

.ad-carousel-slide {
  display: block;
  width: 100%;
  height: 100%;
}

.ad-carousel-slide[hidden] {
  display: none;
}

.ad-carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.ad-carousel-arrow {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #12324a;
  color: #7ee7ff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ad-carousel-arrow:hover,
.ad-carousel-arrow:focus-visible {
  background: #18425f;
}

.ad-carousel-dots {
  display: flex;
  gap: 8px;
}

.ad-carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #3d5d73;
  cursor: pointer;
}

.ad-carousel-dots button.is-active,
.ad-carousel-dots button[aria-current="true"] {
  background: #7ee7ff;
}

.ad-carousel-contact {
  display: inline-block;
  margin-top: 10px;
  color: #9ad8e8;
  font-size: 0.8rem;
  text-decoration: underline;
}

.ad-carousel-contact:hover,
.ad-carousel-contact:focus-visible {
  color: #d7f7ff;
}

.ad-card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
  font-size: 0.72rem;
  line-height: 1.3;
}

.ad-card-details a {
  color: #c8e7ef;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.ad-card-details a:hover,
.ad-card-details a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.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: var(--font-display);
  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: var(--font-display);
  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;
}

.product-card-actions .button.primary,
.product-card-actions .qty-stepper,
.product-card-actions .sheet-add {
  flex: 1;
  min-width: 0;
}

.share-offer {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
}

.share-offer svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.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: auto;
  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 {
  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 {
  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);
}

.category-icon, .department-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.75), transparent 62%),
    var(--category-bg, var(--primary-light));
  box-shadow: 0 8px 16px -8px rgba(15, 23, 42, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.category-card span strong, .department-card span strong {
  display: block;
  font-family: var(--font-display);
  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-lg);
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.ticket-card-copy {
  min-width: min(100%, 220px);
  flex: 1 1 220px;
}

.ticket-card-copy h2 {
  color: #ffffff;
  font-size: 1.12rem;
  margin: 0 0 2px;
}

.ticket-card-copy p {
  color: #94a3b8;
  font-size: 0.84rem;
  margin: 0;
  line-height: 1.35;
}

.ticket-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.ticket-card-actions .ticket-cta {
  padding: 8px 14px;
  font-size: 0.88rem;
}

.ticket-card-actions .ticket-cta svg {
  width: 16px;
  height: 16px;
}

.ticket-card-actions small {
  color: #94a3b8;
  font-size: 0.75rem;
}

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

.catalog-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 4px 0 14px;
  color: var(--muted);
}

.catalog-meta strong {
  color: var(--ink);
}

.profeco-result-list,
.offer-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  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;
}

.shelf-card {
  padding: 0 0 12px;
  gap: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

a.profeco-offer-chip {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.profeco-offer-chip:hover,
a.profeco-offer-chip:focus-visible {
  border-color: var(--primary, #0f766e);
}

.offer-store-link {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--primary-dark, #0f766e);
}

a.profeco-offer-chip.cheapest .offer-store-link {
  color: inherit;
}

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

.profeco-offer-chip.with-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 12px;
}

.offer-chip-copy {
  min-width: 0;
}

.offer-chip-copy small {
  display: block;
  margin-top: 2px;
}

.offer-chip-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-list-button,
.offer-store-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--primary);
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.offer-list-button {
  background: var(--primary);
  color: #fff;
}

.offer-list-button:hover,
.offer-list-button:focus-visible,
.offer-list-button.selected {
  background: var(--primary-dark);
}

.offer-store-button {
  background: var(--surface);
  color: var(--primary-dark);
  text-decoration: none;
}

.offer-store-button:hover,
.offer-store-button:focus-visible {
  background: var(--primary-light);
}

.product-store-choice,
.list-store-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  background: var(--saving-bg);
  color: var(--primary-dark);
  font-size: 0.82rem;
}

.product-store-choice button,
.list-store-choice button {
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Professional price summary strip */
.pro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pro-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  min-width: 62px;
  line-height: 1.15;
}

.pro-stat b {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pro-stat small {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pro-stat.save {
  background: var(--saving-bg);
  border-color: #a7f3d0;
}

.pro-stat.save b { color: var(--primary-dark); }
.pro-stat.save small { color: var(--primary-dark); opacity: 0.85; }

/* Source + freshness badge on each result */
.source-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.source-badge.live {
  background: var(--saving-bg);
  color: var(--primary-dark);
  border: 1px solid #a7f3d0;
}

.source-badge.ref {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}

.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 span {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.savings-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.savings-stats div {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
}

.savings-stats strong {
  display: block;
  font-size: 1.15rem;
}

.savings-stats span {
  font-size: 0.78rem;
  color: #a7f3d0;
}

.savings-fair-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #d1fae5;
}

.ticket-status-card {
  margin: 8px 0 24px;
}

.ticket-status-card .resume-card {
  background: #fff;
  border: 1px solid var(--border);
}

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(76px + var(--safe-bottom, 0px));
  z-index: 95;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.install-banner[hidden] { display: none; }

.install-banner strong { display: block; }
.install-banner small { color: var(--muted); }
.install-banner .button { margin-left: auto; }

@media (min-width: 768px) {
  .install-banner { bottom: 20px; max-width: 520px; left: 50%; right: auto; transform: translateX(-50%); }
}

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

.quick-partial-context,
.quick-partial-plan-note {
  border: 1px solid #fdba74;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.82rem;
  line-height: 1.45;
}

.quick-partial-context {
  display: grid;
  gap: 5px;
  margin: 0 0 14px;
  padding: 11px 12px;
}

.quick-partial-context strong,
.quick-partial-context p,
.quick-partial-context small {
  color: #9a3412;
  font: inherit;
  margin: 0;
}

.quick-partial-context strong {
  font-weight: 800;
}

.quick-partial-context small {
  color: #7c2d12;
}

.quick-partial-context button {
  justify-self: start;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #fb923c;
  border-radius: 8px;
  background: #ffffff;
  color: #9a3412;
  font-size: 0.76rem;
  font-weight: 750;
  text-align: left;
}

.quick-partial-context.compact {
  margin: 10px 0 0;
  padding: 8px 9px;
  background: rgba(255, 247, 237, 0.14);
  border-color: rgba(255, 237, 213, 0.5);
}

.compare-drawer-summary .quick-partial-context.compact strong,
.compare-drawer-summary .quick-partial-context.compact p {
  color: #ffedd5;
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.quick-partial-plan-note {
  grid-column: 1 / -1;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.quick-review-explanation {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.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-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 4px;
}

.list-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.list-actions-row .button {
  flex: 1 1 180px;
}

.list-actions .fb-follow {
  width: 100%;
}

.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: var(--font-display);
  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: minmax(0, 1fr);
  gap: 16px;
}

.plan-mode-hint {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.plan-card-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.plan-saving {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.plan-item-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-item-list li {
  display: grid;
  gap: 7px;
  font-size: 0.85rem;
  line-height: 1.35;
  min-width: 0;
}

.plan-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.plan-item-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-item-main strong {
  flex: 0 0 auto;
}

.plan-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-item-actions button,
.plan-missing button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
}

.plan-item-actions button:hover,
.plan-missing button:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.plan-missing {
  padding: 10px 12px 12px;
  font-size: 0.8rem;
  color: var(--warning);
  line-height: 1.4;
}

.plan-missing p {
  margin: 0 0 8px;
  font-weight: 750;
}

.plan-missing ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-missing li {
  display: grid;
  gap: 6px;
}

.plan-details {
  margin-top: 4px;
}

.plan-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.plan-coverage-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, var(--primary-light));
}

.plan-coverage-details > summary,
.plan-store-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  list-style: none;
}

.plan-coverage-details > summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-coverage-details > summary::-webkit-details-marker,
.plan-store-group > summary::-webkit-details-marker {
  display: none;
}

.plan-coverage-details > summary::after,
.plan-store-group > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
}

.plan-coverage-details[open] > summary::after,
.plan-store-group[open] > summary::after {
  content: "−";
}

.plan-coverage-details > summary b {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  text-align: center;
}

.plan-coverage-details.missing > summary b {
  background: var(--warning-bg);
  color: var(--warning);
}

.plan-coverage-details > .plan-item-list {
  margin: 0 11px 11px;
}

.plan-coverage-complete,
.plan-coverage-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.plan-card-actions {
  margin-top: 4px;
}

.plan-split-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.plan-store-group {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.plan-store-group > summary {
  cursor: pointer;
  font-size: 0.82rem;
}

.plan-store-group > summary span {
  min-width: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.plan-store-group > summary strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 0.78rem;
  text-align: right;
}

.plan-store-group > .plan-item-list {
  margin: 0 11px 11px;
}

.plan-warning {
  margin: 0;
  font-size: 0.8rem;
  color: var(--warning);
}

.plan-mode-note,
.plan-split-hint {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.plan-split-hint {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-weight: 700;
}

.plan-split-hint:hover {
  filter: brightness(0.98);
}

.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: var(--font-display);
  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;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.compare-open {
  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 > .compare-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-drawer-summary strong {
  font-family: var(--font-display);
  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-recommendation-stores {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(209, 250, 229, 0.28);
}

.compare-recommendation-store {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.compare-recommendation-store span {
  min-width: 0;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.compare-recommendation-store strong,
.compare-recommendation-store b {
  color: #d1fae5;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

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

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

.compare-drawer-actions .button.primary {
  width: 100%;
}

.compare-drawer-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compare-drawer-tools .button {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.88rem;
  box-shadow: none;
}

.compare-clear-btn {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.compare-clear-btn:hover {
  background: var(--danger-bg);
  border-color: #fca5a5;
}

.fb-follow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f0f5ff;
  color: #1877f2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #d6e4ff;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.fb-follow:hover {
  background: #e8f0ff;
  border-color: #b9d0ff;
  transform: translateY(-1px);
}

.fb-follow-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1877f2;
  color: #ffffff;
  flex-shrink: 0;
}

.fb-follow-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.fb-follow-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fb-follow-copy strong {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1d4ed8;
}

.fb-follow-copy small {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.fb-follow.on-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.fb-follow.on-dark:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.fb-follow.on-dark .fb-follow-copy strong {
  color: #ffffff;
}

.fb-follow.on-dark .fb-follow-copy small {
  color: #93c5fd;
}

.compare-ticket-link {
  align-self: center;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px 4px;
}

.compare-ticket-link:hover {
  color: var(--primary-dark);
}

.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: var(--font-display);
  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: block;
  min-width: 0;
  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-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.compare-store-total-head > div {
  min-width: 0;
}

.compare-store-total-head > div:first-child > 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-price {
  flex: 0 0 auto;
  text-align: right;
}

.compare-store-price strong {
  font-size: 1.1rem;
  font-weight: 800;
}

.compare-store-coverage {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.compare-store-coverage .plan-coverage-details {
  background: rgba(255, 255, 255, 0.74);
}

.compare-store-coverage .plan-item-actions button,
.compare-store-coverage .plan-missing button {
  background: #ffffff;
}

.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-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;
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.68rem;
  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);
}

/* Ticket contribution flow: full-screen on phones, bounded dialog on desktop. */
.ticket-modal {
  inset: 0;
  inline-size: 100%;
  block-size: 100vh;
  block-size: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: none;
}

.ticket-modal-header,
.ticket-modal-body {
  inline-size: min(100%, 42rem);
  min-inline-size: 0;
  justify-self: center;
  background: var(--surface);
}

.ticket-modal-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.ticket-close {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-alt);
  font-size: 1.6rem;
  line-height: 1;
}

.ticket-title-wrap {
  min-inline-size: 0;
}

.ticket-title-wrap h2 {
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.1;
}

.ticket-secure {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.ticket-modal-body {
  min-block-size: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 20px 16px 28px;
}

.ticket-stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 24px;
  padding: 0;
}

.ticket-stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-inline-size: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.ticket-stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 15px;
  left: calc(50% + 18px);
  inline-size: calc(100% - 36px);
  block-size: 2px;
  background: var(--border-strong);
}

.ticket-stepper li.done::after {
  background: var(--primary);
}

.ticket-stepper li span {
  position: relative;
  z-index: 1;
  inline-size: 32px;
  block-size: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.ticket-stepper li.active,
.ticket-stepper li.done {
  color: var(--primary-dark);
}

.ticket-stepper li.active span,
.ticket-stepper li.done span {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.ticket-step {
  min-inline-size: 0;
  display: grid;
  gap: 20px;
}

.ticket-intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.ticket-intro h3,
.ticket-review-copy h3,
.ticket-success h3 {
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.15;
}

.ticket-intro p,
.ticket-review-copy p,
.ticket-success > p {
  margin: 0;
  color: var(--ink-secondary);
}

.ticket-big-icon {
  inline-size: 64px;
  block-size: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

.ticket-big-icon svg {
  inline-size: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ticket-capture-actions {
  display: grid;
  gap: 12px;
}

.ticket-capture-actions .button {
  inline-size: 100%;
  min-block-size: 48px;
}

.ticket-camera-button svg {
  inline-size: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.ticket-preview-card {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.ticket-preview-list {
  display: flex;
  gap: 6px;
}

.ticket-preview-list img {
  inline-size: 72px;
  block-size: 88px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.ticket-preview-card > div {
  min-inline-size: 0;
}

.ticket-preview-card strong,
.ticket-preview-card small {
  display: block;
}

.ticket-preview-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

@media (max-width: 33.99rem) {
  .ticket-preview-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ticket-preview-list {
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .ticket-preview-list img {
    flex: 0 0 72px;
  }
}

.ticket-preview-card small {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ticket-preview-card button,
.ticket-link-button {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ticket-review-copy {
  display: grid;
  gap: 5px;
}

.ticket-form-grid {
  display: grid;
  gap: 14px;
}

.ticket-field {
  min-inline-size: 0;
  display: grid;
  gap: 7px;
}

.ticket-field > span {
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 800;
}

.ticket-field > span small {
  color: var(--muted);
  font-weight: 500;
}

.ticket-field input,
.ticket-field select {
  inline-size: 100%;
  min-block-size: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
}

.ticket-field input:focus,
.ticket-field select:focus {
  border-color: var(--primary);
}

.ticket-money-input {
  display: flex;
  align-items: center;
  min-block-size: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.ticket-money-input:focus-within {
  border-color: var(--primary);
  outline: 3px solid var(--primary-glow);
}

.ticket-money-input b {
  padding-left: 13px;
  color: var(--muted);
}

.ticket-money-input input {
  min-block-size: 46px;
  border: 0;
  outline: 0;
  background: transparent;
}

.ticket-honeypot {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ticket-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  color: var(--ink-secondary);
  font-size: 0.86rem;
}

.ticket-consent input {
  inline-size: 22px;
  block-size: 22px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.ticket-data-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.82rem;
}

.ticket-submit {
  inline-size: 100%;
  min-block-size: 50px;
}

.ticket-submit.loading {
  cursor: progress;
  opacity: 0.72;
}

.ticket-upload-status {
  min-block-size: 1.5em;
  color: var(--ink-secondary);
  text-align: center;
}

.ticket-upload-status.error {
  color: var(--danger);
}

.ticket-success {
  justify-items: center;
  padding-block: 16px;
  text-align: center;
}

.ticket-success-check {
  inline-size: 68px;
  block-size: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--saving-bg);
  color: var(--primary-dark);
  font-size: 2rem;
  font-weight: 900;
}

.ticket-impact-card {
  inline-size: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  text-align: left;
}

.ticket-impact-card small,
.ticket-impact-card strong {
  display: block;
}

.ticket-impact-card b {
  color: var(--primary-dark);
  font-size: 0.8rem;
}

.ticket-success > .button {
  inline-size: 100%;
  min-block-size: 48px;
}

@media (min-width: 34rem) {
  .ticket-capture-actions,
  .ticket-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-field-wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 45rem) {
  .ticket-modal {
    padding-top: max(1rem, env(safe-area-inset-top, 0px), calc((100dvh - 46rem) / 2));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px), calc((100dvh - 46rem) / 2));
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
  }

  .ticket-modal-header {
    padding: 15px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .ticket-modal-body {
    padding: 24px 28px 32px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticket-modal,
  .ticket-modal * {
    scroll-behavior: auto;
  }
}

/* Barcode scanner: full-screen on phones so the camera cannot overflow
   the viewport or trap body scroll with an off-screen close button. */
.scanner-modal {
  inset: 0;
  inline-size: 100%;
  block-size: 100vh;
  block-size: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: none;
}

.scanner-header,
.scanner-body {
  inline-size: min(100%, 42rem);
  min-inline-size: 0;
  justify-self: center;
  background: var(--surface);
}

.scanner-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.scanner-close {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-alt);
  font-size: 1.6rem;
  line-height: 1;
}

.scanner-header h2 {
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  line-height: 1.1;
}

.scanner-body {
  min-block-size: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 28px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-lg);
  background: #0b1220;
  aspect-ratio: 3 / 4;
  max-block-size: min(58dvh, 520px);
}

.camera-frame video {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  background: #0b1220;
}

.scan-guide {
  position: absolute;
  inset: 14%;
  pointer-events: none;
  border-radius: 18px;
}

.scan-guide i {
  position: absolute;
  inline-size: 22px;
  block-size: 22px;
  border: 3px solid #ffffff;
}

.scan-guide i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.scan-guide i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.scan-guide i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.scan-guide i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

.scan-guide span {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  block-size: 2px;
  background: rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.65);
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: #e2e8f0;
  text-align: center;
  background: rgba(11, 18, 32, 0.72);
}

.camera-placeholder svg {
  inline-size: 42px;
  block-size: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.camera-placeholder p {
  margin: 0;
  max-inline-size: 22rem;
  font-size: 0.92rem;
}

.scanner-help {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.manual-code {
  display: grid;
  gap: 10px;
}

.manual-code-toggle {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.manual-code form {
  display: grid;
  gap: 8px;
}

.manual-code label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.manual-code form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.manual-code input {
  min-inline-size: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: inherit;
}

.manual-code button[type="submit"] {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.scan-result {
  min-block-size: 0;
}

.scan-known,
.scan-unknown,
.scan-error,
.scan-loading {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.scan-known,
.scan-unknown {
  border: 1px solid #a7f3d0;
  background: var(--primary-light);
}

.scan-error {
  border: 1px solid #fecaca;
  background: var(--danger-bg);
}

.scan-loading {
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.scan-known h3,
.scan-unknown h3 {
  margin: 0;
  font-size: 1.05rem;
}

.scan-known p,
.scan-unknown p,
.scan-error,
.scan-loading {
  margin: 0;
  color: var(--ink-secondary);
}

.raw-offers {
  display: grid;
  gap: 8px;
}

.raw-offer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #a7f3d0;
}

@media (min-width: 45rem) {
  .scanner-modal {
    padding-top: max(1rem, env(safe-area-inset-top, 0px), calc((100dvh - 46rem) / 2));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px), calc((100dvh - 46rem) / 2));
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
  }

  .scanner-header {
    padding: 15px 20px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .scanner-body {
    padding: 20px 24px 28px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .camera-frame {
    aspect-ratio: 4 / 3;
    max-block-size: min(52dvh, 420px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scanner-modal,
  .scanner-modal * {
    scroll-behavior: auto;
  }
}

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


/* ==========================================================================
   HOME ESTILO PORTADA — hero con foto, departamentos, footer y legales
   ========================================================================== */

/* Hero con fotografía de productos frescos: la misma jerarquía tipográfica
   de siempre, ahora sobre el pasillo de frutas y verduras. */
.hero-photo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(420px, 58vh, 600px);
  background:
    linear-gradient(155deg, rgba(6, 43, 31, 0.92) 0%, rgba(6, 78, 59, 0.68) 48%, rgba(4, 26, 19, 0.86) 100%),
    url("/assets/hero.jpg") center 38% / cover no-repeat,
    linear-gradient(140deg, #05402f 0%, #059669 58%, #1c1917 100%);
}

.hero-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  text-align: center;
  padding: 22px 18px 20px;
  background:
    linear-gradient(155deg, rgba(6, 43, 31, 0.86) 0%, rgba(6, 78, 59, 0.58) 48%, rgba(4, 26, 19, 0.8) 100%),
    url("/assets/hero.jpg") center 38% / cover no-repeat,
    linear-gradient(160deg, #065f46 0%, #059669 72%);
}

.site-ahorrotj .hero-compact {
  min-height: clamp(240px, 32vw, 330px);
  background:
    linear-gradient(110deg, rgba(43, 13, 20, 0.9) 0%, rgba(105, 18, 31, 0.72) 46%, rgba(6, 70, 91, 0.68) 100%),
    url("/assets/tijuana-cecut.webp") center 52% / cover no-repeat,
    linear-gradient(135deg, #66131b, #087ea4);
}

.hero-region {
  max-width: 44rem;
  margin: 8px auto 0;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: clamp(0.78rem, 2vw, 0.94rem);
}

.site-ahorrotj .hero-compact .eyebrow {
  color: #fff1f2;
  background: rgba(91, 15, 27, 0.62);
}

.hero-compact .hero-copy {
  max-width: 36rem;
  margin: 0 auto 14px;
}

.hero-compact .hero-copy h1 {
  font-size: clamp(1.55rem, 4.2vw, 2.15rem);
  margin-bottom: 0;
}

.hero-compact .search-box {
  width: min(100%, 560px);
  margin: 0 auto;
}

.hero-photo .eyebrow {
  color: #d1fae5;
  background: rgba(6, 95, 70, 0.55);
  backdrop-filter: blur(6px);
}

/* --- Departamentos en la portada ------------------------------------- */
.home-departments {
  margin-bottom: 8px;
}

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

.department-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0 0 14px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.department-card:hover,
.department-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  outline: none;
}

.department-card-icon {
  width: 46px;
  height: 46px;
  margin: 16px 16px 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  line-height: 1;
}

.department-card-photo {
  display: block;
  width: 100%;
  height: 84px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background: #f4f1ea;
}

.department-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.25;
  padding: 2px 14px 0;
}

.department-card-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 14px;
}

.department-grid-loading {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 4px;
  margin: 0;
}

/* --- Chips de departamento en el catálogo ----------------------------- */
.department-chips {
  padding-bottom: 4px;
  margin-bottom: 0;
}

.department-chip-icon {
  margin-right: 6px;
  font-size: 0.95rem;
  line-height: 1;
}

/* --- Pie de página ----------------------------------------------------- */
.site-footer {
  margin: 16px 16px calc(96px + var(--safe-bottom));
  padding: 20px clamp(18px, 4vw, 32px);
  border-radius: var(--radius-xl);
  background: linear-gradient(150deg, #0f1f18 0%, #132b21 100%);
  color: #d8e2dc;
}

.site-footer-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-footer-main {
  min-width: 0;
}

.site-footer .fb-follow {
  max-width: 320px;
  flex: 0 0 auto;
  align-self: flex-start;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 12px;
}

.site-footer-brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #34d399;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer-note {
  font-size: 0.84rem;
  line-height: 1.65;
  color: #a9b8b0;
  max-width: 660px;
  margin: 0;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 14px 0 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer-links a {
  color: #6ee7b7;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}

.site-footer-links a:hover,
.site-footer-links a:focus-visible {
  text-decoration: underline;
}

.site-footer-copy {
  display: block;
  margin-top: 10px;
  color: #7d8b83;
  font-size: 0.76rem;
}

.photo-credit {
  display: block;
  margin-top: 5px;
  color: #7d8b83;
  font-size: 0.68rem;
}

.photo-credit a {
  color: #a7f3d0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-ahorrotj .site-footer {
  background: linear-gradient(145deg, #3f1118 0%, #112f3a 100%);
}

.site-ahorrotj .site-footer-links a {
  color: #fda4af;
}

@media (max-width: 767px) {
  .ad-carousel-frame,
  .ad-video,
  .ad-image {
    width: 100%;
    max-height: none;
  }
}

@media (min-width: 768px) {
  .ad-pair,
  main + .ad-pair {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 960px;
    margin: 32px auto 0;
    width: 100%;
  }

  .site-footer {
    margin: 16px 0 0;
  }

  .site-footer-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
  }
}

/* --- Páginas legales (privacidad / términos) --------------------------- */
.legal-shell {
  min-height: 100dvh;
  background: var(--bg-app);
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 20px;
}

.legal-topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
}

.legal-topbar .brand svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legal-topbar .legal-back {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.legal-topbar .legal-back:hover {
  text-decoration: underline;
}

.legal-document {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 20px 90px;
}

.legal-document .legal-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 18px 0 8px;
}

.legal-document h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 10px;
}

.legal-document .legal-updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 26px;
}

.legal-document h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 34px 0 8px;
}

.legal-document p,
.legal-document li {
  line-height: 1.75;
  color: var(--ink-secondary);
  font-size: 0.97rem;
}

.legal-document ul {
  padding-left: 22px;
}

.legal-document li {
  margin-bottom: 6px;
}

.legal-document a {
  color: var(--primary);
  font-weight: 600;
}

.legal-document .legal-callout {
  background: var(--primary-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 20px 0;
}

.legal-document .legal-callout p {
  margin: 0;
}

/* Foto del producto en tarjetas (index y farmacia) */
.product-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.product-card-meta {
  min-width: 0;
  flex: 1;
}

.product-card-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}

.product-card-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 4px;
}

@media (max-width: 640px) {
  .product-card-icon,
  .product-card-thumb {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  /* Portada: el hero no debe comerse la primera pantalla ni forzar scroll extra. */
  .hero {
    margin: 10px 12px 14px;
    padding: 18px 16px 16px;
  }
  .hero-photo {
    min-height: 0;
    justify-content: flex-start;
  }
  .hero-copy {
    margin-bottom: 12px;
  }
  .hero-copy h1 {
    font-size: clamp(1.55rem, 7.2vw, 1.95rem);
    margin-bottom: 6px;
    line-height: 1.12;
  }
  .hero-copy p {
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .compare-hero {
    margin-top: 12px;
    gap: 10px;
    padding: 10px 12px;
  }
  .compare-hero-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .compare-hero strong {
    font-size: 0.95rem;
  }
  .compare-hero small {
    font-size: 0.75rem;
  }

  /* Departamentos: 3 columnas y foto baja para no alargar el scroll. */
  .home-departments .department-grid,
  .home-departments .aisle-strip,
  .department-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .aisle-chip .department-card-photo,
  .aisle-chip .department-card-icon {
    height: 58px;
  }
  .department-card {
    gap: 4px;
    padding: 0 0 8px;
  }
  .department-card-photo {
    height: 58px;
    aspect-ratio: 16 / 9;
  }
  .department-card-name {
    font-size: 0.75rem;
    padding: 2px 8px 0;
  }
  .department-card-count {
    font-size: 0.65rem;
    padding: 0 8px;
  }
}

/* Logo de marca */
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

/* Carrito de farmacia: barra flotante + panel */
.rx-cart-bar {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  max-width: min(96vw, 520px);
}

.rx-cart-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.rx-cart-summary strong {
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.rx-cart-caret {
  font-size: 0.7rem;
  color: var(--muted);
}

.rx-cart-bar .button.whatsapp {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
}

.rx-cart-bar .button.whatsapp svg {
  width: 18px;
  height: 18px;
}

.rx-cart-panel {
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 62px);
  transform: translateX(-50%);
  z-index: 60;
  width: min(94vw, 460px);
  max-height: 72vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rx-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rx-cart-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.rx-cart-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.rx-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.rx-cart-item-info {
  min-width: 0;
}

.rx-cart-item-info strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.25;
}

.rx-cart-item-info small {
  color: var(--muted);
  font-size: 0.75rem;
}

.rx-cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.rx-cart-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.rx-cart-qty b {
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.rx-cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 0.95rem;
}

.rx-cart-total-row small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.rx-cart-total-row strong {
  font-size: 1.15rem;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.rx-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.rx-cart-actions .fb-follow {
  width: 100%;
}

@media (max-width: 640px) {
  .rx-cart-bar {
    width: calc(100vw - 20px);
    justify-content: space-between;
  }
}

/* Navegación entre secciones (Súper / Farmacia) en el topbar */
.topbar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-nav a {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.topbar-nav a:hover {
  color: var(--ink);
  border-color: var(--border-strong);
}

.topbar-nav a.active {
  color: var(--primary-dark);
  border-color: #a7e8cd;
  background: var(--saving-bg);
}

@media (max-width: 560px) {
  .topbar-nav a {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* --- Home compacto, pasillos en tira y tarjeta anaquel ---------------- */
.aisle-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  padding: 2px 0 4px;
}

.aisle-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  padding: 0 0 10px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
}

.aisle-chip:hover,
.aisle-chip:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.aisle-chip .department-card-photo {
  display: block;
  width: 100%;
  height: 78px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef3f0;
}

.aisle-chip .department-card-icon {
  width: 100%;
  height: 78px;
  margin: 0;
  border-radius: 0;
  font-size: 1.6rem;
}

.aisle-chip-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.aisle-chip-name {
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--ink);
  padding: 8px 8px 0;
}

.staple-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.staple-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.staple-card:hover,
.staple-card:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.staple-card-icon {
  font-size: 1.35rem;
}

.staple-card strong {
  font-size: 0.88rem;
  font-weight: 700;
}

.staple-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.pantry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  border: 1px solid #a7f3d0;
}

.pantry-card h2 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.pantry-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.shelf-card .shelf-media {
  position: relative;
  display: block;
  background: #f8faf9;
  width: 100%;
  height: clamp(138px, 14vw, 176px);
  min-height: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

.shelf-card .shelf-media img,
.shelf-card .shelf-media .product-card-icon {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
  padding: 8px;
}

.shelf-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
}

.shelf-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
  padding: 0 12px;
  min-width: 0;
}

.shelf-card .product-card-title {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-transform: none;
}

.shelf-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.shelf-price {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}

.shelf-unit {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.shelf-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.shelf-add:hover,
.shelf-add:focus-visible {
  background: var(--primary-hover);
}

.shelf-chains {
  margin-top: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.shelf-card .qty-stepper {
  margin-left: auto;
}

.product-view {
  padding: 8px 16px 32px;
}

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.product-breadcrumb a,
.product-breadcrumb button {
  color: var(--primary-dark);
  font-weight: 600;
}

.product-page-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.product-page-photo {
  background: #f8faf9;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
}

.product-page-photo img,
.product-page-photo .product-card-thumb,
.product-page-photo .product-card-icon {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: 380px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  padding: 16px;
  background: #fff;
}

.product-page-best {
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.product-verdict {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--saving-bg);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.product-verdict.high {
  background: var(--warning-bg);
  color: #92400e;
}

.product-alt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.product-report {
  margin-top: 18px;
}

@media (max-width: 720px) {
  .staple-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pantry-card {
    flex-direction: column;
    align-items: stretch;
  }
  .product-page-grid {
    grid-template-columns: 1fr;
  }
  .offer-chip-actions > * {
    flex: 1 1 140px;
  }
  .product-store-choice,
  .list-store-choice {
    align-items: stretch;
    flex-direction: column;
  }
  .product-store-choice button,
  .list-store-choice button {
    min-height: 34px;
    text-align: left;
  }
  .product-page-photo .product-card-thumb,
  .product-page-photo .product-card-icon {
    min-height: 240px;
    max-height: 320px;
    width: 100%;
    height: auto;
  }
}

/* --- Blog editorial de Mi Mandado ------------------------------------- */
.home-blog-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid #bfe8d6;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 196, 87, 0.24), transparent 34%),
    linear-gradient(135deg, #effbf5, #fffdf5);
  box-shadow: var(--shadow-sm);
}

.home-blog-callout h2,
.home-blog-callout p {
  margin: 0;
}

.home-blog-callout h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.025em;
}

.home-blog-callout p:last-child {
  max-width: 650px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.home-blog-callout .button {
  flex: 0 0 auto;
  text-decoration: none;
}

.blog-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 197, 94, 0.08), transparent 24rem),
    var(--background);
}

.blog-page .site-footer {
  margin-bottom: 18px;
}

.blog-main,
.blog-post-main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 54px) clamp(16px, 4vw, 28px);
}

.blog-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid #cce9dc;
  border-radius: 28px;
  background:
    radial-gradient(circle at 86% 20%, rgba(250, 185, 63, 0.35), transparent 32%),
    linear-gradient(145deg, #eaf9f1, #fffaf0);
}

.blog-hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -62px;
  width: 190px;
  height: 190px;
  border: 28px solid rgba(13, 107, 92, 0.08);
  border-radius: 50%;
}

.blog-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.blog-hero > p:last-child {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.65;
}

.blog-feed {
  padding: clamp(28px, 5vw, 50px) 0 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.blog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: #a7dcca;
  box-shadow: var(--shadow-md);
}

.blog-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e7f3ed;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.025);
}

.blog-card-body {
  padding: 20px;
}

.blog-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--saving-bg);
  color: var(--primary-dark);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-card h2 {
  margin: 13px 0 9px;
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.4vw, 1.6rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.blog-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.blog-card h2 a:hover,
.blog-card h2 a:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-card-body > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.blog-card-meta,
.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 17px;
  color: var(--muted);
  font-size: 0.78rem;
}

.blog-state,
.blog-empty-page {
  max-width: 720px;
  margin: 28px auto;
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.blog-state h2,
.blog-empty-page h1 {
  margin: 6px 0 10px;
  font-family: var(--font-display);
}

.blog-state p,
.blog-empty-page p {
  color: var(--muted);
  line-height: 1.65;
}

.blog-state .button,
.blog-empty-page .button {
  display: inline-flex;
  margin-top: 8px;
  text-decoration: none;
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 34px 0 8px;
  font-size: 0.9rem;
}

.blog-pagination a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.blog-pagination a:hover,
.blog-pagination a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-main {
  max-width: 920px;
}

.blog-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

.blog-breadcrumb a {
  color: var(--primary-dark);
  font-weight: 800;
}

.blog-article {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.blog-article-header {
  padding: clamp(28px, 7vw, 64px) clamp(22px, 7vw, 72px) clamp(24px, 5vw, 44px);
}

.blog-article-header h1 {
  max-width: 780px;
  margin: 14px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.blog-article-excerpt {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.3vw, 1.2rem);
  line-height: 1.7;
}

.blog-feature {
  margin: 0;
  background: #e7f3ed;
}

.blog-feature img {
  display: block;
  width: 100%;
  max-height: 580px;
  object-fit: cover;
}

.blog-content {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(30px, 7vw, 68px) clamp(22px, 7vw, 62px);
  color: #26342e;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.08rem);
  line-height: 1.82;
}

.blog-content > :first-child {
  margin-top: 0;
}

.blog-content > :last-child {
  margin-bottom: 0;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin: 1.8em 0 0.65em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.blog-content h2 { font-size: clamp(1.65rem, 4vw, 2.3rem); }
.blog-content h3 { font-size: clamp(1.35rem, 3vw, 1.8rem); }

.blog-content a {
  color: var(--primary-dark);
  font-weight: 750;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.blog-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6rem auto;
  border-radius: 16px;
}

.blog-content figure {
  margin: 1.8rem 0;
}

.blog-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.blog-content blockquote {
  margin: 1.7rem 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--primary);
  color: #42554c;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.blog-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 14px;
  background: #122019;
  color: #e7f8ef;
  line-height: 1.55;
}

.blog-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #edf4f0;
  font-size: 0.9em;
}

.blog-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.blog-content th,
.blog-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.blog-content th {
  background: #edf8f2;
}

.blog-article-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(22px, 7vw, 62px) clamp(34px, 7vw, 64px);
  color: var(--muted);
  font-size: 0.82rem;
}

.blog-share {
  display: grid;
  gap: 16px;
  margin: 0 0 26px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid #d9e6e1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(24, 56, 49, 0.07);
}

.blog-share h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.blog-share p {
  margin: 0;
}

.blog-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-share-actions .button {
  min-height: 42px;
}

.blog-share-status {
  min-height: 1.35em;
  color: var(--success, #0d6b5c);
  font-size: 0.88rem;
  font-weight: 700;
}

.blog-follow-links {
  margin: 0 0 26px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid #cfe4d9;
  border-radius: 20px;
  background: linear-gradient(135deg, #f0faf5, #f8fbf9);
}

.blog-follow-links h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.blog-follow-links p {
  margin: 0 0 14px;
  font-size: 0.92rem;
}

.blog-follow-links nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-follow-links a {
  display: inline-flex;
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(13, 107, 92, 0.09);
}

.blog-follow-links a:hover,
.blog-follow-links a:focus-visible {
  text-decoration: underline;
}

.blog-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.blog-article-footer .button {
  display: inline-flex;
  margin-top: 10px;
  text-decoration: none;
}

@media (max-width: 800px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .home-blog-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .blog-page .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .blog-page .topbar-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-hero {
    border-radius: 22px;
  }

  .blog-pagination {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .blog-article {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .hero-compact {
    margin: 10px 12px 14px;
    padding: 16px 14px 14px;
  }
  .hero-compact .hero-copy h1 {
    font-size: clamp(1.35rem, 6.4vw, 1.75rem);
  }
}

/* --- Compra práctica: precio + tiempo + traslado --------------------- */
.hero-list-first {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 44px);
  text-align: left;
  padding: clamp(24px, 5vw, 48px);
}

.hero-list-first .hero-copy {
  max-width: 34rem;
  margin: 0;
}

.hero-value {
  max-width: 36rem;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.16rem);
  font-weight: 650;
  line-height: 1.55;
}

.quick-list-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 22px 54px rgba(3, 34, 25, 0.28);
  text-align: left;
}

.quick-list-form label {
  display: grid;
  gap: 3px;
}

.quick-list-form label strong {
  font-size: 1.08rem;
}

.quick-list-form label small,
.quick-list-status {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.quick-list-form textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.quick-list-form textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(5, 150, 105, 0.16);
}

.quick-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-list-actions .button {
  flex: 1 1 150px;
}

.quick-list-status {
  min-height: 1.3em;
  margin: 0;
  font-weight: 650;
}

.single-product-search {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  color: #fff;
}

.single-product-search summary {
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.single-product-search .search-box {
  margin-top: 12px;
}

.quick-list-review {
  display: grid;
  gap: 12px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-alt);
  overscroll-behavior: contain;
}

.quick-list-review[hidden] {
  display: none;
}

.quick-review-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.quick-review-group h3,
.quick-ambiguous p {
  margin: 0;
  font-size: 0.9rem;
}

.quick-review-group ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-review-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.quick-review-group.exact strong {
  color: var(--primary-dark);
}

.quick-ambiguous > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
}

.quick-ambiguous button,
.quick-review-group.missing button {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}

.quick-ambiguous button span,
.quick-ambiguous button small {
  display: block;
}

.quick-ambiguous button span {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-ambiguous button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.live-proof-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid #b7e4cf;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #eefbf5, #fffdf5);
  box-shadow: var(--shadow-sm);
}

.live-proof-card h2,
.live-proof-card p {
  margin: 0;
}

.live-proof-card h2 {
  margin: 4px 0 7px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.live-proof-card #liveProofSummary {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.live-proof-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.live-proof-metrics span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #cfeadd;
  border-radius: 12px;
  background: rgb(255 255 255 / 78%);
}

.live-proof-metrics small,
.live-proof-method {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.live-proof-metrics b {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.live-proof-metrics strong {
  color: var(--ink);
  font-size: 1rem;
}

.live-proof-verdict {
  color: var(--ink) !important;
}

.live-proof-method {
  display: block;
  margin-top: 6px;
}

.live-proof-card .button {
  flex: 0 0 auto;
}

.home-module-error {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #7c2d12;
}

.home-module-error span {
  flex: 1 1 240px;
  font-size: 0.85rem;
}

.home-module-error .button {
  min-height: 38px;
  padding: 8px 12px;
}

.practical-preferences {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.25fr);
  gap: 16px 22px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #b7e4cf;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f0fdf6, #fff);
}

.practical-preferences-copy h3,
.practical-preferences-copy p {
  margin: 0;
}

.practical-preferences-copy h3 {
  margin: 4px 0 6px;
  font-size: 1.08rem;
}

.practical-preferences-copy p:last-child,
.practical-colony small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.stop-cost-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  align-self: start;
}

.stop-cost-controls button {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.stop-cost-controls button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.custom-stop-cost,
.practical-colony {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.custom-stop-cost[hidden] {
  display: none;
}

.practical-colony {
  grid-column: 1 / -1;
}

.money-input {
  display: flex;
  align-items: center;
  max-width: 220px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.money-input b {
  padding-left: 12px;
  color: var(--primary-dark);
}

.money-input input,
.practical-colony input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.money-input input {
  border: 0;
}

.savings-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.savings-stats .negative strong {
  color: #fecaca;
}

.practical-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.practical-card {
  min-width: 0;
}

.practical-card.not-recommended {
  border-color: #fca5a5;
  background: #fffafa;
}

.practical-cost-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.practical-cost-breakdown span {
  flex: 1 1 110px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.76rem;
}

.practical-cost-breakdown strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 0.92rem;
}

.plan-local-note,
.plan-verdict {
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.plan-local-note,
.plan-verdict.positive {
  background: #ecfdf5;
  color: #065f46;
}

.plan-verdict.negative {
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.all-store-plans {
  margin-top: 16px;
}

.all-store-plans > summary {
  cursor: pointer;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--primary-dark);
  font-weight: 750;
}

.all-store-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.substitution-applied button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.72rem;
  font-weight: 750;
}

.substitution-applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  color: #7c3aed;
  font-size: 0.75rem;
  font-weight: 700;
}

.price-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.price-alerts[hidden] {
  display: none;
}

.price-alert-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #86efac;
  border-radius: 18px;
  background: linear-gradient(135deg, #ecfdf5, #fff);
  box-shadow: var(--shadow-sm);
}

.price-alert-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.price-alert-card p,
.price-alert-card h2 {
  margin: 0;
}

.price-alert-card p {
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.price-alert-card h2 {
  margin: 2px 0 3px;
  font-size: 1.08rem;
}

.price-alert-card small {
  color: var(--muted);
}

.price-alert-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.substitution-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.35);
}

.substitution-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.substitution-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 820px);
}

.substitution-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.substitution-dialog h2,
.substitution-dialog header p {
  margin: 0;
}

.substitution-dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 1.45rem;
}

#substitutionDialogBody {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 22px;
  overscroll-behavior: contain;
}

.substitution-requested {
  margin: 0 0 12px;
  line-height: 1.5;
}

.substitution-preference {
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr);
  align-items: center;
  gap: 5px 12px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-alt);
  font-size: 0.85rem;
  font-weight: 750;
}

.substitution-preference select {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.substitution-preference small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.substitution-method {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 500;
}

.substitution-method summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  width: fit-content;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 750;
}

.substitution-method summary::after {
  content: "+";
  margin-left: 8px;
  font-size: 1rem;
}

.substitution-method[open] summary::after {
  content: "−";
}

.substitution-method p {
  margin: 2px 0 0;
  line-height: 1.5;
}

.substitution-objective strong {
  min-width: 0;
  color: var(--primary-dark);
  overflow-wrap: anywhere;
}

.substitution-loading,
.substitution-error {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--muted);
}

.substitution-error {
  background: #fef2f2;
  color: #991b1b;
}

.loading-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: practicalPulse 1s ease-in-out infinite alternate;
}

@keyframes practicalPulse {
  to { opacity: 0.25; transform: scale(0.78); }
}

.substitution-candidates {
  display: grid;
  gap: 12px;
}

.substitution-candidate {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.substitution-candidate.pending {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.substitution-candidate-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.substitution-candidate-image {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-alt);
}

.substitution-candidate-image > img,
.substitution-candidate-image > span {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.substitution-candidate-head h3,
.substitution-candidate-head p {
  margin: 0;
}

.substitution-candidate-head h3 {
  font-size: 0.96rem;
}

.substitution-candidate-head p,
.substitution-reason,
.substitution-candidate li {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.substitution-candidate-head > strong {
  color: var(--primary-dark);
  font-size: 1rem;
  white-space: nowrap;
}

.substitution-fit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.substitution-fit span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 750;
}

.substitution-saving {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 800;
}

.substitution-reason,
.substitution-candidate ul {
  margin: 0;
}

.substitution-confirm {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #ecfdf5;
}

.substitution-confirm p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.substitution-confirm > div,
.substitution-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.substitution-dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.compare-drawer-scroll {
  min-height: 0;
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .hero-list-first {
    grid-template-columns: 1fr;
  }

  .hero-list-first .hero-copy {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
  }

  .quick-list-form {
    width: min(100%, 680px);
    margin: 0 auto;
  }

  .practical-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .topbar > * {
    min-width: 0;
  }

  .topbar-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 1px 0 3px;
    scrollbar-width: thin;
  }

  .topbar-nav a {
    flex: 0 0 auto;
  }

  .compare-peek {
    display: none !important;
  }

  .plan-item-actions button,
  .plan-missing button,
  .quick-partial-context button,
  .plan-coverage-details > summary,
  .plan-store-group > summary {
    min-height: 44px;
    padding-block: 10px;
  }

  .live-proof-card,
  .price-alert-card {
    align-items: flex-start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .live-proof-card {
    flex-direction: column;
  }

  .live-proof-card .button,
  .price-alert-actions {
    width: 100%;
  }

  .price-alert-actions {
    grid-column: 1 / -1;
  }

  .practical-preferences {
    grid-template-columns: 1fr;
  }

  .practical-colony {
    grid-column: 1;
  }

  .stop-cost-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .live-proof-metrics {
    grid-template-columns: 1fr;
  }

  .hero-list-first {
    margin-inline: 10px;
    padding: 18px 12px;
  }

  .quick-list-form {
    padding: 14px;
    border-radius: 18px;
  }

  .quick-list-actions,
  .plan-item-actions,
  .substitution-confirm > div,
  .substitution-dialog-actions {
    flex-direction: column;
  }

  .quick-list-actions .button,
  .plan-item-actions button,
  .plan-missing button,
  .substitution-confirm .button,
  .substitution-dialog-actions .button {
    width: 100%;
    flex: 0 0 auto;
  }

  .compare-store-total-head {
    gap: 8px;
  }

  .compare-store-total {
    padding: 12px;
  }

  .quick-ambiguous > div {
    grid-template-columns: 1fr;
  }

  .compare-toggle {
    overflow-x: auto;
  }

  .compare-toggle button {
    flex: 0 0 auto;
    min-width: 145px;
  }

  .savings-card {
    padding: 20px 16px;
  }

  .savings-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .savings-stats div:last-child {
    grid-column: 1 / -1;
  }

  .list-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
  }

  .list-item .quantity {
    grid-column: 2;
    justify-self: start;
  }

  .list-item .remove-item {
    grid-column: 3;
    align-self: center;
  }

  .substitution-candidate-head {
    align-items: flex-start;
  }

  .substitution-dialog {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .substitution-dialog-shell {
    max-height: 92dvh;
  }

  .substitution-candidate-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .substitution-candidate-head > strong {
    grid-column: 2;
  }

  .substitution-preference {
    grid-template-columns: 1fr;
  }

  .substitution-preference small {
    grid-column: 1;
  }
}
