/* ==========================================================================
   GUARIP OFFER POPUP (main site, both languages). ROUND 19.
   Loaded from snippets/global_head.liquid after g-base.css. Every colour,
   radius, shadow, duration and easing is a token from g-tokens.css; the
   one memorable element is the row of countdown tiles (brass numerals on
   the deep warm surface), everything else is paper and ink.

   Layers: the backdrop at z 200 sits above the header (100 and 110) and
   below the accessibility widget (9990 and up) and CookieYes (999999),
   verified live on 2026-09-25.

   Motion: one entrance (backdrop fade, card 14px rise with fade), 280ms
   on --g-ease-out; exit 160ms. When GSAP is present the script drives the
   same values on the taylor motion layer and adds is-gsap so these
   transitions stay out of its way. Reduced motion, and the widget's
   motion switch (html.ga11y-no-motion is not a class this site sets; the
   tokens zero --g-dur-base under prefers-reduced-motion), land on the
   final state at once. Backgrounds never animate.
   ========================================================================== */

.g-offer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--g-s5);
  box-sizing: border-box;
}
.g-offer[hidden] { display: none; }
.g-offer *, .g-offer *::before, .g-offer *::after { box-sizing: border-box; }

.g-offer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--g-ink-a55);
  opacity: 0;
  transition: opacity var(--g-dur-base) var(--g-ease-out);
}

.g-offer__card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--g-s6);
  background: var(--g-paper);
  color: var(--g-ink);
  border: 1px solid var(--g-rule);
  border-radius: var(--g-radius-card);
  box-shadow: var(--g-shadow-5);
  font-family: var(--g-font-body-ar);
  text-align: start;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--g-dur-base) var(--g-ease-out), transform var(--g-dur-base) var(--g-ease-out);
}
.g-offer[lang="en"] .g-offer__card { font-family: var(--g-font-body-en); }

.g-offer.is-open .g-offer__backdrop { opacity: 1; }
.g-offer.is-open .g-offer__card { opacity: 1; transform: none; }
.g-offer.is-closing .g-offer__backdrop,
.g-offer.is-closing .g-offer__card { transition-duration: var(--g-dur-fast); }
.g-offer.is-closing .g-offer__backdrop { opacity: 0; }
.g-offer.is-closing .g-offer__card { opacity: 0; transform: translateY(8px); }
/* GSAP owns the values while it runs; the classes above then only hold the end state. */
.g-offer.is-gsap .g-offer__backdrop,
.g-offer.is-gsap .g-offer__card { transition: none; }

.g-offer__x {
  position: absolute;
  top: var(--g-s3);
  inset-inline-end: var(--g-s3);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--g-radius-button);
  background: transparent;
  color: var(--g-ink-a70); /* 5.4:1 on paper; --g-muted measures 4.46:1 */
  cursor: pointer;
  transition: color var(--g-dur-fast) var(--g-ease-out), background-color var(--g-dur-fast) var(--g-ease-out);
}
.g-offer__x:hover { color: var(--g-ink); background: var(--g-ink-a08); }

.g-offer__title {
  margin: 0 0 var(--g-s3);
  padding-inline-end: var(--g-s8);
  font-family: var(--g-font-display-ar);
  font-size: 28px;
  font-weight: 600;
  line-height: var(--g-lh-display);
  letter-spacing: var(--g-ls-display);
  color: var(--g-ink);
}
.g-offer[lang="en"] .g-offer__title { font-family: var(--g-font-display-en); font-size: 34px; font-weight: 600; }

.g-offer__body {
  margin: 0 0 var(--g-s5);
  font-size: 17px;
  font-weight: 400;
  line-height: var(--g-lh-body);
  color: var(--g-ink);
}

.g-offer__ends {
  margin: 0 0 var(--g-s2);
  font-size: 14px;
  font-weight: 600;
  line-height: var(--g-lh-snug);
  color: var(--g-ink-a70); /* 5.4:1 on paper; --g-muted measures 4.46:1 at 14px */
}

.g-offer__cd {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--g-s2);
  margin: 0 0 var(--g-s5);
}
.g-offer__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--g-s3) var(--g-s2);
  border-radius: var(--g-radius-card);
  background: var(--g-deep-warm);
  color: var(--g-brass);
}
.g-offer__num {
  font-family: var(--g-font-label);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: center;
  direction: ltr;
}
.g-offer__cap {
  font-size: 12px;
  font-weight: 500;
  line-height: var(--g-lh-snug);
  color: var(--g-cream-a70);
}

.g-offer__price {
  margin: 0 0 var(--g-s5);
  font-size: 17px;
  font-weight: 600;
  line-height: var(--g-lh-snug);
  color: var(--g-ink);
}
.g-offer__new { font-size: 24px; font-weight: 700; }
.g-offer__instead { margin-inline: var(--g-s1); font-weight: 500; }
.g-offer__old { color: var(--g-ink-a70); font-weight: 500; }

.g-offer__actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: var(--g-s3);
}
.g-offer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 48px;
  white-space: nowrap; /* a label never breaks; the long English primary takes its own full row */
  padding: 12px 20px;
  border-radius: var(--g-radius-button);
  font-size: 15px;
  font-weight: 600;
  line-height: var(--g-lh-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--g-dur-base) var(--g-ease-out),
    color var(--g-dur-base) var(--g-ease-out),
    border-color var(--g-dur-base) var(--g-ease-out),
    box-shadow var(--g-dur-base) var(--g-ease-out);
}
.g-offer__cta--primary {
  background: var(--g-ink);
  color: var(--g-cream-text);
  border: 1px solid var(--g-ink);
  box-shadow: var(--g-shadow-3);
}
.g-offer__cta--primary:hover {
  background: var(--g-deep-warm);
  border-color: var(--g-deep-warm);
  color: var(--g-cream-text);
  box-shadow: var(--g-shadow-4), 0 0 0 1px var(--g-brass-soft);
}
.g-offer__cta--ghost {
  background: transparent;
  color: var(--g-ink);
  border: 1px solid var(--g-brass);
}
.g-offer__cta--ghost:hover {
  background: var(--g-brass);
  border-color: var(--g-brass);
  color: var(--g-ink);
}

.g-offer__dismiss {
  display: block;
  margin: var(--g-s4) auto 0;
  min-height: 44px;
  padding: var(--g-s2) var(--g-s3);
  border: 0;
  border-radius: var(--g-radius-button);
  background: transparent;
  color: var(--g-ink-a70);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--g-dur-fast) var(--g-ease-out);
}
.g-offer__dismiss:hover { color: var(--g-ink); }

/* Phone: a bottom sheet with a safe area, full width buttons, internal scroll so 320px never cuts content. */
@media (max-width: 639px) {
  .g-offer { padding: 0; align-items: end; }
  .g-offer__card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: var(--g-s5) var(--g-s4) calc(var(--g-s5) + env(safe-area-inset-bottom, 0px));
    border-radius: var(--g-r-4) var(--g-r-4) 0 0;
    border-bottom: 0;
    transform: translateY(24px);
  }
  .g-offer.is-closing .g-offer__card { transform: translateY(16px); }
  .g-offer__title { font-size: 24px; padding-inline-end: var(--g-s7); }
  .g-offer[lang="en"] .g-offer__title { font-size: 28px; }
  .g-offer__body { font-size: 16px; }
  .g-offer__num { font-size: 24px; }
  .g-offer__x { top: var(--g-s2); inset-inline-end: var(--g-s2); }
}
@media (min-width: 480px) {
  .g-offer__actions { flex-direction: row; }
}
@media (max-width: 479px) {
  .g-offer__cta { white-space: normal; }
}

/* Reduced motion: the final state at once, in and out. Hover keeps colour only. */
@media (prefers-reduced-motion: reduce) {
  .g-offer__backdrop, .g-offer__card, .g-offer__cta, .g-offer__x, .g-offer__dismiss { transition: none !important; }
  .g-offer__card { transform: none !important; }
}
@media (hover: none) {
  .g-offer__cta--primary:hover { box-shadow: var(--g-shadow-3); }
}
