/* =========================================================
   Buen Fin 2026 — promo modal, floating reopen button and T&C page.
   Reuses the landing tokens (styles.css). Amber stays the only accent;
   a warm red is used ONLY for the "Buen Fin" urgency chip.
   ========================================================= */

:root {
  --bf-red: #c8321f;
}

/* ---------- Modal ---------- */
.bf-modal {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(10, 18, 13, 0.85);
  overflow: hidden;
}
.bf-modal::backdrop {
  background: rgba(13, 24, 17, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.bf-modal[open] { animation: bf-in 0.55s var(--ease) both; }
.bf-modal[open]::backdrop { animation: bf-fade 0.4s ease both; }
@keyframes bf-in { from { opacity: 0; transform: translateY(28px) scale(0.96); } }
@keyframes bf-fade { from { opacity: 0; } }

.bf-scroll {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.bf-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 42px; height: 42px; border-radius: 999px;
  display: grid; place-items: center;
  border: 1px solid rgba(247, 242, 233, 0.35);
  background: rgba(21, 41, 30, 0.55);
  color: var(--cream); font-size: 1.25rem; cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.bf-close:hover { background: rgba(21, 41, 30, 0.9); transform: rotate(90deg); }
.bf-close:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* Hero band of the modal */
.bf-hero {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(224, 161, 46, 0.35), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(42, 77, 57, 0.9), transparent 60%),
    var(--green-900);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}
/* honeycomb texture */
.bf-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.12;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 58%, var(--amber) 60%, transparent 63%);
  background-size: 38px 44px;
  mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
  -webkit-mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
}
.bf-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  background: var(--bf-red); color: #fff;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.bf-chip i { font-size: 1rem; }
.bf-title {
  margin-top: 1rem;
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  color: var(--cream);
  max-width: 15ch;
}
.bf-title em { font-style: italic; color: var(--amber); }
.bf-dates {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  font-size: 1rem; color: rgba(247, 242, 233, 0.85);
}
.bf-dates span { display: inline-flex; align-items: center; gap: 0.4rem; }
.bf-dates i { color: var(--amber); font-size: 1.15rem; }

/* Offer cards */
.bf-offers {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 2vw, 1.25rem);
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem) 0;
}
.bf-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.9rem;
  padding: 0.75rem 0.75rem 1.1rem;
  background: var(--cream);
  border: 1px solid rgba(26, 21, 16, 0.1);
  border-radius: var(--r-card);
  box-shadow: 0 18px 40px -30px rgba(26, 21, 16, 0.6);
}
.bf-card > div, .bf-card > .bf-warning { padding: 0 0.45rem; }
/* Promo flyers (4:5). Never cropped: they carry the legal footer and the Buen Fin badge. */
.bf-flyer {
  position: relative; display: block;
  aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden;
  background: #efe8dc;
  cursor: zoom-in;
}
.bf-flyer img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity 0.9s ease;
}
.bf-flyer:not(.is-rotating) img:first-child, .bf-flyer img.is-on { opacity: 1; }
.bf-flyer:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.bf-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem; line-height: 1.1; font-weight: 600;
}
.bf-card p { font-size: 0.9rem; line-height: 1.5; color: var(--ink-soft); margin-top: 0.35rem; }
.bf-price {
  display: flex; align-items: baseline; gap: 0.35rem; margin-top: 0.6rem;
  font-family: "Zilla Slab", serif; font-weight: 700; color: var(--amber-deep);
}
.bf-price strong { font-size: 2.1rem; line-height: 1; }
.bf-price small { font-family: "Hanken Grotesk", sans-serif; font-weight: 600; font-size: 0.78rem; color: var(--ink-soft); }
.bf-age {
  position: absolute; top: 1.25rem; left: 1.25rem; z-index: 2;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--ink); color: var(--cream);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
}
.bf-warning {
  font-size: 0.74rem !important; font-weight: 700; color: var(--ink) !important;
  margin-top: 0 !important;
}

/* Footer of the modal: how to buy + QR */
.bf-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 1.25rem 2rem; align-items: center;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem);
}
.bf-how { font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); }
.bf-how strong { color: var(--ink); }
.bf-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.bf-actions .btn { font-size: 0.9rem; }
.bf-actions .btn i { font-size: 1.1rem; }
.bf-terms {
  display: inline-block; margin-top: 0.85rem;
  font-size: 0.82rem; font-weight: 600; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.bf-terms:hover { color: var(--amber-deep); }

/* Official QR: white background, unaltered, never below 60px (guide) */
.bf-qr {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  width: 168px; padding: 10px;
  background: #fff; border-radius: 12px;
  border: 1px solid rgba(26, 21, 16, 0.12);
  text-align: center;
}
.bf-qr img { width: 132px; height: 132px; min-width: 60px; min-height: 60px; image-rendering: auto; }
.bf-qr p { font-size: 0.66rem; line-height: 1.35; color: #333; }
.bf-qr a { color: #333; }

/* ---------- Floating reopen button ---------- */
.bf-fab {
  position: fixed; right: clamp(12px, 3vw, 24px); bottom: clamp(12px, 3vw, 24px); z-index: 45;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.75rem 1.15rem 0.75rem 0.85rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--bf-red); color: #fff;
  font: 700 0.9rem/1 "Hanken Grotesk", sans-serif; letter-spacing: 0.02em;
  box-shadow: 0 16px 34px -14px rgba(200, 50, 31, 0.9);
  transition: transform 0.25s var(--ease);
}
.bf-fab i { font-size: 1.25rem; }
.bf-fab:hover { transform: translateY(-3px); }
.bf-fab:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.bf-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(200, 50, 31, 0.6);
  animation: bf-pulse 2.4s ease-out infinite;
}
@keyframes bf-pulse { 70%, 100% { box-shadow: 0 0 0 14px rgba(200, 50, 31, 0); } }
.bf-fab[hidden], .bf-modal[hidden] { display: none; }

/* Footer link to the T&C page */
.footer__legal { font-size: 0.82rem; color: var(--ink-soft); }
.footer__legal a { color: inherit; text-underline-offset: 3px; }
.footer__legal a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .bf-offers { grid-template-columns: 1fr; }
  .bf-foot { grid-template-columns: 1fr; }
  .bf-qr { flex-direction: row; width: 100%; text-align: left; }
  .bf-qr img { width: 96px; height: 96px; flex: none; }
}
@media (max-width: 420px) {
  .bf-actions .btn { flex: 1 1 100%; justify-content: center; }
  .bf-fab span { display: none; }
  .bf-fab { padding: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bf-modal[open], .bf-modal[open]::backdrop, .bf-fab::after { animation: none; }
}

/* =========================================================
   T&C page
   ========================================================= */
.legal {
  max-width: 820px; margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(2rem, 6vw, 4rem)) clamp(1rem, 4vw, 2rem) clamp(3rem, 8vw, 5rem);
}
.legal__head { padding-bottom: 1.75rem; border-bottom: 1px solid rgba(26, 21, 16, 0.12); }
.legal__head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-top: 0.75rem; }
.legal__meta { margin-top: 0.75rem; color: var(--ink-soft); font-size: 0.98rem; }
.legal section { padding-top: 2rem; }
.legal h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 0.75rem; }
.legal h3 { font-size: 1.02rem; margin: 1rem 0 0.25rem; }
.legal p { color: var(--ink-soft); margin-bottom: 0.85rem; }
.legal p strong, .legal li strong { color: var(--ink); }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; color: var(--ink-soft); }
.legal dt { font-weight: 600; color: var(--ink); }
.legal a { color: var(--amber-deep); text-underline-offset: 3px; }
.legal__notice { font-weight: 700; color: var(--ink) !important; }
.legal__qr { margin-top: 2.5rem; display: flex; gap: 1rem; align-items: center; }
.legal__qr .bf-qr { flex-direction: row; width: auto; text-align: left; max-width: 420px; }
.legal__qr .bf-qr img { width: 96px; height: 96px; flex: none; }
@media (max-width: 480px) {
  .legal dl { grid-template-columns: 1fr; }
  .legal dt { margin-top: 0.5rem; }
}
.legal__head--sub { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid rgba(26, 21, 16, 0.12); }
