/* ============================================================
   ComparApp — Design System CSS — "The Intellectual Curator"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,300;0,400;0,600;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600&family=Inter:wght@400;500;600&display=swap');

/* ── VARIABLES ───────────────────────────────────────────── */
:root {
  --primary:              #006c4b;
  --primary-container:    #00a676;
  --on-primary:           #ffffff;
  --background:           #fbf9f2;
  --surface-low:          #f5f4ec;
  --surface-lowest:       #ffffff;
  --on-surface:           #1b1c17;
  --text-muted:           #4a4b46;
  --text-hint:            #8a8b86;
  --secondary-container:  #83f5c6;
  --outline-variant:      rgba(27,28,23,0.15);
  --error:                #c0392b;
  --warning:              #e67e22;
  --wa-green:             #25D366;
  --gradient-primary:     linear-gradient(135deg, #006c4b 0%, #00a676 100%);
  --shadow-card:          0 12px 40px 0 rgba(27,28,23,0.06);
  --shadow-float:         0 4px 20px 0 rgba(27,28,23,0.08);
  --radius-sm:            4px;
  --radius-md:            12px;
  --radius:               16px;
  --radius-pill:          9999px;
  --font-serif:           'Newsreader', Georgia, serif;
  --font-sans:            'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-micro:           'Inter', sans-serif;

  /* Alias para compatibilidad con código existente */
  --green:                #006c4b;
  --green-dark:           #004d35;
  --green-light:          #e8f5ef;
  --green-mid:            #83f5c6;
  --text:                 #1b1c17;
  --bg:                   #fbf9f2;
  --surface:              #ffffff;
  --border:               rgba(27,28,23,0.12);
  --border-mid:           rgba(27,28,23,0.2);
  --red:                  #c0392b;
  --orange:               #e67e22;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── TIPOGRAFÍA ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--on-surface);
}

/* ── NAVEGACIÓN ──────────────────────────────────────────── */
.ca-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,249,242,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 0 clamp(16px, 5vw, 48px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ca-nav-logo {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ca-nav-logo em { font-style: italic; font-weight: 300; }
.ca-nav-logo strong { font-style: normal; font-weight: 600; }
.ca-nav-beta {
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  background: var(--secondary-container);
  color: var(--primary);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
}
/* compat: badge-ia usado en otras páginas */
.badge-ia {
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  background: var(--secondary-container);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}
.ca-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.ca-nav-links a {
  font-family: var(--font-micro);
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.ca-nav-links a:hover { color: var(--on-surface); }
.ca-nav-cta {
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  text-decoration: none;
  transition: opacity .2s, transform .2s;
}
.ca-nav-cta:hover { opacity: .9; transform: translateY(-1px); }

/* ── MODE PICKER ─────────────────────────────────────────── */
.mode-picker {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 48px 0;
}
.mode-card {
  background: var(--surface-lowest);
  border-radius: 20px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.mode-card:hover { box-shadow: 0 0 0 2px var(--primary), var(--shadow-card); }
.mode-card.active { box-shadow: 0 0 0 2px var(--primary), var(--shadow-card); }
.mode-card-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #E1F5EE;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}
.mode-card-kicker {
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mode-card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--on-surface);
  margin-bottom: 8px;
}
.mode-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.mode-card-cta {
  font-family: var(--font-micro);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-hint);
  transition: color .15s;
}
.mode-card.active .mode-card-cta { color: var(--primary); }

/* Card hero Optimizador */
.mode-card-hero {
  background: var(--gradient-primary);
  color: #fff;
}
.mode-card-hero:hover { box-shadow: 0 0 0 3px var(--secondary-container), 0 20px 60px 0 rgba(0,108,75,0.35); }
.mode-card-hero.active { box-shadow: 0 0 0 3px var(--secondary-container), 0 20px 60px 0 rgba(0,108,75,0.35); }
.mode-card-hero-glow {
  position: absolute; top: -60px; right: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(131,245,198,0.15);
  pointer-events: none;
}
.mode-card-hero .mode-card-icon {
  background: rgba(255,255,255,0.18);
  color: #fff;
}
.mode-card-hero .mode-card-kicker { color: rgba(255,255,255,0.65); }
.mode-card-hero-badge {
  display: inline-block;
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--secondary-container);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.mode-card-hero .mode-card-title {
  font-size: 26px;
  letter-spacing: -0.5px;
  color: #fff;
}
.mode-card-hero .mode-card-title em { font-style: italic; }
.mode-card-hero .mode-card-desc { color: rgba(255,255,255,0.8); }
.mode-card-hero .mode-card-cta { color: rgba(255,255,255,0.7); }
.mode-card-hero.active .mode-card-cta { color: var(--secondary-container); }

/* Mini preview dentro de la hero card */
.mode-preview {
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 20px;
}
.mode-preview-kicker {
  font-family: var(--font-micro);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}
.mode-preview-row {
  display: grid;
  grid-template-columns: 80px 1fr 72px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.mode-preview-row:not(.winner) { opacity: 0.65; }
.mode-preview-store {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.mode-preview-row.winner .mode-preview-store {
  color: var(--secondary-container);
  font-weight: 600;
}
.mode-preview-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.mode-preview-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
}
.mode-preview-row.winner .mode-preview-bar-fill { background: var(--secondary-container); }
.mode-preview-price {
  font-family: var(--font-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-align: right;
}
.mode-preview-row.winner .mode-preview-price { color: var(--secondary-container); }
.mode-preview-footer {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 8px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mode-preview-footer-text {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.mode-preview-saving {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--secondary-container);
  letter-spacing: -0.4px;
}

/* ── MODE BAR ────────────────────────────────────────────── */
.mode-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 48px;
}
.mode-bar-pill {
  display: flex;
  background: var(--surface-low);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.mode-bar-btn {
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all .2s;
}
.mode-bar-btn.active-search {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(27,28,23,0.06);
}
.mode-bar-btn.active-opt {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,108,75,0.25);
}
.mode-bar-desc {
  font-size: 13px;
  color: var(--text-hint);
}

/* ── LAYOUT PRINCIPAL ────────────────────────────────────── */
.ca-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 68px);
}
.ca-sidebar {
  padding: 36px 0 36px 28px;
}
.ca-main {
  padding: 32px 48px 72px 32px;
}

/* ── SIDEBAR SUPERMERCADOS ───────────────────────────────── */
.sidebar-title {
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 4px;
}
.sidebar-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.store-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.store-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.store-item:hover { background: var(--surface-low); }
.store-item.selected { background: #E1F5EE; }
.store-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--background);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.5px;
}
.store-name {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: var(--on-surface);
}
.store-item.selected .store-name { font-weight: 500; color: #0F6E56; }
.store-checkbox {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--outline-variant);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.store-item.selected .store-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.store-checkbox-check {
  width: 10px; height: 10px;
  display: none;
}
.store-item.selected .store-checkbox-check { display: block; }
.sidebar-toggle {
  font-family: var(--font-micro);
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 8px;
}

/* ── BÚSQUEDA ────────────────────────────────────────────── */
.search-hero { margin-bottom: 24px; }
.search-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 20px;
}
.search-hero-title em { font-style: italic; color: var(--primary); }
.search-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-lowest);
  border-radius: var(--radius-pill);
  padding: 14px 18px;
  box-shadow: var(--shadow-float);
  transition: box-shadow .2s;
}
.search-pill:focus-within {
  box-shadow: 0 0 0 2px var(--primary-container), var(--shadow-card);
}
.search-ia-icon {
  font-size: 18px;
  color: var(--primary);
  flex-shrink: 0;
}
.search-pill input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--on-surface);
  background: transparent;
}
.search-pill input::placeholder { color: var(--text-hint); }
.search-btn {
  font-family: var(--font-micro);
  font-size: 14px;
  font-weight: 600;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.search-btn:hover { opacity: .9; transform: translateY(-1px); }
.search-btn:disabled { background: var(--outline-variant); cursor: not-allowed; transform: none; opacity: 1; }

/* Chips de sugerencias */
.search-suggestions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.search-suggest-label {
  font-family: var(--font-micro);
  font-size: 12px;
  color: var(--text-hint);
}
.search-suggest-chip {
  font-family: var(--font-micro);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-low);
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: all .15s;
}
.search-suggest-chip:hover { background: #E1F5EE; color: var(--primary); }

/* ── AI BADGE ────────────────────────────────────────────── */
.ia-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #E1F5EE;
  color: var(--primary);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-family: var(--font-micro);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.ia-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-container);
}

/* ── AI VERDICT ──────────────────────────────────────────── */
.ai-verdict {
  background: var(--gradient-primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  color: #fff;
}
.ai-verdict-kicker {
  font-family: var(--font-micro);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-verdict-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  color: #fff;
}
.ai-verdict-title em { font-style: italic; }
.ai-verdict-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}

/* ── RESULT CARDS ────────────────────────────────────────── */
.result-cards { display: flex; flex-direction: column; gap: 10px; }
.result-card {
  background: var(--surface-lowest);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform .15s, box-shadow .15s;
}
.result-card:hover { transform: translateY(-1px); box-shadow: 0 16px 48px 0 rgba(27,28,23,0.09); }
.result-card.winner { outline: 2px solid var(--primary-container); }
.result-card.secondary { background: rgba(255,255,255,0.5); box-shadow: none; }
.result-card-header { display: flex; align-items: flex-start; gap: 14px; }
.result-rank {
  font-family: var(--font-micro);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-hint);
  min-width: 20px;
  padding-top: 4px;
}
.result-store-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--background);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.result-info { flex: 1; }
.result-store-name {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
}
.result-product-desc {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 2px;
  line-height: 1.4;
}
.result-confidence {
  font-family: var(--font-micro);
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 4px;
}
.result-price-col { text-align: right; }
.result-price {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--primary);
  letter-spacing: -0.5px;
  line-height: 1;
}
.result-card.secondary .result-price {
  font-size: 20px;
  color: var(--on-surface);
}
.result-price-label {
  font-family: var(--font-micro);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}
.result-price-diff {
  font-family: var(--font-micro);
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 2px;
}
.result-price-original {
  font-family: var(--font-micro);
  font-size: 11px;
  color: var(--text-hint);
  text-decoration: line-through;
}
.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-low);
}
.btn-primary {
  flex: 1;
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-wa {
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  cursor: pointer;
}
.btn-add-cart {
  font-family: var(--font-micro);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-low);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-add-cart:hover { background: #E1F5EE; }

/* Promo badge */
.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #E1F5EE;
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-micro);
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
}

/* ── STATUS / LOADING ────────────────────────────────────── */
.status { font-size: 14px; padding: 8px 0; min-height: 20px; font-family: var(--font-sans); }
.status.loading { color: var(--primary); }
.status.err { color: var(--error); }
.status.warn { color: var(--warning); }

/* ── LOADING OVERLAY ─────────────────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--background);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  transition: opacity .4s;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-logo {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--primary);
}
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--surface-low);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-bar {
  width: 200px; height: 3px;
  background: var(--surface-low);
  border-radius: 2px; overflow: hidden;
}
.loading-bar-inner {
  height: 100%; background: var(--primary);
  border-radius: 2px;
  animation: loadbar 1.5s ease-in-out infinite;
}
@keyframes loadbar {
  0% { width: 0%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}
.loading-text { font-size: 13px; color: var(--text-hint); }

/* ── CARRITO LATERAL ─────────────────────────────────────── */
.cart-panel {
  background: var(--surface-low);
  padding: 32px 28px 72px;
  min-height: calc(100vh - 68px);
}

/* Cart FAB */
#cartFab {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  width: 56px; height: 56px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  box-shadow: 0 4px 20px rgba(0,108,75,0.35);
  font-size: 22px;
  transition: transform .2s;
}
#cartFab:hover { transform: scale(1.08); }
#cartBadge {
  position: absolute; top: -4px; right: -4px;
  background: var(--error);
  color: #fff;
  font-family: var(--font-micro);
  font-size: 11px; font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Cart overlay + drawer */
#cartOverlayBg {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(27,28,23,0.4);
  backdrop-filter: blur(4px);
  display: none;
}
#cartOverlayBg.open { display: block; }
#cartDrawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 301;
  width: min(420px, 92vw);
  background: var(--surface-lowest);
  box-shadow: -8px 0 40px rgba(27,28,23,0.12);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}
#cartDrawer.open { transform: translateX(0); }
.cart-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.cart-drawer-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--on-surface);
}
#cerrarCarritoBtn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-hint);
  padding: 4px;
}
#carritoItems { flex: 1; overflow-y: auto; }
.carrito-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-low);
}
.carrito-item-name { flex: 1; font-size: 14px; }
.carrito-item-super { font-size: 12px; color: var(--text-hint); }
.carrito-item-price {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--primary);
}
.carrito-item-del {
  background: none; border: none;
  color: var(--text-hint); cursor: pointer; font-size: 18px;
}
#carritoTotal {
  padding: 16px 0 8px;
  border-top: 1px solid var(--outline-variant);
}
.carrito-total-row {
  display: flex; justify-content: space-between;
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 6px;
}
.carrito-total-val {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary);
}
#vaciarBtn {
  width: 100%; margin-top: 12px;
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(192,57,43,0.3);
  border-radius: var(--radius-pill);
  padding: 10px;
  font-family: var(--font-micro);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
#vaciarBtn:hover { background: rgba(192,57,43,0.05); }

/* ── SELECTOR DE TAMAÑO ──────────────────────────────────── */
.tamano-area {
  background: var(--surface-low);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: none;
}
.tamano-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--outline-variant);
  font-family: var(--font-micro);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface-lowest);
  transition: all .15s;
}
.tamano-chip:hover, .tamano-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #E1F5EE;
}

/* ── DISCLAIMER ──────────────────────────────────────────── */
.disclaimer {
  font-size: 12px;
  color: var(--text-hint);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── LIVE BADGE ──────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-micro);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary);
  text-transform: uppercase;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary-container);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── OPTIMIZADOR ─────────────────────────────────────────── */
.opt-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; min-height: 40px; }
.opt-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-lowest);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-float);
}
.opt-item-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--on-surface); }
.opt-item-del {
  background: none; border: none;
  color: var(--text-hint); cursor: pointer; font-size: 18px; padding: 0; line-height: 1;
}
.opt-add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.opt-add-input {
  flex: 1;
  background: var(--surface-lowest);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--on-surface);
  outline: none;
  transition: border-color .15s;
}
.opt-add-input:focus { border-color: var(--primary); }
.opt-add-btn {
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-low);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.opt-add-btn:hover { background: #E1F5EE; }
.opt-run-btn {
  width: 100%;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 15px;
  font-family: var(--font-micro);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(0,108,75,0.25);
  transition: opacity .2s, transform .2s;
}
.opt-run-btn:hover { opacity: .9; transform: translateY(-1px); }
.opt-run-btn:disabled { background: var(--outline-variant); box-shadow: none; cursor: not-allowed; transform: none; opacity: 1; }
.opt-note { font-size: 12px; color: var(--text-hint); text-align: center; margin-top: 10px; }
.opt-resultado-card {
  background: var(--surface-lowest);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.opt-card-header { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.opt-card-header.win { background: var(--gradient-primary); }
.opt-card-header.sec { background: #004d35; }
.opt-card-super { font-family: var(--font-sans); font-size: 14px; font-weight: 500; }
.opt-card-subtotal { font-family: var(--font-serif); font-size: 18px; letter-spacing: -0.3px; }
.opt-item-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--surface-low); font-size: 13px; }
.opt-item-row:last-child { border-bottom: none; }
.opt-item-row.alt { background: var(--surface-low); }
.opt-item-alt-name { font-style: italic; color: var(--text-hint); }
.opt-item-alt-hint { font-size: 11px; color: var(--text-hint); margin-top: 2px; }
.opt-item-alt-price { color: var(--text-hint); text-decoration: line-through; flex-shrink: 0; }
.opt-move-btn {
  background: transparent;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-micro);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.opt-move-btn:hover { border-color: var(--primary); color: var(--primary); }
.opt-ir-btn {
  margin: 10px 18px;
  width: calc(100% - 36px);
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px;
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .2s;
}
.opt-ir-btn:hover { opacity: .9; }
.opt-saving-banner {
  background: #E1F5EE;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}
.opt-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--surface-low);
  margin-top: 6px;
}
.opt-total-label { font-size: 13px; color: var(--text-muted); }
.opt-total-val { font-family: var(--font-serif); font-size: 22px; color: var(--on-surface); letter-spacing: -0.3px; }
.opt-mode-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.opt-mode-btn {
  flex: 1; min-width: 130px;
  background: var(--surface-low);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-micro);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.opt-mode-btn.active { border-color: var(--primary); color: var(--primary); background: #E1F5EE; }
.opt-unauthbanner {
  background: #fff8e1; border: 1px solid #ffe082;
  border-radius: var(--radius-md);
  padding: 16px 18px; text-align: center; margin-top: 14px;
}
.opt-unauthbanner p { font-size: 13px; color: #5d4037; margin-bottom: 10px; }
.opt-unauthbanner a {
  display: inline-block;
  background: var(--gradient-primary);
  color: #fff;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
}
.badge-mode { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-pill); font-family: var(--font-micro); }
.badge-mode.free { background: #E1F5EE; color: var(--primary); }
.badge-mode.nuevo { background: var(--secondary-container); color: var(--primary); }
.badge-mode.premium { background: #faeeda; color: #633806; }

/* CTA Optimizador post-resultado */
.opt-cta-post {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: #E1F5EE;
  border-radius: var(--radius-md);
  margin-top: 10px;
  cursor: pointer;
  transition: background .15s;
}
.opt-cta-post:hover { background: #c8f0e8; }
.opt-cta-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.opt-cta-text { flex: 1; }
.opt-cta-title { font-size: 13px; font-weight: 600; color: #085041; }
.opt-cta-sub { font-size: 12px; color: #0F6E56; margin-top: 2px; }
.opt-cta-arrow { font-size: 16px; color: var(--primary); }

/* ── FEEDBACK FAB ────────────────────────────────────────── */
#feedbackFab {
  position: fixed; bottom: 28px; left: 28px; z-index: 200;
  background: var(--surface-lowest);
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-family: var(--font-micro);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-float);
  transition: all .2s;
  display: flex; align-items: center; gap: 8px;
}
#feedbackFab:hover { border-color: var(--primary); color: var(--primary); }

/* Feedback modal */
#feedbackModal {
  display: none;
  position: fixed; inset: 0; z-index: 400;
  background: rgba(27,28,23,0.5);
  align-items: center; justify-content: center;
}
#feedbackModal.open { display: flex; }
.feedback-modal-box {
  background: var(--surface-lowest);
  border-radius: var(--radius);
  padding: 28px;
  width: min(480px, 92vw);
  box-shadow: 0 24px 80px rgba(27,28,23,0.18);
}
.feedback-modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 16px;
}
.feedback-modal-textarea {
  width: 100%;
  border: 1.5px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color .15s;
}
.feedback-modal-textarea:focus { border-color: var(--primary); }
.feedback-modal-actions {
  display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end;
}

/* ── BOTONES GENERALES ───────────────────────────────────── */
.ca-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: var(--radius-pill);
  font-family: var(--font-micro); font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none;
  transition: opacity .2s, transform .15s;
}
.ca-btn:hover { transform: translateY(-1px); }
.ca-btn-primary {
  background: var(--gradient-primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-float);
}
.ca-btn-primary:hover { opacity: .9; }
.ca-btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(0,108,75,0.2);
}
.ca-btn-secondary:hover {
  border-color: rgba(0,108,75,0.4);
  background: rgba(0,108,75,0.04);
}

/* ── AUTOFILL OVERRIDE ───────────────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-lowest) inset;
  -webkit-text-fill-color: var(--on-surface);
}

/* ── RESPONSIVE MOBILE ───────────────────────────────────── */
@media (max-width: 768px) {
  .mode-picker { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .mode-card-hero { order: -1; }
  .ca-layout { grid-template-columns: 1fr; }
  .ca-sidebar { display: none; }
  .ca-main { padding: 20px 16px 100px; }
  .mode-bar { padding: 12px 16px; }
  .search-hero-title { font-size: 26px; }
  .ca-nav-links { display: none; }
}
@media (max-width: 640px) {
  .ca-nav-hide-mobile { display: none; }
}
