/* ==========================================================================
   MAXOFERTAS — Portal público
   Dirección visual: editorial / papel cálido, tinta negra, amarillo MeLi plano.
   Sin glows, sin glassmorphism, sin gradientes decorativos.
   Mobile-first: estilos base = celular, media queries hacia arriba.
   ========================================================================== */

:root,
html[data-theme="dark"] {
  /* Superficies Dark Mode (Obsidian & Slate Profundo - Default) */
  --paper: #0b0f17;
  --paper-2: #121927;
  --card: #131b2e;
  --card-hover: #19243d;
  --ink: #f8fafc;
  --ink-2: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Marca */
  --yellow: #ffe600;
  --yellow-deep: #ffd000;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.16);
  --blue: #38bdf8;

  /* Tipografía */
  --f-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Formas */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 14px 34px -4px rgba(0, 0, 0, 0.65);

  --header-h: 60px;
}

html[data-theme="light"] {
  /* Superficies Light Mode */
  --paper: #f4f2ec;
  --paper-2: #ebe8df;
  --card: #ffffff;
  --card-hover: #faf9f6;
  --ink: #111111;
  --ink-2: #2a2a28;
  --muted: #5f5d57;
  --dim: #8d8a82;
  --line: #e2dfd5;
  --line-strong: #cfcbbf;

  /* Marca */
  --yellow: #ffe600;
  --yellow-deep: #f5d400;
  --green: #00a650;
  --green-soft: #e3f5ea;
  --blue: #3483fa;

  --shadow-card: 0 1px 0 rgba(17, 17, 17, 0.04), 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-lift: 0 10px 24px -12px rgba(17, 17, 17, 0.25);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 56px); -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg, i[data-lucide] { flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.25s ease, border-color 0.25s ease;
}
html[data-theme="dark"] .site-header {
  background: rgba(11, 15, 23, 0.90);
}
html[data-theme="light"] .site-header {
  background: rgba(244, 242, 236, 0.92);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 0.75rem;
}

.brand-link { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }

.brand-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: var(--yellow); color: #111111;
  border-radius: 9px;
  font-family: var(--f-display); font-weight: 900; font-size: 1.15rem;
  letter-spacing: -0.04em;
  box-shadow: 0 2px 8px rgba(255, 230, 0, 0.45);
}

.brand-info { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-title { font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand-subtitle { display: none; font-size: 0.72rem; color: var(--muted); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

/* Botón Toggle de Tema (Claro / Oscuro) */
.btn-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; min-width: 36px; padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.btn-theme-toggle:hover {
  transform: translateY(-1px) scale(1.05);
  border-color: var(--yellow);
  box-shadow: 0 4px 12px rgba(255, 230, 0, 0.3);
}
html[data-theme="dark"] .btn-theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .btn-theme-toggle .icon-sun { display: block; color: #ffe600; }
html[data-theme="light"] .btn-theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .btn-theme-toggle .icon-moon { display: block; color: #334155; }

.btn-social-nav {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  width: 36px; height: 36px; min-width: 36px; padding: 0;
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-social-nav span { display: none; }

/* Instagram Botón Header */
#headerInstagramBtn {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}
html[data-theme="dark"] #headerInstagramBtn {
  background: rgba(225, 48, 108, 0.16);
  color: #f472b6;
  border-color: rgba(225, 48, 108, 0.35);
}
#headerInstagramBtn:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border-color: #dc2743;
  box-shadow: 0 4px 14px rgba(225, 48, 108, 0.4);
  transform: translateY(-1px);
}

/* Telegram Botón Header */
#headerTelegramBtn {
  background: #e8f5fd;
  color: #0088cc;
  border: 1px solid #bde2f9;
}
html[data-theme="dark"] #headerTelegramBtn {
  background: rgba(0, 136, 204, 0.16);
  color: #38bdf8;
  border-color: rgba(0, 136, 204, 0.35);
}
#headerTelegramBtn:hover {
  background: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
  transform: translateY(-1px);
}

/* WhatsApp Botón Header */
#headerWhatsappBtn {
  background: #eafaf1;
  color: #0c803e;
  border: 1px solid #b7eed0;
}
html[data-theme="dark"] #headerWhatsappBtn {
  background: rgba(37, 211, 102, 0.16);
  color: #4ade80;
  border-color: rgba(37, 211, 102, 0.35);
}
#headerWhatsappBtn:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}

/* X (Twitter) Botón Header */
#headerXBtn {
  background: #18181b;
  color: #ffffff;
  border: 1px solid #27272a;
}
html[data-theme="dark"] #headerXBtn {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
}
#headerXBtn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero-section { padding: 1.75rem 0 0.5rem; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.76rem; font-weight: 600; color: #00703a;
  background: #e3f5ea; border: 1px solid #c2eccd;
  padding: 0.22rem 0.65rem; border-radius: 999px;
  margin-bottom: 0.9rem;
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #00a650; box-shadow: 0 0 0 2px rgba(0, 166, 80, 0.25); }

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 8.5vw, 4.1rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-bottom: 1rem;
  max-width: 14ch;
}

.hero-title .hl {
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%);
  padding: 0 0.05em;
}

.hero-subtitle {
  font-size: 1rem; color: var(--muted);
  max-width: 52ch; margin-bottom: 1.4rem;
}

/* Buscador */
.search-container { max-width: 640px; }

.search-bar-wrapper {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
  padding: 0 0.4rem 0 0.9rem;
  height: 52px;
  transition: box-shadow 0.15s;
}
.search-bar-wrapper:focus-within { box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.45), 3px 3px 0 var(--ink); }

.search-icon { display: flex; color: var(--muted); }

.search-input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: var(--f-body);
  font-size: 16px; /* evita zoom automático en iOS */
  color: var(--ink);
}
.search-input::placeholder { color: var(--dim); }

.search-clear-btn {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: var(--paper); cursor: pointer;
}
.search-clear-btn:hover { background: var(--paper-2); }

/* Datos rápidos bajo el buscador */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.65rem;
  margin-top: 1rem;
  font-size: 0.8rem; color: var(--muted);
}
.hero-stats span {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--card); padding: 0.26rem 0.65rem;
  border-radius: 999px; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
#heroCouponCount { color: #b45309; font-weight: 800; }
#heroRefCount { color: #059669; font-weight: 800; }
#heroListCount { color: #2563eb; font-weight: 800; }

/* ==========================================================================
   FILTROS (Pills responsivas con identidad de color y sin scroll horizontal)
   ========================================================================== */
.filter-pills-wrapper {
  position: sticky; top: var(--header-h); z-index: 50;
  background: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 0.65rem calc(50vw - 50% + 1rem);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: background 0.25s ease, border-color 0.25s ease;
}
html[data-theme="dark"] .filter-pills-wrapper {
  background: rgba(11, 15, 23, 0.94);
}
html[data-theme="light"] .filter-pills-wrapper {
  background: rgba(244, 242, 236, 0.95);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  height: auto;
  padding: 0.4rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.pill-btn i {
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}
.pill-btn[data-filter="all"] i { color: #475569; }
.pill-btn[data-filter="coupons"] i { color: #b45309; }
.pill-btn[data-filter="transport"] i { color: #0284c7; }
.pill-btn[data-filter="referrals"] i { color: #059669; }
.pill-btn[data-filter="lists"] i { color: #7c3aed; }

.pill-btn:hover {
  background: var(--paper-2);
  border-color: var(--ink);
  color: var(--ink);
}

.pill-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
  box-shadow: 0 2px 6px rgba(17, 17, 17, 0.15);
}
.pill-btn.active i {
  color: var(--yellow);
}

.pill-btn[data-filter="coupons"].active {
  background: #fef08a;
  color: #713f12;
  border-color: #eab308;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}
.pill-btn[data-filter="coupons"].active i {
  color: #713f12;
}
.pill-btn[data-filter="coupons"].active .pill-count {
  background: rgba(113, 63, 18, 0.12);
  color: #713f12;
}

.pill-btn[data-filter="transport"].active .pill-count,
.pill-btn[data-filter="referrals"].active .pill-count,
.pill-btn[data-filter="lists"].active .pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.pill-btn[data-filter="transport"].active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.pill-btn[data-filter="transport"].active i {
  color: #ffffff;
}

.pill-btn[data-filter="referrals"].active {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}
.pill-btn[data-filter="referrals"].active i {
  color: #ffffff;
}

.pill-btn[data-filter="lists"].active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.pill-btn[data-filter="lists"].active i {
  color: #ffffff;
}

.pill-count {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.18);
  color: var(--yellow);
}

/* ==========================================================================
   SECCIONES
   ========================================================================== */
.section-block { margin-bottom: 3rem; }

.section-head {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.section-title-wrap { display: flex; flex-direction: column; gap: 0.3rem; }

.section-index {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  width: fit-content;
  display: inline-block;
}
#sec-coupons .section-index { background: #fef08a; color: #713f12; border: 1px solid #fde047; }
#sec-transport .section-index { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
#sec-referrals .section-index { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
#sec-lists .section-index { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

.section-title {
  font-family: var(--f-display);
  font-size: clamp(1.45rem, 5.5vw, 2rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.05;
}

.section-desc { font-size: 0.92rem; color: var(--muted); max-width: 60ch; }

.section-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  align-self: flex-start;
  font-size: 0.86rem; font-weight: 600;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 1px;
}
.section-link:hover { color: var(--muted); border-color: var(--muted); }

/* ==========================================================================
   GRILLAS Y TARJETA BASE
   ========================================================================== */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; }

.portal-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

@media (hover: hover) {
  .portal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
}

/* ==========================================================================
   CUPÓN TIPO TICKET
   ========================================================================== */
.coupon-card { padding: 0; overflow: hidden; }

.coupon-top {
  background: var(--yellow);
  padding: 1rem 1.1rem 1.15rem;
}

.coupon-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-size: 0.74rem; font-weight: 600; color: rgba(17,17,17,0.7);
  margin-bottom: 0.4rem;
}

.coupon-store { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink); }

.coupon-discount {
  font-family: var(--f-display);
  font-size: clamp(2rem, 9vw, 2.5rem);
  font-weight: 800; letter-spacing: -0.045em; line-height: 1;
  color: var(--ink);
}

.coupon-perf {
  position: relative; height: 0;
  border-top: 2px dashed var(--line-strong);
  margin: 0 14px;
}
.coupon-perf::before, .coupon-perf::after {
  content: ''; position: absolute; top: -11px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
}
.coupon-perf::before { left: -25px; }
.coupon-perf::after { right: -25px; }

.coupon-body { display: flex; flex-direction: column; gap: 0.85rem; padding: 1rem 1.1rem 1.1rem; flex: 1; }

.coupon-conditions { font-size: 0.86rem; color: var(--muted); line-height: 1.45; }

.coupon-voucher-box {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  min-height: 52px;
}

.coupon-voucher-details { display: flex; flex-direction: column; min-width: 0; }

.voucher-label {
  font-size: 0.64rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim);
}

.coupon-code-text {
  font-family: var(--f-mono); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.04em;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.btn-copy-coupon {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  height: 42px; padding: 0 1rem;
  background: var(--ink); color: #fff;
  border: 0; border-radius: 9px;
  font-size: 0.84rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-copy-coupon:hover { background: #00703a; color: #fff; }
.btn-copy-coupon:active { transform: scale(0.97); }
.btn-copy-coupon.copied { background: var(--green) !important; color: #fff !important; }

.btn-open-store {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 46px; width: 100%;
  border: 1.5px solid var(--ink); border-radius: var(--r-md);
  background: transparent;
  font-size: 0.9rem; font-weight: 700;
  transition: all 0.15s ease;
}
.btn-open-store:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: #ffd000;
  box-shadow: 0 4px 12px rgba(255, 230, 0, 0.4);
}

/* ==========================================================================
   TARJETAS DE MARCA (Transporte y Cuentas)
   ========================================================================== */
.ref-brand-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }

.brand-tile {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 11px;
  font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.04em;
  flex-shrink: 0;
}
.brand-tile.is-light { box-shadow: inset 0 0 0 1px var(--line-strong); }

.ref-meta { flex: 1; min-width: 0; }
.ref-meta h3 { font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.ref-category { font-size: 0.76rem; color: var(--dim); }

.ref-highlight-badge, .transport-card-badge {
  display: inline-block;
  font-size: 0.74rem; font-weight: 600;
  color: #00703a; background: var(--green-soft);
  padding: 0.22rem 0.55rem; border-radius: 999px;
  margin-bottom: 0.6rem; align-self: flex-start;
}

.transport-discount-tag {
  font-family: var(--f-display); font-size: 1.9rem; font-weight: 800;
  letter-spacing: -0.045em; line-height: 1; margin-bottom: 0.35rem;
}

.transport-highlight-text { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.35rem; }

.ref-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.9rem; }

.transport-promos-box { border-top: 1px solid var(--line); padding-top: 0.8rem; margin-bottom: 0.9rem; }

.transport-promos-title {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 0.5rem;
}

.transport-promos-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }

.transport-promo-item {
  position: relative; padding-left: 1rem;
  font-size: 0.85rem; color: var(--ink-2); line-height: 1.42;
}
.transport-promo-item::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 6px; height: 2px; background: var(--ink);
}

.ref-card-spacer { flex: 1; }

.ref-card-footer { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.25rem; }

.btn-ref-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 46px; width: 100%;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md);
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.15s ease;
}
.btn-ref-primary:hover {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}
.btn-ref-primary i { transition: transform 0.15s; }
.btn-ref-primary:hover i { transform: translateX(3px); }

/* ==========================================================================
   LISTAS DE PRODUCTOS (MERCADO LIBRE)
   ========================================================================== */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.15rem;
  width: 100%;
}

@media (max-width: 600px) {
  .lists-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

.list-item-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.15rem;
  min-height: 165px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.list-item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #ffe600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.list-item-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 230, 0, 0.85);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 230, 0, 0.25);
  background: #ffffff;
}

.list-item-card:hover::before {
  opacity: 1;
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.list-item-emoji-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 230, 0, 0.16);
  border: 1px solid rgba(255, 230, 0, 0.35);
  font-size: 1.4rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
  flex-shrink: 0;
}

.list-item-card:hover .list-item-emoji-tile {
  transform: scale(1.12) rotate(3deg);
  background: rgba(255, 230, 0, 0.32);
}

.list-item-badge {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #856404;
  background: #fff3cd;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(133, 100, 4, 0.18);
}

.list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.list-item-title {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.list-item-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.list-item-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0284c7;
  transition: color 0.15s ease;
}

.list-item-card:hover .list-item-action {
  color: #0369a1;
}

.list-item-arrow {
  color: #0284c7;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}

.list-item-card:hover .list-item-arrow {
  transform: translate(3px, -3px);
  color: #0369a1;
}

@media (max-width: 600px) {
  .list-item-card {
    padding: 0.85rem;
    min-height: 140px;
  }
  .list-item-emoji-tile {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
  .list-item-title {
    font-size: 0.95rem;
  }
  .list-item-desc {
    font-size: 0.74rem;
  }
  .list-item-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }
}

/* ==========================================================================
   PROMOS DEL DÍA
   ========================================================================== */
.today-promo-banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  margin-bottom: 2.5rem;
}

.today-promo-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted);
  margin-bottom: 0.4rem;
}

.today-promo-title {
  font-family: var(--f-display); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.today-promo-text {
  font-size: 0.9rem; color: var(--ink-2); white-space: pre-line; line-height: 1.6;
  max-height: 260px; overflow-y: auto; padding-right: 0.4rem;
}

/* ==========================================================================
   CTA COMUNIDAD
   ========================================================================== */
.community-cta-card {
  background: linear-gradient(135deg, #090d16 0%, #151d30 50%, #0c1527 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  padding: 2.25rem 1.5rem;
  box-shadow: 0 16px 36px -12px rgba(10, 16, 30, 0.5);
  position: relative;
  overflow: hidden;
}

.community-cta-card h2 {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 6.5vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.02;
  margin-bottom: 0.75rem; max-width: 18ch;
}
.community-cta-card h2 em { font-style: normal; color: var(--yellow); }

.community-cta-card p { color: rgba(255,255,255,0.72); font-size: 0.95rem; max-width: 52ch; margin-bottom: 1.4rem; }

.community-buttons-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.btn-community-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  height: 54px; padding: 0 1.25rem;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 0.95rem;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.btn-community-item .lead { display: inline-flex; align-items: center; gap: 0.75rem; }
.btn-community-item .tail { opacity: 0.75; transition: transform 0.15s, opacity 0.15s; }
.btn-community-item:hover .tail { opacity: 1; transform: translateX(4px); }

#footerWhatsappCtaBtn {
  background: #25d366;
  color: #ffffff;
  border: 1px solid #20ba5a;
}
#footerWhatsappCtaBtn:hover {
  background: #1eb857;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45);
}

#footerTelegramCtaBtn {
  background: #0088cc;
  color: #ffffff;
  border: 1px solid #0099e6;
}
#footerTelegramCtaBtn:hover {
  background: #0077b3;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.45);
}

#footerXCtaBtn {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
#footerXCtaBtn:hover {
  background: #18181b;
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom));
  margin-top: 1rem;
  font-size: 0.82rem; color: var(--muted);
}

.footer-inner { display: flex; flex-direction: column; gap: 1.1rem; }

.footer-brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em; }
.footer-brand .brand-mark { width: 28px; height: 28px; font-size: 0.9rem; border-radius: 7px; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; font-weight: 500; color: var(--ink-2); }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.footer-admin-link { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--dim); font-size: 0.76rem; }
.footer-admin-link:hover { color: var(--ink); }

/* ==========================================================================
   TOAST Y ESTADOS VACÍOS
   ========================================================================== */
.toast-msg {
  position: fixed; left: 1rem; right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--ink); color: #fff;
  font-size: 0.88rem; font-weight: 500;
  padding: 0.85rem 1.1rem; border-radius: var(--r-md);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.45);
  transform: translateY(140%); opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s;
  pointer-events: none;
}
.toast-msg.show { transform: translateY(0); opacity: 1; }
.toast-msg strong { font-family: var(--f-mono); color: var(--yellow); }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted); font-size: 0.9rem;
}
.no-results-icon { margin-bottom: 0.5rem; color: var(--dim); }

/* ==========================================================================
   BREAKPOINTS
   ========================================================================== */
@media (min-width: 560px) {
  .container { padding: 0 1.5rem; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lists-grid { grid-template-columns: repeat(3, 1fr); }
  .community-buttons-grid { flex-direction: row; flex-wrap: wrap; }
  .btn-community-item { flex: 1 1 200px; }
  .toast-msg { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 380px; }
}

@media (min-width: 768px) {
  :root { --header-h: 68px; }
  body { font-size: 16px; }
  .brand-subtitle { display: block; }
  .btn-social-nav { width: auto; min-width: 40px; padding: 0 0.9rem; }
  .btn-social-nav span { display: inline; }
  .hero-section { padding: 3.5rem 0 0.5rem; }
  .section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .section-link { align-self: auto; white-space: nowrap; }
  .portal-card { padding: 1.35rem; }
  .coupon-card { padding: 0; }
  .coupon-top { padding: 1.15rem 1.35rem 1.3rem; }
  .coupon-body { padding: 1.1rem 1.35rem 1.35rem; }
  .community-cta-card { padding: 3rem; display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: end; }
  .community-cta-card p { margin-bottom: 0; }
  .community-buttons-grid { flex-direction: column; }
  .btn-community-item { flex: none; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; }
  .section-block { margin-bottom: 4rem; }
}

@media (min-width: 1000px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
  .lists-grid { grid-template-columns: repeat(4, 1fr); }
  .filter-pills { gap: 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   TEMA OSCURO - REFINAMIENTOS Y CONTRASTE (DEFAULT)
   ========================================================================== */

/* Transiciones suaves entre temas */
body, .portal-card, .site-header, .pill-btn, .search-bar-wrapper, .list-item-card, .btn-theme-toggle, .btn-copy-coupon, .btn-open-store, .btn-ref-primary {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

html[data-theme="dark"] .hero-eyebrow {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

html[data-theme="dark"] .hero-title .hl {
  background: none;
  color: #ffe600;
  text-shadow: 0 0 32px rgba(255, 230, 0, 0.35);
  padding: 0;
}

html[data-theme="dark"] .search-bar-wrapper {
  background: var(--card);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
html[data-theme="dark"] .search-bar-wrapper:focus-within {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .search-clear-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
html[data-theme="dark"] .search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .filter-pills-wrapper {
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .pill-btn {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink-2);
}
html[data-theme="dark"] .pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
html[data-theme="dark"] .pill-btn.active {
  background: #f8fafc;
  color: #0b0f17;
  border-color: #f8fafc;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.18);
}
html[data-theme="dark"] .pill-btn.active i {
  color: #0b0f17;
}

html[data-theme="dark"] .pill-btn[data-filter="coupons"].active {
  background: #ffe600;
  color: #111111;
  border-color: #ffe600;
  box-shadow: 0 2px 12px rgba(255, 230, 0, 0.45);
}
html[data-theme="dark"] .pill-btn[data-filter="coupons"].active i {
  color: #111111;
}
html[data-theme="dark"] .pill-btn[data-filter="coupons"].active .pill-count {
  background: rgba(0, 0, 0, 0.14);
  color: #111111;
}

html[data-theme="dark"] .pill-btn[data-filter="lists"].active {
  background: #a855f7;
  color: #ffffff;
  border-color: #a855f7;
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.45);
}

html[data-theme="dark"] .pill-btn[data-filter="transport"].active {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.45);
}

html[data-theme="dark"] .pill-btn[data-filter="referrals"].active {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.45);
}

/* Índices de Sección */
html[data-theme="dark"] #sec-coupons .section-index {
  background: rgba(254, 240, 138, 0.12);
  color: #fef08a;
  border: 1px solid rgba(254, 240, 138, 0.28);
}
html[data-theme="dark"] #sec-lists .section-index {
  background: rgba(243, 232, 255, 0.12);
  color: #e9d5ff;
  border: 1px solid rgba(243, 232, 255, 0.28);
}
html[data-theme="dark"] #sec-transport .section-index {
  background: rgba(224, 242, 254, 0.12);
  color: #bae6fd;
  border: 1px solid rgba(224, 242, 254, 0.28);
}
html[data-theme="dark"] #sec-referrals .section-index {
  background: rgba(220, 252, 231, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(220, 252, 231, 0.28);
}

/* Cupones */
html[data-theme="dark"] .coupon-top {
  background: #ffe600;
  color: #111111;
}
html[data-theme="dark"] .coupon-discount {
  color: #111111;
}
html[data-theme="dark"] .coupon-meta {
  color: rgba(17, 17, 17, 0.82);
}
html[data-theme="dark"] .coupon-store {
  color: #111111;
}
html[data-theme="dark"] .coupon-voucher-box {
  background: rgba(11, 15, 23, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .btn-copy-coupon {
  background: #ffe600;
  color: #111111;
  font-weight: 700;
}
html[data-theme="dark"] .btn-copy-coupon:hover {
  background: #ffd000;
  box-shadow: 0 4px 14px rgba(255, 230, 0, 0.35);
}
html[data-theme="dark"] .btn-open-store {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}
html[data-theme="dark"] .btn-open-store:hover {
  background: #ffe600;
  color: #111111;
  border-color: #ffe600;
  box-shadow: 0 4px 14px rgba(255, 230, 0, 0.4);
}

/* Cupones en Light Theme (Garantía de alto contraste y legibilidad) */
html[data-theme="light"] .coupon-top {
  background: #fde047;
  color: #111111;
}
html[data-theme="light"] .coupon-discount {
  color: #111111;
}
html[data-theme="light"] .coupon-meta {
  color: #713f12;
}
html[data-theme="light"] .coupon-store {
  color: #111111;
  font-weight: 700;
}
html[data-theme="light"] .coupon-voucher-box {
  background: #ffffff;
  border-color: var(--line);
}
html[data-theme="light"] .voucher-label {
  color: #5f5d57;
}
html[data-theme="light"] .coupon-code-text {
  color: #111111;
}
html[data-theme="light"] .coupon-conditions {
  color: #2a2a28;
}
html[data-theme="light"] .btn-open-store {
  border-color: var(--ink);
  color: var(--ink);
}
html[data-theme="light"] .btn-open-store:hover {
  background: var(--ink);
  color: #ffffff;
}

/* Listas */
html[data-theme="dark"] .list-item-card {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .list-item-card:hover {
  background: #19243a;
  border-color: rgba(255, 230, 0, 0.85);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 230, 0, 0.25);
}
html[data-theme="dark"] .list-item-badge {
  background: rgba(255, 230, 0, 0.14);
  color: #fef08a;
  border-color: rgba(255, 230, 0, 0.25);
}
html[data-theme="dark"] .list-item-action {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
}
html[data-theme="dark"] .list-item-card:hover .list-item-action {
  color: #7dd3fc;
}
html[data-theme="dark"] .list-item-arrow {
  color: #38bdf8;
}

/* Transporte y Referidos */
html[data-theme="dark"] .transport-card-badge,
html[data-theme="dark"] .ref-highlight-badge {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
html[data-theme="dark"] .transport-promo-item::before {
  background: #38bdf8;
}
html[data-theme="dark"] .btn-ref-primary {
  background: #0284c7;
  color: #ffffff;
}
html[data-theme="dark"] .btn-ref-primary:hover {
  background: #0369a1;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
}

/* Footer */
html[data-theme="dark"] .site-footer {
  background: #07090e;
  border-top-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .footer-admin-link {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--dim);
}
html[data-theme="dark"] .footer-admin-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Toast */
html[data-theme="dark"] .toast-msg {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   SECCIÓN 02: CALENDARIO DE DESCUENTOS POR DÍA
   ========================================================================== */
.calendar-days-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.25rem;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.calendar-days-wrapper::-webkit-scrollbar {
  display: none;
}

.calendar-days-bar {
  display: flex;
  gap: 8px;
  min-width: max-content;
}
@media (min-width: 820px) {
  .calendar-days-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: auto;
    gap: 10px;
  }
}

.calendar-day-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-width: 105px;
  box-shadow: var(--shadow-card);
  position: relative;
}
@media (min-width: 820px) {
  .calendar-day-btn {
    min-width: auto;
    padding: 12px 14px;
  }
}

.calendar-day-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--card-hover);
}

.calendar-day-btn.active {
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
html[data-theme="dark"] .calendar-day-btn.active {
  border: 2px solid var(--yellow);
  background: #162035;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.calendar-day-btn.is-today {
  border-color: var(--yellow-deep);
}

.day-btn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2px;
}

.day-short {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.day-full {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.day-promos-count {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 6px;
  display: inline-block;
}
.calendar-day-btn.active .day-promos-count {
  color: var(--ink-2);
  font-weight: 600;
}

.calendar-today-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--yellow);
  color: #111111;
  text-transform: uppercase;
}

/* Categorías del Calendario */
.calendar-categories-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.75rem;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.calendar-categories-wrapper::-webkit-scrollbar {
  display: none;
}

.calendar-category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
@media (min-width: 900px) {
  .calendar-category-pills {
    flex-wrap: wrap;
  }
}

.calendar-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.calendar-cat-btn:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
  color: var(--ink);
}

.calendar-cat-btn .cat-count {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  transition: all 0.15s ease;
}

.calendar-cat-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.calendar-cat-btn.active .cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

html[data-theme="dark"] .calendar-cat-btn.active {
  background: var(--yellow);
  color: #111111;
  border-color: var(--yellow);
}
html[data-theme="dark"] .calendar-cat-btn.active .cat-count {
  background: rgba(0, 0, 0, 0.18);
  color: #111111;
}

/* Tarjetas de Promoción del Calendario */
.calendar-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
@media (min-width: 620px) {
  .calendar-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
  }
}
@media (min-width: 920px) {
  .calendar-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.calendar-promo-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.calendar-promo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}

.cal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
  width: 100%;
}

.cal-bank-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.cal-bank-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.cal-bank-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  min-width: 0;
}

.cal-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.cal-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cal-discount-badge {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--yellow);
  color: #111111;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-cal-maximize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cal-maximize:hover {
  background: var(--card-hover);
  color: var(--ink);
  border-color: var(--line-strong);
  transform: scale(1.05);
}

.cal-card-body {
  min-width: 0;
  width: 100%;
}

.cal-store-title {
  font-family: var(--f-display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
  word-break: break-word;
}

/* Descripción de la Promo y Modo Expandible */
.cal-desc-wrapper {
  margin-bottom: 12px;
}

.cal-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
}
html[data-theme="dark"] .cal-desc {
  color: #94a3b8;
}

.cal-desc.is-collapsed {
  max-height: 82px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 45%, rgba(0, 0, 0, 0) 100%);
}

.cal-desc.is-expanded {
  max-height: 3500px;
  overflow: visible;
  transition: max-height 0.3s ease-in-out;
  -webkit-mask-image: none;
  mask-image: none;
}

.cal-desc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-cal-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(255, 230, 0, 0.12);
  color: #ffd000;
  border: 1px solid rgba(255, 230, 0, 0.28);
}
html[data-theme="light"] .btn-cal-expand {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.btn-cal-expand:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-cal-maximize-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cal-maximize-text:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-2);
}

.cal-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-width: 0;
  max-width: 100%;
}

.cal-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-family: var(--f-mono);
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.cal-meta-pill span {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}
html[data-theme="dark"] .cal-meta-pill {
  background: #0f1624;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.cal-card-spacer {
  flex-grow: 1;
  min-height: 10px;
}

.cal-card-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.btn-cal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-cal-link:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
}

html[data-theme="dark"] .btn-cal-link {
  background: #172238;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}
html[data-theme="dark"] .btn-cal-link:hover {
  background: #1e2c47;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-reset-cal-filter {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn-reset-cal-filter:hover {
  opacity: 0.9;
}
html[data-theme="dark"] .btn-reset-cal-filter {
  background: var(--yellow);
  color: #111111;
}

/* Modal de Detalle de Promo del Calendario */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: calModalFadeIn 0.2s ease-out;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@keyframes calModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cal-modal-dialog {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: calModalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
  position: relative;
}

@keyframes calModalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.cal-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}

.cal-modal-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.cal-modal-bank {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.35;
}

.cal-modal-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-modal-close:hover {
  background: var(--card-hover);
  color: var(--ink);
  border-color: var(--line-strong);
}

.cal-modal-body {
  padding: 1.35rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-width: 0;
}

.cal-modal-title {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cal-modal-content {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 1.25rem;
  background: var(--paper);
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cal-modal-content strong {
  color: var(--ink);
  font-weight: 700;
}
.cal-inline-link {
  color: var(--yellow, #f59e0b);
  text-decoration: underline;
  word-break: break-all;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.cal-inline-link:hover {
  filter: brightness(1.2);
}

.cal-modal-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 520px) {
  .cal-modal-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cal-modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-width: 0;
  box-sizing: border-box;
}

.cal-modal-meta-item .meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cal-modal-meta-item .meta-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--f-mono);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.cal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  box-sizing: border-box;
}

.btn-cal-modal-secondary {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-cal-modal-secondary:hover {
  background: var(--card-hover);
  color: var(--ink);
}

.btn-cal-modal-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  background: var(--yellow);
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-cal-modal-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Optimización Específica para Móvil */
@media (max-width: 600px) {
  .calendar-promo-card {
    padding: 1rem 0.95rem;
    border-radius: 12px;
  }
  .cal-card-top {
    gap: 8px;
    margin-bottom: 8px;
  }
  .cal-bank-name {
    font-size: 0.86rem;
  }
  .cal-discount-badge {
    font-size: 0.92rem;
    padding: 3px 7px;
  }
  .cal-store-title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: 6px;
  }
  .cal-desc {
    font-size: 0.84rem;
    line-height: 1.5;
  }
  .cal-meta-badges {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .cal-meta-pill {
    font-size: 0.74rem;
    padding: 5px 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .cal-modal-overlay {
    padding: 0.5rem;
    align-items: center;
  }
  .cal-modal-dialog {
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 14px;
    width: 100%;
    margin: auto;
  }
  .cal-modal-header {
    padding: 0.85rem 1rem;
    gap: 10px;
  }
  .cal-modal-badges {
    gap: 6px;
  }
  .cal-modal-bank {
    font-size: 0.86rem;
    line-height: 1.3;
  }
  .cal-modal-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .cal-modal-body {
    padding: 1rem;
  }
  .cal-modal-title {
    font-size: 1.12rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
  }
  .cal-modal-content {
    font-size: 0.86rem;
    line-height: 1.6;
    padding: 0.85rem 0.95rem;
    margin-bottom: 1rem;
  }
  .cal-modal-footer {
    padding: 0.75rem 1rem;
    gap: 8px;
    flex-direction: row;
  }
  .btn-cal-modal-secondary,
  .btn-cal-modal-primary {
    flex: 1 1 0;
    padding: 9px 12px;
    font-size: 0.82rem;
    justify-content: center;
    text-align: center;
  }
}


