/* Seasonal holiday decorations — shared by storefront + Appearance preview.
   Requires data-holiday-decor="on" and data-season set to a holiday key. */

.season-decor {
  display: none;
  pointer-events: none;
  z-index: 2;
}

html[data-holiday-decor="on"][data-season]:not([data-season="off"]) .season-decor,
body[data-holiday-decor="on"][data-season]:not([data-season="off"]) .season-decor,
.sf-preview[data-holiday-decor="on"][data-season]:not([data-season="off"]) .season-decor {
  display: block;
}

html[data-holiday-decor="on"][data-decor-intensity="subtle"],
body[data-holiday-decor="on"][data-decor-intensity="subtle"],
.sf-preview[data-holiday-decor="on"][data-decor-intensity="subtle"] {
  --season-decor-opacity: 0.78;
  --season-decor-scale: 0.92;
  --season-decor-extra-opacity: 0;
  --season-decor-footer-opacity: 0;
  --season-decor-divider-opacity: 0;
}

html[data-holiday-decor="on"][data-decor-intensity="festive"],
body[data-holiday-decor="on"][data-decor-intensity="festive"],
.sf-preview[data-holiday-decor="on"][data-decor-intensity="festive"] {
  --season-decor-opacity: 0.95;
  --season-decor-scale: 1;
  --season-decor-extra-opacity: 0.85;
  --season-decor-footer-opacity: 0.8;
  --season-decor-divider-opacity: 0.9;
}

html[data-holiday-decor="on"][data-decor-intensity="extra_festive"],
body[data-holiday-decor="on"][data-decor-intensity="extra_festive"],
.sf-preview[data-holiday-decor="on"][data-decor-intensity="extra_festive"] {
  --season-decor-opacity: 1;
  --season-decor-scale: 1.08;
  --season-decor-extra-opacity: 1;
  --season-decor-footer-opacity: 0.95;
  --season-decor-divider-opacity: 1;
}

.sf-prev-header {
  position: relative;
}

.season-decor--header {
  position: absolute;
  inset: 0;
  overflow: visible;
  z-index: 0;
  opacity: var(--season-decor-opacity, 0.9);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(40, 28, 18, 0.18));
}

.site-header > .nav,
.sf-prev-header > *:not(.season-decor) {
  position: relative;
  z-index: 1;
}

/* Hero layer sits above wave so bottom clusters stay visible */
.season-decor--hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4.75rem;
  height: min(50%, 16rem);
  z-index: 4;
  opacity: var(--season-decor-opacity, 0.9);
  transform: scale(var(--season-decor-scale, 1));
  transform-origin: bottom center;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% auto;
  pointer-events: none;
}

.sf-prev-hero .season-decor--hero {
  bottom: 0.35rem;
  height: 42%;
  z-index: 3;
}

.season-decor--divider {
  height: 22px;
  margin: -0.2rem 0 0.35rem;
  opacity: var(--season-decor-divider-opacity, 0.9);
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 20px;
}

.site-footer,
.sf-prev-footer {
  position: relative;
}

.season-decor--footer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 56px;
  z-index: 0;
  opacity: var(--season-decor-footer-opacity, 0.85);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

.site-footer > *:not(.season-decor),
.sf-prev-footer > *:not(.season-decor) {
  position: relative;
  z-index: 1;
}

/* Extra festive overlay accents (second layer) — corners only, no mid-hero strip */
.season-decor--header::after,
.season-decor--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--season-decor-extra-opacity, 0);
  pointer-events: none;
  background-repeat: no-repeat;
}

.season-decor--header::after {
  background-position: center top;
  background-size: 100% 100%;
}

.season-decor--hero::after {
  display: none;
}

/* ---- Halloween ---- */
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--header,
body[data-season="halloween"][data-holiday-decor="on"] .season-decor--header,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--header {
  background-image: url("/assets/seasonal/halloween-header.svg?v=xy2d");
}
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--hero,
body[data-season="halloween"][data-holiday-decor="on"] .season-decor--hero,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--hero {
  background-image: url("/assets/seasonal/halloween-hero.svg?v=xy2d");
}
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--divider,
body[data-season="halloween"][data-holiday-decor="on"] .season-decor--divider,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--divider {
  background-image: url("/assets/seasonal/halloween-divider.svg?v=xy2d");
}
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--footer,
body[data-season="halloween"][data-holiday-decor="on"] .season-decor--footer,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--footer {
  background-image: url("/assets/seasonal/halloween-footer.svg?v=xy2d");
}
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--header::after,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--header::after {
  background-image: url("/assets/seasonal/halloween-header.svg?v=xy2d");
  transform: scaleX(-1) translateY(4px);
  opacity: calc(var(--season-decor-extra-opacity, 0) * 0.4);
}
html[data-season="halloween"][data-holiday-decor="on"] .season-decor--hero::after,
.sf-preview[data-season="halloween"][data-holiday-decor="on"] .season-decor--hero::after {
  display: none;
}

/* ---- Thanksgiving ---- */
html[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--header,
body[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--header,
.sf-preview[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--header {
  background-image: url("/assets/seasonal/thanksgiving-header.svg?v=xy2d");
}
html[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--hero,
body[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--hero,
.sf-preview[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--hero {
  background-image: url("/assets/seasonal/thanksgiving-hero.svg?v=xy2d");
}
html[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--divider,
body[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--divider,
.sf-preview[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--divider {
  background-image: url("/assets/seasonal/thanksgiving-divider.svg?v=xy2d");
}
html[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--footer,
body[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--footer,
.sf-preview[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--footer {
  background-image: url("/assets/seasonal/thanksgiving-footer.svg?v=xy2d");
}
html[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--hero::after,
.sf-preview[data-season="thanksgiving"][data-holiday-decor="on"] .season-decor--hero::after {
  display: none;
}

/* ---- Christmas ---- */
html[data-season="christmas"][data-holiday-decor="on"] .season-decor--header,
body[data-season="christmas"][data-holiday-decor="on"] .season-decor--header,
.sf-preview[data-season="christmas"][data-holiday-decor="on"] .season-decor--header {
  background-image: url("/assets/seasonal/christmas-header.svg?v=xy2d");
}
html[data-season="christmas"][data-holiday-decor="on"] .season-decor--hero,
body[data-season="christmas"][data-holiday-decor="on"] .season-decor--hero,
.sf-preview[data-season="christmas"][data-holiday-decor="on"] .season-decor--hero {
  background-image: url("/assets/seasonal/christmas-hero.svg?v=xy2d");
}
html[data-season="christmas"][data-holiday-decor="on"] .season-decor--divider,
body[data-season="christmas"][data-holiday-decor="on"] .season-decor--divider,
.sf-preview[data-season="christmas"][data-holiday-decor="on"] .season-decor--divider {
  background-image: url("/assets/seasonal/christmas-divider.svg?v=xy2d");
}
html[data-season="christmas"][data-holiday-decor="on"] .season-decor--footer,
body[data-season="christmas"][data-holiday-decor="on"] .season-decor--footer,
.sf-preview[data-season="christmas"][data-holiday-decor="on"] .season-decor--footer {
  background-image: url("/assets/seasonal/christmas-footer.svg?v=xy2d");
}
html[data-season="christmas"][data-holiday-decor="on"] .season-decor--hero::after,
.sf-preview[data-season="christmas"][data-holiday-decor="on"] .season-decor--hero::after {
  display: none;
}

/* ---- Easter ---- */
html[data-season="easter"][data-holiday-decor="on"] .season-decor--header,
body[data-season="easter"][data-holiday-decor="on"] .season-decor--header,
.sf-preview[data-season="easter"][data-holiday-decor="on"] .season-decor--header {
  background-image: url("/assets/seasonal/easter-header.svg?v=xy2d");
}
html[data-season="easter"][data-holiday-decor="on"] .season-decor--hero,
body[data-season="easter"][data-holiday-decor="on"] .season-decor--hero,
.sf-preview[data-season="easter"][data-holiday-decor="on"] .season-decor--hero {
  background-image: url("/assets/seasonal/easter-hero.svg?v=xy2d");
}
html[data-season="easter"][data-holiday-decor="on"] .season-decor--divider,
body[data-season="easter"][data-holiday-decor="on"] .season-decor--divider,
.sf-preview[data-season="easter"][data-holiday-decor="on"] .season-decor--divider {
  background-image: url("/assets/seasonal/easter-divider.svg?v=xy2d");
}
html[data-season="easter"][data-holiday-decor="on"] .season-decor--footer,
body[data-season="easter"][data-holiday-decor="on"] .season-decor--footer,
.sf-preview[data-season="easter"][data-holiday-decor="on"] .season-decor--footer {
  background-image: url("/assets/seasonal/easter-footer.svg?v=xy2d");
}
html[data-season="easter"][data-holiday-decor="on"] .season-decor--hero::after,
.sf-preview[data-season="easter"][data-holiday-decor="on"] .season-decor--hero::after {
  display: none;
}

/* ---- Fourth of July ---- */
html[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--header,
body[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--header,
.sf-preview[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--header {
  background-image: url("/assets/seasonal/july4-header.svg?v=xy2d");
}
html[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--hero,
body[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--hero,
.sf-preview[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--hero {
  background-image: url("/assets/seasonal/july4-hero.svg?v=xy2d");
}
html[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--divider,
body[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--divider,
.sf-preview[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--divider {
  background-image: url("/assets/seasonal/july4-divider.svg?v=xy2d");
}
html[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--footer,
body[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--footer,
.sf-preview[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--footer {
  background-image: url("/assets/seasonal/july4-footer.svg?v=xy2d");
}
html[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--hero::after,
.sf-preview[data-season="fourth_of_july"][data-holiday-decor="on"] .season-decor--hero::after {
  display: none;
}

/* Subtle: keep header + hero only */
html[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--divider,
body[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--divider,
.sf-preview[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--divider,
html[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--footer,
body[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--footer,
.sf-preview[data-holiday-decor="on"][data-decor-intensity="subtle"][data-season] .season-decor--footer {
  display: none !important;
}

html[data-holiday-decor="on"][data-decor-intensity="subtle"] .season-decor--hero,
body[data-holiday-decor="on"][data-decor-intensity="subtle"] .season-decor--hero,
.sf-preview[data-holiday-decor="on"][data-decor-intensity="subtle"] .season-decor--hero {
  height: min(34%, 10.5rem);
}

html[data-holiday-decor="on"][data-decor-intensity="extra_festive"] .season-decor--hero,
body[data-holiday-decor="on"][data-decor-intensity="extra_festive"] .season-decor--hero,
.sf-preview[data-holiday-decor="on"][data-decor-intensity="extra_festive"] .season-decor--hero {
  height: min(52%, 17rem);
}

@media (max-width: 640px) {
  .season-decor--header {
    background-size: 180% 100%;
    background-position: center top;
  }
  .season-decor--hero {
    bottom: 2.5rem;
    height: min(38%, 10rem);
    background-size: 155% auto;
  }
  html[data-decor-intensity="subtle"] .season-decor--hero,
  body[data-decor-intensity="subtle"] .season-decor--hero {
    height: min(32%, 8.5rem);
  }
  html[data-decor-intensity="extra_festive"] .season-decor--hero,
  body[data-decor-intensity="extra_festive"] .season-decor--hero {
    height: min(44%, 11.5rem);
    transform: scale(1.04);
  }
  .season-decor--footer {
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .season-decor {
    transition: none;
  }
}
