/* =========================================================================
   EconoPlus — Components
   Reusable, documented UI: buttons, chips, header/nav/drawer, footer,
   announcement bar, coupon cards, logo ticker, modal, toast, forms,
   category tiles, stat counters, empty states.
   BEM-ish naming: .block, .block__element, .block--modifier.
   ========================================================================= */

/* =======================================================================
   Buttons
   ======================================================================= */
.btn {
  --btn-bg: var(--ep-charcoal);
  --btn-fg: var(--ep-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem 1.4rem;
  min-height: 48px;                 /* tap target ≥ 44px */
  font-family: var(--ep-font-ui);
  font-size: var(--ep-fs-body);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--ep-ls-tight);
  color: var(--btn-fg);
  background: var(--btn-bg);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  transition: transform var(--ep-dur) var(--ep-ease),
              box-shadow var(--ep-dur) var(--ep-ease),
              background-color var(--ep-dur) var(--ep-ease),
              color var(--ep-dur) var(--ep-ease);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--ep-shadow); }
.btn:active { transform: translateY(0); }
.btn .btn__icon { width: 1.15em; height: 1.15em; flex: none; }

/* Primary — EconoPlus red */
.btn--primary { --btn-bg: var(--ep-red-ink); --btn-fg: var(--ep-white); box-shadow: var(--ep-shadow-red); }
.btn--primary:hover { --btn-bg: var(--ep-red-hover); }
.btn--primary:active { --btn-bg: var(--ep-red-press); }

/* Secondary — charcoal solid */
.btn--secondary { --btn-bg: var(--ep-charcoal); --btn-fg: var(--ep-white); }
.btn--secondary:hover { --btn-bg: var(--ep-charcoal-2); }

/* Outline — charcoal outline on transparent */
.btn--outline {
  --btn-fg: var(--ep-charcoal);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ep-gray-200);
}
.btn--outline:hover { box-shadow: inset 0 0 0 1.5px var(--ep-charcoal); background: var(--ep-white); }

/* Ghost — minimal text button */
.btn--ghost { --btn-fg: var(--ep-charcoal); background: transparent; box-shadow: none; }
.btn--ghost:hover { background: var(--ep-gray); box-shadow: none; }

/* On dark surfaces */
.btn--on-dark.btn--outline { --btn-fg: var(--ep-white); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn--on-dark.btn--outline:hover { box-shadow: inset 0 0 0 1.5px var(--ep-white); background: rgba(255,255,255,.08); }

.btn--lg { padding: 1rem 1.8rem; min-height: 56px; font-size: 1.05rem; }
.btn--sm { padding: .55rem 1rem; min-height: 40px; font-size: var(--ep-fs-sm); }
.btn--block { display: flex; width: 100%; }
.btn--icon-only { padding: 0; width: 48px; height: 48px; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* =======================================================================
   Chips, tags & badges
   ======================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  font-size: var(--ep-fs-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ep-text-muted);
  background: var(--ep-gray);
  border-radius: var(--ep-radius-pill);
  white-space: nowrap;
}
.chip svg { width: .9em; height: .9em; }
.chip--red { color: var(--ep-red-ink); background: var(--ep-red-soft); }
.chip--cat { color: var(--ep-charcoal); }

/* Discount badge — bold red, the loudest element on a coupon card */
.badge-discount {
  display: inline-flex;
  align-items: center;
  font-family: var(--ep-font-display);
  font-weight: 800;
  font-size: var(--ep-fs-sm);
  letter-spacing: var(--ep-ls-tight);
  color: var(--ep-white);
  background: var(--ep-red-ink);
  padding: .4rem .7rem;
  border-radius: var(--ep-radius-sm);
  box-shadow: var(--ep-shadow-red);
}

/* Small badge ribbon — "2 FOR 1", "NEW" and the like. The example here used to
   read "New this week", which is the cadence the product no longer publishes
   on; a comment is where that wording quietly gets copied back into markup. */
.ribbon {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: var(--ep-fs-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ep-red-ink);
  background: var(--ep-red-soft);
  padding: .4rem .8rem;
  border-radius: var(--ep-radius-pill);
}
.ribbon::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ep-red);
  box-shadow: 0 0 0 0 rgba(255,30,38,.5);
  animation: ep-pulse 2s var(--ep-ease) infinite;
}
@keyframes ep-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,30,38,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(255,30,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,30,38,0); }
}

/* =======================================================================
   Announcement bar
   ======================================================================= */
.announce {
  background: var(--ep-charcoal);
  color: var(--ep-white);
  font-size: var(--ep-fs-sm);
}
.announce__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 40px;
  padding-block: .35rem;
}
.announce__msg { display: flex; align-items: center; gap: .5rem; }
.announce__actions { display: flex; align-items: center; gap: .25rem; }
.announce__link {
  padding: .35rem .7rem;
  border-radius: var(--ep-radius-pill);
  color: rgba(255,255,255,.85);
  font-weight: 500;
  transition: background var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease);
}
.announce__link:hover { background: rgba(255,255,255,.12); color: var(--ep-white); }
.announce__sep { width: 1px; height: 18px; background: rgba(255,255,255,.18); }
@media (max-width: 768px) {
  .announce__msg { font-size: var(--ep-fs-xs); }
  .announce__hide-sm { display: none; }
}

/* Language toggle (shared header + announce) */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: var(--ep-radius-pill);
  overflow: hidden;
  background: rgba(255,255,255,.1);
  font-size: var(--ep-fs-xs);
  font-weight: 700;
}
.lang-toggle__btn {
  padding: .3rem .6rem;
  color: rgba(255,255,255,.7);
  letter-spacing: .04em;
  transition: background var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease);
}
.lang-toggle__btn[aria-current="true"] { background: var(--ep-red-ink); color: var(--ep-white); }
.lang-toggle__btn:hover { color: var(--ep-white); }
/* Light variant used inside the white header */
.lang-toggle--light { background: var(--ep-gray); }
.lang-toggle--light .lang-toggle__btn { color: var(--ep-text-muted); }
.lang-toggle--light .lang-toggle__btn[aria-current="true"] { background: var(--ep-charcoal); color: var(--ep-white); }
.lang-toggle--light .lang-toggle__btn:hover { color: var(--ep-charcoal); }

/* =======================================================================
   Header & primary navigation
   ======================================================================= */
/* See partials.js: this wrapper must not form a containing block, or the
   sticky header inside it stops sticking once the wrapper scrolls away. */
.site-chrome { display: contents; }

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--ep-z-sticky);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ep-dur) var(--ep-ease), box-shadow var(--ep-dur) var(--ep-ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--ep-border);
  box-shadow: var(--ep-shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--ep-header-h);
}
.site-header__logo { flex: none; display: inline-flex; align-items: center; transition: transform var(--ep-dur) var(--ep-ease); }
.site-header__logo:hover { transform: scale(1.03); }
.site-header__logo img { height: 42px; width: auto; }
@media (max-width: 600px) { .site-header__logo img { height: 36px; } }

.site-nav { display: none; }          /* hidden on mobile, shown ≥1024 */
.site-nav__list { display: flex; align-items: center; gap: .25rem; list-style: none; }
.site-nav__link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: .55rem .8rem;
  border-radius: var(--ep-radius-sm);
  font-size: var(--ep-fs-sm);
  font-weight: 600;
  color: var(--ep-charcoal);
  transition: background var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease);
}
.site-nav__link:hover { background: var(--ep-gray); }
.site-nav__link[aria-current="page"] { color: var(--ep-red); }

/* Header search */
.header-search {
  display: none;
  align-items: center;
  gap: .5rem;
  flex: 1 1 auto;
  max-width: 320px;
  margin-inline: auto;
  padding: .5rem .9rem;
  background: var(--ep-gray);
  border-radius: var(--ep-radius-pill);
  color: var(--ep-text-muted);
  transition: box-shadow var(--ep-dur) var(--ep-ease), background var(--ep-dur) var(--ep-ease);
}
.header-search:focus-within { background: var(--ep-white); box-shadow: var(--ep-shadow-sm), inset 0 0 0 1.5px var(--ep-border); }
.header-search svg { width: 18px; height: 18px; flex: none; }
/* Deliberately no outline suppression. This selector outscores the site's own
   :focus-visible rule, so an `outline: 0` here left keyboard users with no
   focus indicator at all on the only search field on the page. */
.header-search input {
  border: 0;
  background: transparent;
  width: 100%;
  /* 16px, not --ep-fs-sm. Safari on iOS and iPadOS zooms the whole page when a
     text field smaller than 16px receives focus, and it does not zoom back
     out — so tapping search left the visitor on a magnified, sideways-
     scrolling page they had to pinch their way out of. */
  font-size: 16px;
  color: var(--ep-charcoal);
}

.site-header__actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Reserve chrome height before partials.js injects (limits layout shift) */
[data-partial="header"] { display: block; min-height: 118px; }

/* Tame the header action cluster on small screens (drawer carries the rest) */
.site-header .lang-toggle--light { display: none; }
.site-header__cta { display: none; }
@media (min-width: 600px) { .site-header__cta { display: inline-flex; } }
@media (min-width: 1024px) { .site-header .lang-toggle--light { display: inline-flex; } }

/* Saved heart button + count badge */
.saved-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--ep-radius-sm); color: var(--ep-charcoal); transition: background var(--ep-dur) var(--ep-ease); }
.saved-btn:hover { background: var(--ep-gray); }
.saved-btn svg { width: 22px; height: 22px; }
.saved-btn__count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--ep-white); background: var(--ep-red-ink);
  border-radius: var(--ep-radius-pill);
  border: 2px solid var(--ep-white);
}
.saved-btn__count[hidden] { display: none; }

/* Hamburger */
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--ep-radius-sm); }
.nav-toggle:hover { background: var(--ep-gray); }
.nav-toggle svg { width: 24px; height: 24px; }

@media (min-width: 1024px) {
  .site-nav { display: block; }
  .header-search { display: flex; }
  .nav-toggle { display: none; }
}

/* =======================================================================
   Mobile drawer
   ======================================================================= */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,31,35,.4);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--ep-dur) var(--ep-ease), visibility var(--ep-dur);
  z-index: var(--ep-z-drawer);
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--ep-white);
  z-index: calc(var(--ep-z-drawer) + 1);
  /* Closed is a transform only, so the panel is off-screen but every control
     inside it stays in the tab order — fourteen invisible stops on a page
     already marked aria-hidden. `visibility: hidden` removes them, and
     transitions alongside the transform so the slide still animates. */
  visibility: hidden;
  transform: translateX(100%);
  transition: transform var(--ep-dur-slow) var(--ep-ease),
              visibility var(--ep-dur-slow) var(--ep-ease);
  display: flex; flex-direction: column;
  box-shadow: var(--ep-shadow-lg);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem var(--ep-gutter); border-bottom: 1px solid var(--ep-border); }
.drawer__head img { height: 26px; }
.drawer__close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ep-radius-sm); }
.drawer__close:hover { background: var(--ep-gray); }
.drawer__close svg { width: 22px; height: 22px; }
.drawer__body { padding: 1rem var(--ep-gutter) 2rem; display: flex; flex-direction: column; gap: .25rem; }
.drawer__link { display: flex; align-items: center; gap: .75rem; padding: .9rem .75rem; border-radius: var(--ep-radius-sm); font-weight: 600; font-size: 1.05rem; transition: background var(--ep-dur) var(--ep-ease); }
.drawer__link:hover { background: var(--ep-gray); }
.drawer__link svg { width: 20px; height: 20px; color: var(--ep-text-muted); }
.drawer__link[aria-current="page"] { color: var(--ep-red); }
.drawer__divider { height: 1px; background: var(--ep-border); margin: .75rem 0; }
.drawer__search { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; background: var(--ep-gray); border-radius: var(--ep-radius); margin-bottom: .75rem; }
.drawer__search svg { width: 18px; height: 18px; color: var(--ep-text-muted); }
/* Same reasoning as .header-search input above: no outline suppression. */
.drawer__search input { border: 0; background: transparent; width: 100%; }
.drawer__cta { margin-top: 1rem; display: grid; gap: .6rem; }
.drawer__lang { margin-top: 1.25rem; display: flex; align-items: center; justify-content: space-between; }

body.ep-no-scroll { overflow: hidden; }

/* =======================================================================
   Logo ticker / partner marquee  (pure-CSS infinite scroll)
   ======================================================================= */
.ticker {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track {
  display: flex;
  width: max-content;
  gap: 1rem;
  animation: ep-marquee 40s linear infinite;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track { animation-play-state: paused; }
@keyframes ep-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* track is duplicated, so -50% loops seamlessly */
}
.ticker__item {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 64px;
  padding: 0 1.25rem;
  background: var(--ep-white);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  font-weight: 700;
  color: var(--ep-charcoal);
  letter-spacing: var(--ep-ls-tight);
  white-space: nowrap;
}
.ticker__item .ticker__mark {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--ep-gray);
  color: var(--ep-red-ink);
  font-family: var(--ep-font-display);
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; flex-wrap: wrap; justify-content: center; width: 100%; }
}

/* =======================================================================
   Coupon card  (the workhorse component)
   ======================================================================= */
.coupon-grid {
  display: grid;
  gap: var(--ep-gutter);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.coupon {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ep-white);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow);
  overflow: hidden;
  transition: transform var(--ep-dur) var(--ep-ease), box-shadow var(--ep-dur) var(--ep-ease);
}
.coupon:hover { transform: translateY(-4px); box-shadow: var(--ep-shadow-lg); }

.coupon__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--ep-gray), #fff);
  overflow: hidden;
}
.coupon__media img { width: 100%; height: 100%; object-fit: cover; }
.coupon__badge { position: absolute; top: .75rem; left: .75rem; }
.coupon__save {
  position: absolute; top: .6rem; right: .6rem;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  box-shadow: var(--ep-shadow-sm);
  color: var(--ep-charcoal);
  transition: transform var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease), background var(--ep-dur) var(--ep-ease);
}
.coupon__save svg { width: 20px; height: 20px; }
.coupon__save:hover { transform: scale(1.08); }
.coupon__save[aria-pressed="true"] { color: var(--ep-red-ink); }
.coupon__save[aria-pressed="true"] svg { fill: var(--ep-red); }

.coupon__body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1rem 0; flex: 1 1 auto; }

.coupon__merchant { display: flex; align-items: center; gap: .55rem; }
.coupon__logo {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px;
  background: var(--ep-gray);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ep-font-display); font-weight: 800; font-size: .9rem;
  color: var(--ep-charcoal);
  overflow: hidden;
}
.coupon__logo img { width: 100%; height: 100%; object-fit: cover; }
.coupon__merchant-name { font-size: var(--ep-fs-sm); font-weight: 600; color: var(--ep-text-muted); }
.coupon__verified { width: 15px; height: 15px; color: var(--ep-red-ink); flex: none; }

.coupon__title { font-family: var(--ep-font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.25; letter-spacing: var(--ep-ls-tight); }
.coupon__desc { font-size: var(--ep-fs-sm); color: var(--ep-text-muted); line-height: 1.5; }

.coupon__chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .25rem; }

.coupon__foot {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .85rem 1rem 1rem;
  margin-top: .75rem;
  border-top: 1px dashed var(--ep-border);
}
.coupon__expiry { font-size: var(--ep-fs-xs); color: var(--ep-text-muted); display: inline-flex; align-items: center; gap: .3rem; }
.coupon__expiry svg { width: 13px; height: 13px; }

/* perforated edge accent like a real coupon */
.coupon__foot { position: relative; }
.coupon__foot::before,
.coupon__foot::after {
  content: ""; position: absolute; top: -7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ep-bg-alt);
}
.ep-section:not(.ep-section--alt) .coupon__foot::before,
.ep-section:not(.ep-section--alt) .coupon__foot::after { background: var(--ep-white); }
.coupon__foot::before { left: -7px; box-shadow: inset -2px 0 0 var(--ep-border); }
.coupon__foot::after  { right: -7px; box-shadow: inset 2px 0 0 var(--ep-border); }

/* Tab bar for "Top Offers / Hot Deals / Nearby" */
.tabs { display: inline-flex; gap: .25rem; padding: .3rem; background: var(--ep-gray); border-radius: var(--ep-radius-pill); }
.tabs__btn {
  padding: .55rem 1.1rem;
  border-radius: var(--ep-radius-pill);
  font-size: var(--ep-fs-sm); font-weight: 600; color: var(--ep-text-muted);
  transition: background var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease), box-shadow var(--ep-dur) var(--ep-ease);
}
.tabs__btn[aria-selected="true"] { background: var(--ep-white); color: var(--ep-charcoal); box-shadow: var(--ep-shadow-sm); }

/* =======================================================================
   Category tile
   ======================================================================= */
.cat-grid {
  display: grid;
  gap: var(--ep-gutter);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px){ .cat-grid { grid-template-columns: repeat(8, 1fr); } }

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: 1.25rem .75rem;
  background: var(--ep-white);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  text-align: center;
  transition: transform var(--ep-dur) var(--ep-ease), box-shadow var(--ep-dur) var(--ep-ease);
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--ep-shadow); }
.cat-tile__icon {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--ep-gray);
  color: var(--ep-charcoal);
  transition: background var(--ep-dur) var(--ep-ease), color var(--ep-dur) var(--ep-ease);
}
.cat-tile__icon svg { width: 24px; height: 24px; }
.cat-tile:hover .cat-tile__icon { background: var(--ep-red-soft); color: var(--ep-red-ink); }
.cat-tile__label { font-size: var(--ep-fs-sm); font-weight: 600; line-height: 1.2; }
.cat-tile__count { font-size: var(--ep-fs-xs); color: var(--ep-text-muted); }

/* =======================================================================
   Stat counter band
   ======================================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--ep-gutter);
}
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat__num {
  font-family: var(--ep-font-display);
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: var(--ep-ls-display);
  line-height: 1;
  color: var(--ep-white);
}
.stat__num .stat__prefix { color: var(--ep-red-ink); }
.stat__label { margin-top: .5rem; font-size: var(--ep-fs-sm); color: rgba(255,255,255,.7); }

/* =======================================================================
   Modal (coupon redemption / iOS install instructions)
   ======================================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 1.25rem;
  background: rgba(31,31,35,.5);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--ep-dur) var(--ep-ease), visibility var(--ep-dur);
  z-index: var(--ep-z-modal);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  width: min(440px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  background: var(--ep-white);
  border-radius: var(--ep-radius-lg);
  box-shadow: var(--ep-shadow-lg);
  transform: translateY(16px) scale(.98);
  transition: transform var(--ep-dur-slow) var(--ep-ease);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 0; }
.modal__close { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ep-radius-sm); color: var(--ep-text-muted); }
.modal__close:hover { background: var(--ep-gray); color: var(--ep-charcoal); }
.modal__close svg { width: 20px; height: 20px; }
.modal__body { padding: 1rem 1.25rem 1.5rem; }

/* Redemption modal specifics */
.redeem { text-align: center; }
.redeem__merchant { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ep-text-muted); margin-bottom: .25rem; }
.redeem__title { font-family: var(--ep-font-display); font-size: 1.3rem; font-weight: 800; margin-bottom: 1rem; }
.redeem__qr {
  width: 220px; max-width: 70%; aspect-ratio: 1; margin: 0 auto 1rem;
  padding: 14px; background: var(--ep-white);
  border-radius: var(--ep-radius); box-shadow: var(--ep-shadow);
}
.redeem__qr svg { width: 100%; height: 100%; }
.redeem__code {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ep-font-display); font-weight: 800; letter-spacing: .12em;
  font-size: 1.1rem;
  padding: .6rem 1rem; margin-bottom: 1rem;
  background: var(--ep-gray); border-radius: var(--ep-radius);
}
.redeem__hint { font-size: var(--ep-fs-sm); color: var(--ep-text-muted); margin-bottom: 1.25rem; }
.redeem__meta { display: flex; align-items: center; justify-content: center; gap: 1rem; font-size: var(--ep-fs-xs); color: var(--ep-text-muted); margin-top: 1rem; }

/* =======================================================================
   Toast
   ======================================================================= */
.toast-wrap {
  position: fixed; left: 50%; bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: var(--ep-z-toast);
  display: flex; flex-direction: column; gap: .5rem;
  width: min(92vw, 380px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1rem;
  background: var(--ep-charcoal);
  color: var(--ep-white);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-lg);
  font-size: var(--ep-fs-sm); font-weight: 500;
  transform: translateY(20px); opacity: 0;
  transition: transform var(--ep-dur) var(--ep-ease), opacity var(--ep-dur) var(--ep-ease);
}
.toast.is-visible { transform: none; opacity: 1; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--ep-red-ink); }
.toast__action { margin-left: auto; color: var(--ep-white); font-weight: 700; text-decoration: underline; pointer-events: auto; }

/* =======================================================================
   PWA install banner + iOS instruction steps
   ======================================================================= */
.install-banner {
  position: fixed;
  left: 50%; bottom: 1rem;
  transform: translate(-50%, 130%);
  z-index: var(--ep-z-toast);
  display: flex; align-items: center; gap: .85rem;
  width: min(94vw, 460px);
  padding: .85rem 1rem;
  background: var(--ep-white);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-lg);
  transition: transform var(--ep-dur-slow) var(--ep-ease);
}
.install-banner.is-visible { transform: translateX(-50%); }
.install-banner__mark {
  width: 42px; height: 42px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: var(--ep-red-ink); color: #fff;
  font-family: var(--ep-font-display); font-weight: 800; font-size: 1.3rem;
}
.install-banner__copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.install-banner__copy b { font-size: var(--ep-fs-sm); }
.install-banner__copy small { color: var(--ep-text-muted); font-size: var(--ep-fs-xs); }
.install-banner__close { width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ep-radius-sm); color: var(--ep-text-muted); }
.install-banner__close:hover { background: var(--ep-gray); }
.install-banner__close svg { width: 18px; height: 18px; }

.install-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .85rem; }
.install-steps li { display: flex; align-items: flex-start; gap: .75rem; line-height: 1.45; }
.install-steps li svg { width: 18px; height: 18px; display: inline; vertical-align: -3px; color: var(--ep-red-ink); }
.install-steps__n {
  flex: none; width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ep-red-soft); color: var(--ep-red-ink);
  font-weight: 800; font-size: var(--ep-fs-sm);
}

/* =======================================================================
   Forms
   ======================================================================= */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field__label { font-size: var(--ep-fs-sm); font-weight: 600; }
.input {
  width: 100%;
  padding: .85rem 1rem;
  min-height: 48px;
  background: var(--ep-white);
  border: 1.5px solid var(--ep-border);
  border-radius: var(--ep-radius);
  font-size: var(--ep-fs-body);
  transition: border-color var(--ep-dur) var(--ep-ease), box-shadow var(--ep-dur) var(--ep-ease);
}
.input:focus { outline: 0; border-color: var(--ep-charcoal); box-shadow: 0 0 0 3px rgba(31,31,35,.08); }
.input::placeholder { color: var(--ep-text-muted); }

/* Inline newsletter form */
.subscribe {
  display: flex; gap: .6rem; flex-wrap: wrap;
}
.subscribe .input { flex: 1 1 240px; }
.checkbox { display: flex; align-items: flex-start; gap: .6rem; font-size: var(--ep-fs-sm); color: var(--ep-text-muted); }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ep-red-ink); flex: none; }

/* =======================================================================
   Empty states
   ======================================================================= */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .75rem; padding: clamp(2rem, 5vw, 4rem) 1rem;
  max-width: 28rem; margin-inline: auto;
}
.empty__icon {
  width: 72px; height: 72px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 20px; background: var(--ep-red-soft); color: var(--ep-red-ink);
}
.empty__icon svg { width: 34px; height: 34px; }
.empty h3 { font-size: 1.25rem; }
.empty p { color: var(--ep-text-muted); }

/* =======================================================================
   Footer
   ======================================================================= */
.site-footer { background: var(--ep-charcoal); color: rgba(255,255,255,.72); }
.site-footer a { color: rgba(255,255,255,.72); transition: color var(--ep-dur) var(--ep-ease); }
.site-footer a:hover { color: var(--ep-white); }
.site-footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  padding-block: clamp(3rem, 5vw, 5rem);
}
/* Brand block plus five link columns. The wide track was one column short of
   what the footer emits once Programs joined it, so the last column dropped to
   a second row on its own and the footer looked broken at exactly the width
   where it is most visible. Count the <nav>s in partials.js before changing. */
@media (min-width: 680px) { .site-footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 1024px){ .site-footer__top { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr; } }
.site-footer__brand img { height: 30px; filter: brightness(0) invert(1); margin-bottom: 1rem; }
/* Footer wordmark lockup (white on dark, red "$" — mirrors the brand mark) */
.footer-wordmark {
  display: inline-block; margin-bottom: 1rem;
  font-family: var(--ep-font-display); font-weight: 800;
  font-size: 1.6rem; letter-spacing: var(--ep-ls-display);
  color: var(--ep-white); line-height: 1;
}
.footer-wordmark span { color: var(--ep-white); }
.footer-wordmark__d { color: var(--ep-red-ink); }
.footer-wordmark__tld { color: rgba(255,255,255,.5); font-size: .7em; font-weight: 700; }
.footer-wordmark:hover { color: var(--ep-white); }
.site-footer__tagline { font-size: var(--ep-fs-sm); max-width: 24rem; margin-bottom: 1.25rem; }
.footer-col__title { color: var(--ep-white); font-size: var(--ep-fs-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col__list { display: flex; flex-direction: column; gap: .65rem; list-style: none; font-size: var(--ep-fs-sm); }
.footer-hoods { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.footer-hoods a { font-size: var(--ep-fs-xs); padding: .35rem .7rem; background: rgba(255,255,255,.06); border-radius: var(--ep-radius-pill); }
.footer-hoods a:hover { background: rgba(255,255,255,.14); }
.social-row { display: flex; gap: .5rem; margin-top: 1.25rem; }
.social-row a { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ep-radius-sm); background: rgba(255,255,255,.07); }
.social-row a:hover { background: var(--ep-red); }
.social-row svg { width: 18px; height: 18px; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: var(--ep-fs-xs);
}
.site-footer__bottom-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* An offer card whose photo did not load. The badge and the type carry it;
   a broken-image glyph on a card selling a real business does not. */
.coupon__media--noimg {
  background:
    linear-gradient(135deg, var(--ep-gray, #F5F5F7) 0%, #ECECEF 100%);
  min-height: 150px;
}

/* ---- Ticker: real merchant logos -------------------------------------------
   The rail used to show initials in a red monogram. These are eighteen real
   businesses with real marks, and a wall of monograms says "placeholder" to
   exactly the merchants we are asking to pay us.

   Each logo gets its own white plate and is contained rather than cropped:
   the files are a mix of wide wordmarks, square badges, dark marks and
   white-on-transparent ones, so anything that crops or assumes a background
   loses half of them. */
.ticker__logo {
  width: 88px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ep-white);
  border-radius: 8px;
  flex: none;
}
.ticker__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
/* The rail shows logos and nothing else — a logo carries the recognition on
   its own, and eighteen names scrolling past is a list, not a marquee.
   It already worked this way on a phone; now it does at every width.

   The name stays in the DOM and is hidden the accessible way rather than with
   `display: none`. Each tile is a link wrapping a decorative image, so
   removing the text outright would leave a link with no accessible name —
   a screen reader would announce eighteen anonymous "link"s in a row. Clipped
   like this it is announced and never drawn. */
.ticker__name {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .ticker__item { padding: 0 .9rem; }
}

/* =========================================================================
   Coupon cards as coupons — the code stub, the fine print, a second offer
   on the same card, and the business's contact line. Added when the site
   stopped linking into the app and started showing the offer itself.
   ========================================================================= */
.coupon__media img { aspect-ratio: 2 / 1; }
.coupon__media { aspect-ratio: 2 / 1; }
.coupon__merchant-name { line-height: 1.35; }
.coupon__merchant-sub { font-weight: 500; color: var(--ep-muted-dark); }
.coupon__price {
  font-family: var(--ep-font-display); font-size: 1.55rem; font-weight: 800;
  letter-spacing: var(--ep-ls-tight); line-height: 1.1; color: var(--ep-charcoal);
}
.coupon__price--from { font-size: 1.15rem; }
.coupon__price-note { font-family: var(--ep-font-ui); font-size: var(--ep-fs-sm); font-weight: 600; color: var(--ep-text-muted); margin-left: .35rem; }
.coupon__code {
  display: flex; flex-direction: column; gap: .15rem;
  margin-top: .35rem; padding: .7rem 1rem;
  background: var(--ep-gray);
  border: 2px dashed var(--ep-charcoal);
  border-radius: var(--ep-radius-sm);
  width: fit-content; max-width: 100%;
}
.coupon__code-label { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ep-text-muted); }
.coupon__code-value { font-family: var(--ep-font-display); font-size: 1.45rem; font-weight: 800; letter-spacing: .08em; color: var(--ep-charcoal); }
.coupon__note { font-size: var(--ep-fs-sm); font-weight: 600; color: var(--ep-charcoal); line-height: 1.45; }
.coupon__fine { font-size: var(--ep-fs-xs); color: var(--ep-text-muted); line-height: 1.45; }
.coupon__list, .coupon__checks { list-style: none; margin: 0; padding: 0; font-size: var(--ep-fs-sm); }
.coupon__list li { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--ep-border); }
.coupon__list li:first-child { border-top: 0; }
.coupon__list strong { white-space: nowrap; color: var(--ep-charcoal); }
.coupon__list small { font-weight: 500; color: var(--ep-text-muted); }
.coupon__checks li { position: relative; padding: .2rem 0 .2rem 1.05rem; color: var(--ep-text-muted); line-height: 1.45; }
.coupon__checks li::before { content: "•"; position: absolute; left: 0; color: var(--ep-red); font-weight: 800; }
.coupon__second { margin-top: .75rem; padding-top: .85rem; border-top: 1px solid var(--ep-border); display: flex; flex-direction: column; gap: .5rem; }
.coupon__chips--cat { margin-top: .25rem; }
.coupon__contact { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; font-size: var(--ep-fs-sm); color: var(--ep-text-muted); }
.coupon__contact a, .coupon__contact span { display: inline-flex; align-items: center; gap: .4rem; }
.coupon__contact a { color: var(--ep-charcoal); font-weight: 600; }
.coupon__contact a:hover { color: var(--ep-red-ink); }
.coupon__contact svg { width: 14px; height: 14px; flex: none; color: var(--ep-text-muted); }
/* A deep-linked card (offers#m-id) is scrolled to; a loud outline read as an error, so it is not marked further. */

/* Newsletter sign-up form — the home page block and the sign-up page share it. */
.signup-form { display: grid; gap: .75rem; max-width: 520px; }
.signup-form__row { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .signup-form__row { grid-template-columns: 1fr 1fr; } }
.signup-form label { display: grid; gap: .3rem; font-size: var(--ep-fs-sm); font-weight: 600; color: var(--ep-charcoal); }
.signup-form input[type="text"], .signup-form input[type="email"], .signup-form select {
  width: 100%; padding: .8rem 1rem; font: inherit; font-size: 1rem;
  border: 1.5px solid var(--ep-border); border-radius: var(--ep-radius-sm); background: var(--ep-white);
}
.signup-form input:focus, .signup-form select:focus { outline: 2px solid var(--ep-red); outline-offset: 1px; border-color: transparent; }
.signup-form__consent { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--ep-fs-sm); font-weight: 500; color: var(--ep-text-muted); line-height: 1.5; }
.signup-form__consent input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--ep-red); flex: none; }
.signup-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup-form__note { font-size: var(--ep-fs-xs); color: var(--ep-text-muted); line-height: 1.5; }
.notice { padding: 1rem 1.25rem; border-radius: var(--ep-radius-sm); font-weight: 600; line-height: 1.5; }
.notice--ok { background: #EAF7EE; color: #1E6B3A; border: 1px solid #BFE3CB; }
.notice--bad { background: var(--ep-red-soft); color: var(--ep-red-press); border: 1px solid #F5B5B8; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---- Footer sign-up strip --------------------------------------------------
   The same form as /signup, on every page, so a reader who scrolled to the end
   never has to go looking for it. Dark surface, light fields. */
.site-footer__signup {
  display: grid; gap: 1.25rem 3rem; align-items: start;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
@media (min-width: 860px) { .site-footer__signup { grid-template-columns: 1fr 1.2fr; } }
.site-footer__signup-copy p { font-size: var(--ep-fs-sm); max-width: 26rem; }
.signup-form--footer { max-width: 560px; }
.signup-form--footer .signup-form__inline { display: flex; gap: .6rem; flex-wrap: wrap; }
.signup-form--footer .signup-form__inline label { flex: 1 1 220px; }
.signup-form--footer input[type="email"] {
  width: 100%; padding: .75rem .95rem; border-radius: var(--ep-radius-sm);
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--ep-white);
  font: inherit; font-size: var(--ep-fs-sm);
}
.signup-form--footer input[type="email"]::placeholder { color: rgba(255,255,255,.45); }
.signup-form--footer input[type="email"]:focus { outline: 2px solid var(--ep-red); outline-offset: 1px; background: rgba(255,255,255,.12); }
.signup-form--footer .signup-form__consent { color: rgba(255,255,255,.6); font-size: var(--ep-fs-xs); }
.site-footer .notice { margin-bottom: .75rem; }
