/* Home hero only — scoped so stores/admin/merchant are untouched.
   Mobile: stacked media + ivory copy (in-flow). Desktop (≥700px): overlay copy. */

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero {
  position: relative !important;
  isolation: isolate;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: #FBF7F0 !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero::after,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-overlay {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* All slides share one grid cell, so the hero keeps the tallest slide's height and never jumps */
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slides {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  inset: auto !important;
  z-index: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Slides: only .is-active is visible, focusable (JS sets `inert` on the rest) and sized in flow.
   The outgoing slide keeps `visibility` until its image has faded out, but its copy is hidden at
   once (below), so two slides' text or buttons can never be on screen together. */
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide {
  grid-area: 1 / 1;
  position: relative !important;
  inset: auto !important;
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "media" "copy";
  align-items: stretch;
  align-content: start;
  min-width: 0;
  height: auto !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible !important;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
}

/* Only the active slide contributes height so full eyebrow/title/copy stay visible */
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
  transition: opacity 420ms ease, visibility 0s linear 0s;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide:not(.is-active) .hero-copy {
  visibility: hidden !important;
  opacity: 0 !important;
  transition: none !important;
  animation: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero.has-switched .home-hero-slide.is-active .hero-copy {
  animation: ls-hero-copy-in 320ms ease-out 120ms both;
}

@keyframes ls-hero-copy-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media {
  grid-area: media;
  position: relative !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  overflow: hidden !important;
  background: #FBF7F0 !important;
  aspect-ratio: 16 / 11 !important;
  min-height: 180px !important;
  height: auto !important;
  max-height: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    #FBF7F0 0%,
    rgba(251, 247, 240, 0.55) 45%,
    rgba(251, 247, 240, 0) 100%
  ) !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .home-hero-media img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: var(--hero-focus, center center) !important;
  opacity: 1 !important;
  display: block !important;
  max-width: none !important;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Mobile/default: copy in normal flow under the image */
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy {
  grid-area: copy;
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  z-index: 2 !important;
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 20px 24px 8px !important;
  box-sizing: border-box !important;
  background: #FBF7F0 !important;
  text-align: start !important;
  color: #31352C !important;
  transform: none !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy .eyebrow,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .eyebrow {
  margin: 0 !important;
  color: #59633A !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  line-height: 1.4 !important;
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  text-shadow: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-title,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero h1 {
  margin: 0 !important;
  max-width: none !important;
  overflow: visible !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  color: #66001f !important;
  font-size: clamp(1.625rem, 1.35rem + 1.4vw, 2.25rem) !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-shadow: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-subtitle,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy p.hero-subtitle {
  margin: 0 !important;
  max-width: none !important;
  color: #31352C !important;
  font-size: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0625rem) !important;
  font-weight: 600 !important;
  line-height: 1.65 !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  overflow: visible !important;
  text-overflow: unset !important;
  white-space: normal !important;
  text-shadow: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 4px 0 0 !important;
  align-self: stretch !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions .pill,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions > .pill {
  display: inline-flex !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 48px !important;
  height: auto !important;
  padding: 12px 18px !important;
  justify-content: center !important;
  align-items: center !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  flex: 0 0 auto !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions .pill.primary {
  background: #66001f !important;
  color: #fff !important;
  border: 1px solid #66001f !important;
}

/* Ivory panel: burgundy ghost — never white-on-cream from legacy hero overlays */
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions .pill.ghost,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .pill.ghost,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-cta-secondary,
html body.home-page.has-bottom-nav:not(.admin-view):not(.merchant-view) .home-hero .pill.ghost {
  display: inline-flex !important;
  background: #f6f1e8 !important;
  color: #66001f !important;
  border: 1.5px solid rgba(120, 29, 58, 0.35) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .pill:focus-visible {
  outline: 2px solid #66001f;
  outline-offset: 3px;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-controls {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  visibility: visible !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 24px 24px !important;
  box-sizing: border-box !important;
  background: #FBF7F0 !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-arrow {
  display: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 29, 58, 0.22);
  border-radius: 999px;
  background: #f6f1e8;
  color: #66001f;
  box-shadow: none;
  cursor: pointer;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause:hover {
  background: #F4ECEE;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause:focus-visible,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots button:focus-visible {
  outline: 2px solid #66001f;
  outline-offset: 3px;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots {
  display: flex !important;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0 !important;
  pointer-events: auto !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(120, 29, 58, 0.28);
  min-width: 8px;
  min-height: 8px;
  cursor: pointer;
  pointer-events: auto;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots button.is-active {
  width: 22px;
  background: #66001f;
}

@media (pointer: coarse), (max-width: 767px) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots {
    gap: 0;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots button,
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-dots button.is-active {
    box-sizing: content-box !important;
    border: 18px solid transparent !important;
    background-clip: padding-box !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-controls {
    padding-block: 4px 16px !important;
  }
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-arrow .ls-icon,
html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause .ls-icon {
  width: 20px;
  height: 20px;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero [hidden] {
  display: none !important;
}

html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-pause [data-icon-play] .ls-icon {
  fill: currentColor;
}

@media (max-width: 359px) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy {
    padding: 18px 16px 14px !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-controls {
    padding-inline: 16px !important;
  }
}

@media (orientation: landscape) and (max-width: 899px) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media {
    aspect-ratio: 21 / 9 !important;
    min-height: 140px !important;
  }
}

/* Desktop: keep overlay copy on the banner */
@media (min-width: 700px) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero {
    overflow: visible !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media {
    aspect-ratio: 2172 / 724 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Image and copy share one grid cell; the row grows with the copy if it is taller than the banner */
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide {
    grid-template-rows: auto;
    grid-template-areas: "stack";
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media {
    grid-area: stack;
    align-self: stretch;
  }

  /* Readability layer: its own element behind the copy, light and limited to the copy side */
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media::after {
    inset: 0 !important;
    height: auto !important;
    background: linear-gradient(
      to left,
      rgba(251, 247, 240, 0.78) 0%,
      rgba(251, 247, 240, 0.5) 30%,
      rgba(251, 247, 240, 0) 52%
    ) !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .home-hero-media img {
    object-fit: cover !important;
    object-position: var(--hero-desk, center center) !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy {
    grid-area: stack;
    justify-self: right;
    align-self: center;
    position: relative !important;
    transform: none !important;
    width: min(460px, 40%) !important;
    max-width: 480px !important;
    margin: 0 !important;
    margin-right: max(20px, 4%) !important;
    padding: 20px 8px !important;
    gap: 10px !important;
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    z-index: 3 !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-title {
    font-size: clamp(1.7rem, 2.4vw, 2.4rem) !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-subtitle {
    font-size: 1.02rem !important;
    max-width: 32ch !important;
    line-height: 1.5 !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: auto !important;
    max-width: none !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions .pill,
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions > .pill {
    width: auto !important;
    min-width: 0 !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-actions .pill.ghost,
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .pill.ghost {
    background: #f6f1e8 !important;
    color: #66001f !important;
    border: 1px solid rgba(120, 29, 58, 0.28) !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-controls {
    direction: ltr;
    justify-content: flex-start;
    background: transparent !important;
    padding: 10px 16px 16px !important;
  }

  html body.lang-ar .home-hero-controls,
  html body.lang-he .home-hero-controls,
  html[dir="rtl"] body.home-page .home-hero-controls {
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-media {
    height: auto !important;
    max-height: none !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-copy {
    margin-right: max(28px, calc((100% - 1280px) / 2 + 32px)) !important;
    width: min(480px, 38%) !important;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero .hero-arrow {
    display: inline-flex !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide,
  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero-slide.is-active {
    transition: none;
  }

  html body.home-page:not(.admin-view):not(.merchant-view) .home-hero.has-switched .home-hero-slide.is-active .hero-copy {
    animation: none;
  }
}
