@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@400;500;600;700;800&display=swap');

/* Keep the handoff typography available when a browser, CSP, or network
 * blocks Google Fonts. These are the same font files bundled by the design
 * export; Arabic glyphs continue to use the platform's native fallback. */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pixel/press-start-2p-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/pixel/plus-jakarta-sans-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/pixel/sora-latin.woff2') format('woff2');
}

/* Begad pixel-art campaign heroes.
 * The art is rendered on a small logical canvas and scaled up so every edge
 * keeps the crisp, deliberately pixelated treatment from the design handoff.
 */
.begad-pixel-hero {
  --begad-ink: #17100d;
  --begad-orange: #ff6a11;
  --begad-cream: #fff8f0;
  --begad-muted: #6b6157;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: clamp(1rem, 2vw, 2rem) auto 0;
  border: 1px solid rgba(255, 106, 17, .2);
  border-radius: .35rem;
  background: var(--begad-cream);
  box-shadow: 0 1.5rem 4rem rgba(36, 23, 14, .13);
}

/* home-pixel.php includes the existing CMS-driven home below the new hero so
 * product rails and settings keep working. Only its old hero is redundant. */
.b19-homepage:has([data-begad-pixel-hero]) section:has(.home-five-hero-slider) {
  display: none !important;
}

.begad-pixel-sponsored {
  position: relative;
  display: flex;
  min-height: 4.5rem;
  overflow: hidden;
  margin-top: 1rem;
  border: 1px solid #3a2c23;
  border-radius: .35rem;
  color: #fff8f0;
  background: #1c1714;
  box-shadow: 0 .75rem 2rem rgba(28, 23, 20, .12);
  font: 600 .76rem/1.2 'Press Start 2P', monospace;
}

.begad-pixel-sponsored__lights {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.begad-pixel-sponsored__label,
.begad-pixel-sponsored__action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .7rem;
  padding: 0 1.25rem;
  color: #1c1714;
  background: linear-gradient(135deg, #ffb020 0%, #ff6a11 48%, #f62d0c 100%);
  font: 700 .66rem/1 'Press Start 2P', monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.begad-pixel-sponsored__label span:first-child {
  animation: begad-pixel-blink 1.2s steps(1, end) infinite;
}

.begad-pixel-sponsored__viewport {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  overflow: hidden;
}

.begad-pixel-sponsored__crawl {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 2.75rem;
  padding: 0 2.75rem;
  white-space: nowrap;
  animation: begad-pixel-crawl 105s linear infinite;
}

.begad-pixel-sponsored__crawl span {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}

.begad-pixel-sponsored__crawl a {
  color: inherit;
  text-decoration: none;
}

.begad-pixel-sponsored__crawl a:hover {
  color: #ffb020;
}

.begad-pixel-sponsored__crawl i {
  color: #ff8a2b;
  font-style: normal;
}

.begad-pixel-sponsored .sponsor {
  padding: .45rem .5rem .32rem;
  color: #1c1714;
  font-size: .55rem;
}

.sponsor--amber { background: #ffb020; }
.sponsor--green { background: #1fa463; }
.sponsor--red { color: #fff8f0 !important; background: #f62d0c; }
.sponsor--peach { background: #ffc79a; }

.begad-pixel-sponsored__action {
  color: #ffc79a;
  background: rgba(28, 23, 20, .76);
  text-decoration: none;
  text-transform: none;
}

.begad-pixel-sponsored__action span {
  display: inline-grid;
  width: 1.45rem;
  height: 1.35rem;
  place-items: center;
  color: #1c1714;
  background: #fff8f0;
}

@keyframes begad-pixel-crawl {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes begad-pixel-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .25; }
}

.begad-pixel-hero__stage {
  position: relative;
  min-height: clamp(16rem, 29.17vw, 26.25rem);
  aspect-ratio: 24 / 7;
  overflow: hidden;
  background: #2a1108;
}

/* Each canvas slide must occupy the stage, otherwise its intrinsic 360x105
   height wins on phones and leaves the enlarged hero with an empty lower
   half. */
.begad-pixel-hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.begad-pixel-hero__stage::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
}

.begad-pixel-hero__stage::before {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(180deg, rgba(28, 23, 20, .1) 0 1px, rgba(28, 23, 20, 0) 1px 4px);
}

.begad-pixel-hero[data-slide="flash"] .begad-pixel-hero__stage::after {
  background: linear-gradient(90deg, rgba(26, 10, 4, .78) 0%, rgba(26, 10, 4, .4) 38%, rgba(26, 10, 4, 0) 64%);
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__stage::after,
.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__stage::after,
.begad-pixel-hero[data-slide^="category-"] .begad-pixel-hero__stage::after {
  background: linear-gradient(90deg, rgba(255, 248, 240, .9) 0%, rgba(255, 248, 240, .6) 42%, rgba(255, 248, 240, 0) 72%);
}

.begad-pixel-hero__canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.begad-pixel-hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 2;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2rem;
  padding: clamp(1.5rem, 3.6vw, 3.25rem) clamp(1.25rem, 4.2vw, 3.75rem);
  pointer-events: none;
}

.begad-pixel-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  height: auto;
  max-width: min(52rem, 65%);
  color: var(--begad-cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
}

.begad-pixel-hero__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.6rem;
}

.begad-pixel-hero__brand img {
  display: block;
  width: auto;
  height: 2.1rem;
  object-fit: contain;
}

.begad-pixel-hero__brand .begad-pixel-hero__mark {
  height: 2.5rem;
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__copy,
.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__copy,
.begad-pixel-hero[data-slide^="category-"] .begad-pixel-hero__copy {
  color: var(--begad-ink);
  text-shadow: none;
  justify-content: center;
  gap: 1.1rem;
}

.begad-pixel-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  margin: 0 0 .75rem;
  padding: .25rem .7rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 700 .68rem/1.2 'Press Start 2P', monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.begad-pixel-hero[data-slide="flash"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #ffb020;
  background: transparent;
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #1c1714;
  background: #1fa463;
}

.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #c24400;
  background: transparent;
}

/* Category-spotlight family accent colors -- each family's eyebrow badge
   and CTA hard-shadow pick up its own PALETTE.stripeA color from
   begad-pixel-heroes.js, so the banner reads as "this family" at a glance
   while sharing the same light copy/title/description treatment as the
   homepage's electronics/delivery slides above. */
.begad-pixel-hero[data-slide="category-generic"] .begad-pixel-hero__eyebrow,
.begad-pixel-hero[data-slide="category-electronics"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #c24400;
  background: transparent;
}

.begad-pixel-hero[data-slide="category-fashion"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #1c1714;
  background: #f6b8d6;
}

.begad-pixel-hero[data-slide="category-home"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #1c1714;
  background: #9fd6a6;
}

.begad-pixel-hero[data-slide="category-beauty"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #fff8f0;
  background: #d6663f;
}

.begad-pixel-hero[data-slide="category-grocery"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #1c1714;
  background: #a8d96b;
}

.begad-pixel-hero[data-slide="category-automotive"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #fff8f0;
  background: #495057;
}

.begad-pixel-hero[data-slide="category-pet"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #1c1714;
  background: #d9ae72;
}

.begad-pixel-hero[data-slide="category-sports"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #fff8f0;
  background: #2e6fd6;
}

.begad-pixel-hero[data-slide="category-marketplace"] .begad-pixel-hero__eyebrow {
  border: 0;
  color: #fff8f0;
  background: #7b3fe4;
}

.begad-pixel-hero[data-slide="category-marketplace"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #5a26b0;
}

.begad-pixel-hero[data-slide="category-fashion"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #c21e5c;
}

.begad-pixel-hero[data-slide="category-home"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #1d6b3b;
}

.begad-pixel-hero[data-slide="category-beauty"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #b8442a;
}

.begad-pixel-hero[data-slide="category-grocery"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #4c7d21;
}

.begad-pixel-hero[data-slide="category-automotive"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #2b3237;
}

.begad-pixel-hero[data-slide="category-pet"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #8a5a24;
}

.begad-pixel-hero[data-slide="category-sports"] .begad-pixel-hero__cta {
  box-shadow: 5px 5px 0 #1f4e9e;
}

.begad-pixel-hero__title {
  max-width: 19ch;
  margin: 0;
  font: 700 clamp(1.35rem, 2.4vw, 2.125rem)/1.45 'Press Start 2P', monospace;
  letter-spacing: -.05em;
}

.begad-pixel-hero__title [data-pixel-locale="en"] {
  text-transform: uppercase;
}

.begad-pixel-hero[data-slide="flash"] .begad-pixel-hero__title {
  color: #fff8f0 !important;
  text-shadow: 4px 4px 0 #762b08;
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__title,
.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__title,
.begad-pixel-hero[data-slide^="category-"] .begad-pixel-hero__title {
  color: #1c1714 !important;
  text-shadow: 4px 4px 0 #ffc79a;
}

/* Brand-spotlight hero (category_view.php, ?brand_id=...): the real admin-
   uploaded brand logo sits in its own white badge for contrast against any
   family's colored scrim -- same "pixel-frame the container, keep real
   uploads" rule already applied to Offer Banners/CTA tiles and payment
   method icons -- next to the brand name, which reuses the same title
   styling every other hero slide already has. */
.begad-pixel-hero__brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}

.begad-pixel-hero__brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  padding: .5rem;
  border-radius: .35rem;
  background: #fff8f0;
  border: 2px dashed rgba(176, 135, 91, .5);
  box-shadow: 4px 4px 0 rgba(23, 19, 17, .18);
}

.begad-pixel-hero__brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.begad-pixel-hero__brand-row .begad-pixel-hero__title {
  margin: 0;
}

.begad-pixel-hero__description {
  max-width: 42ch;
  margin: 0;
  font: 600 clamp(.75rem, 1.25vw, 1rem)/1.45 'Sora', ui-sans-serif, sans-serif;
}

.begad-pixel-hero[data-slide="flash"] .begad-pixel-hero__description {
  color: #ffe3cb !important;
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__description,
.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__description,
.begad-pixel-hero[data-slide^="category-"] .begad-pixel-hero__description {
  color: #6b6157 !important;
}

.begad-pixel-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 0;
  padding: .75rem 1rem;
  border: 0;
  border-radius: .4rem;
  color: #1c1714 !important;
  background: linear-gradient(135deg, #ffb020 0%, #ff6a11 48%, #f62d0c 100%);
  box-shadow: 5px 5px 0 #762b08;
  font: 700 .76rem/1 'Press Start 2P', monospace;
  text-transform: uppercase;
  text-decoration: none;
  pointer-events: auto;
  transition: transform .18s ease, box-shadow .18s ease;
}

.begad-pixel-hero__actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0;
}

.begad-pixel-hero__count {
  font: 600 .8rem/1.3 'Sora', ui-sans-serif, sans-serif;
  color: #6b6157;
}

.begad-pixel-hero__sweep {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.begad-pixel-hero__sweep::before {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10rem;
  content: "";
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, 0) 100%);
  animation: begad-pixel-sweep 4s ease-in-out infinite;
}

.begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__sweep,
.begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__sweep {
  display: none;
}

@keyframes begad-pixel-sweep {
  0% { transform: translateX(-140%); }
  55%, 100% { transform: translateX(320%); }
}

.begad-pixel-hero__countdown {
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  padding: .7rem .9rem .55rem;
  color: #fff8f0;
  background: rgba(28, 23, 20, .68);
  font: 700 .68rem/1.2 'Sora', ui-sans-serif, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.begad-pixel-hero__countdown strong {
  font: 700 .85rem/1 'Press Start 2P', monospace;
  letter-spacing: 0;
}

.begad-pixel-hero__cta:hover,
.begad-pixel-hero__cta:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #762b08;
}

.begad-pixel-hero__badge {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: clamp(5.25rem, 10vw, 9rem);
  aspect-ratio: 1;
  padding: .8rem;
  border: 3px solid currentColor;
  border-radius: 50%;
  color: var(--begad-cream);
  background: var(--begad-orange);
  box-shadow: 5px 5px 0 rgba(23, 16, 13, .55);
  font: 700 clamp(.62rem, 1.15vw, 1rem)/1.2 'Press Start 2P', monospace;
  text-align: center;
  transform: rotate(-8deg);
}

.begad-pixel-hero__badge strong {
  display: block;
  font-size: 1.45em;
}

.begad-pixel-hero__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  background: #fff;
}

.begad-pixel-hero__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.begad-pixel-hero__tab,
.begad-pixel-hero__pause {
  min-height: 2rem;
  border: 1px solid rgba(36, 23, 14, .16);
  border-radius: 999px;
  padding: .35rem .75rem;
  color: #6b6157;
  background: #fff;
  cursor: pointer;
  font: 700 .68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.begad-pixel-hero__tab[aria-selected="true"],
.begad-pixel-hero__tab:hover,
.begad-pixel-hero__tab:focus-visible,
.begad-pixel-hero__pause:hover,
.begad-pixel-hero__pause:focus-visible {
  border-color: var(--begad-orange);
  color: #fff;
  background: var(--begad-orange);
}

.begad-pixel-hero__pause {
  flex: 0 0 auto;
}

.begad-pixel-hero__sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 767px) {
  .begad-pixel-sponsored {
    min-height: 3rem;
    border-radius: .25rem;
    font-size: .56rem;
  }

  .begad-pixel-sponsored__label,
  .begad-pixel-sponsored__action {
    padding: 0 .7rem;
    font-size: .48rem;
  }

  .begad-pixel-sponsored__action {
    display: none;
  }

  .begad-pixel-sponsored__crawl {
    gap: 1.5rem;
    padding: 0 1.5rem;
    animation-duration: 24s;
  }

  .begad-pixel-hero {
    border-radius: .25rem;
  }

  .begad-pixel-hero__stage {
    /* The canvas has an intrinsic 360x105 size. A min-height alone leaves
       its percentage height unresolved on phones, so the browser falls back
       to the intrinsic canvas box and crops/letterboxes the hero. Give the
       mobile stage a real responsive box and let the artwork fill it. */
    height: clamp(15rem, 72vw, 20rem);
    min-height: 0;
    aspect-ratio: 3 / 2;
  }

  .begad-pixel-hero__canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: fill;
  }

  .begad-pixel-hero__content {
    align-items: flex-end;
    padding: 1.1rem;
    background: linear-gradient(90deg, rgba(20, 13, 10, .58), transparent 80%);
  }

  .begad-pixel-hero[data-slide="delivery"] .begad-pixel-hero__content,
  .begad-pixel-hero[data-slide="electronics"] .begad-pixel-hero__content,
  .begad-pixel-hero[data-slide^="category-"] .begad-pixel-hero__content {
    background: linear-gradient(90deg, rgba(255, 248, 240, .78), transparent 86%);
  }

  .begad-pixel-hero__copy {
    max-width: 90%;
  }

  .begad-pixel-hero__copy {
    height: 100%;
  }

  .begad-pixel-hero__brand { gap: .6rem; min-height: 2rem; }
  .begad-pixel-hero__brand img { height: 1.6rem; }
  .begad-pixel-hero__brand .begad-pixel-hero__mark { height: 2rem; }

  .begad-pixel-hero__description {
    display: none;
  }

  .begad-pixel-hero__cta {
    padding: .65rem .75rem;
    font-size: .62rem;
  }

  .begad-pixel-hero__actions { gap: .6rem; margin-top: .7rem; }
  .begad-pixel-hero__countdown { display: none; }

  .begad-pixel-hero__badge {
    align-self: flex-start;
    width: 4.5rem;
    border-width: 2px;
    box-shadow: 3px 3px 0 rgba(23, 16, 13, .55);
  }

  .begad-pixel-hero__nav {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .begad-pixel-sponsored__crawl,
  .begad-pixel-sponsored__label span:first-child,
  .begad-pixel-hero__sweep::before,
  .begad-pixel-hero__cta { animation: none; transition: none; }
}
