html[data-event-palette="blackfriday"] {
  --bf-ink: #111111;
  --bf-surface: #21201f;
  --bf-paper: #f8f5ef;
  --bf-muted: #cbbeb2;
  --bf-orange: #ff7a1a;
  --bf-orange-soft: #dfb899;
  --bf-rule: #564033;
  --bf-control: #292521;
  --bf-hover: #3a2b21;

  /* La stessa gerarchia del sito: bianco per la lettura, arancione per gli accenti. */
  --hp-ui-blue-950: 36 39% 96%;
  --hp-ui-blue-900: 36 39% 96%;
  --hp-ui-blue-800: 36 39% 96%;
  --hp-ui-blue-700: 30 19% 75%;
  --hp-ui-blue-600: 30 19% 75%;
  --hp-ui-blue-500: 25 100% 55%;
  --hp-ui-blue-400: 25 100% 65%;
  --hp-ui-blue-300: 25 100% 75%;
  --hp-ui-blue-200: 25 22% 23%;
  --hp-ui-blue-100: 25 12% 16%;
  --hp-ui-blue-50: 25 6% 12%;
  --hp-ui-violet-950: 36 39% 96%;
  --hp-ui-violet-900: 36 39% 96%;
  --hp-ui-violet-800: 36 39% 96%;
  --hp-ui-violet-700: 30 19% 75%;
  --hp-ui-violet-600: 25 100% 55%;
  --hp-ui-violet-500: 25 100% 55%;
  --hp-ui-violet-400: 25 100% 65%;
  --hp-ui-violet-300: 25 100% 75%;
  --hp-ui-violet-200: 25 22% 23%;
  --hp-ui-violet-100: 25 12% 16%;
  --hp-ui-violet-50: 25 6% 12%;

  /* Canali HSL consumati dal plugin PostCSS, con fallback al tema principale. */
  --hp-event-surface-deep: 0 0% 7%;
  --hp-event-surface-base: 30 3% 13%;
  --hp-event-surface-raised: 30 7% 17%;
  --hp-event-line: 26 25% 37%;
  --hp-event-ink: 36 39% 96%;
  --hp-event-muted: 30 19% 75%;
  --hp-event-brand-background: #292521;
  --hp-event-border-color: var(--bf-rule);

  --primary: var(--bf-paper);
  --secondary: var(--bf-surface);
  --tertiary: var(--bf-orange);
  --background: var(--bf-ink);
  --foreground: var(--bf-paper);
  --opacity-bg: rgb(17 17 17 / 70%);
  --promo-gradient: linear-gradient(135deg, #ff7a1a, #ba4b00);
  --promo-badge-background: var(--bf-orange);
  --hp-button-primary-gradient: linear-gradient(105deg, #ff7a1a 0% 32%, #ffad65 68% 100%);
  --hp-button-secondary-gradient: var(--hp-button-primary-gradient);
  --hp-button-foreground: var(--bf-ink);
  --configurator-card-ink: var(--bf-paper);
  --configurator-card-sky: var(--bf-orange);
  --configurator-card-accent: linear-gradient(180deg, #ff7a1a, #ffad65);
  --configurator-promo-lavender: #ffad65;
  --event-viewer-tint: #292521;
  --event-viewer-background: radial-gradient(ellipse at 68% 24%, #3a3029, transparent 65%), linear-gradient(150deg, #21201f, #111111);

  /* HeroUI usa canali HSL anche per i componenti montati nei portali. */
  --nextui-background: 0 0% 7%;
  --nextui-foreground: 36 39% 96%;
  --nextui-content1: 30 3% 13%;
  --nextui-content2: 30 7% 17%;
  --nextui-content3: 25 12% 20%;
  --nextui-content4: 25 12% 24%;
  --nextui-divider: 26 25% 37%;
  --nextui-focus: 25 100% 55%;
  --nextui-overlay: 0 0% 0%;
  --nextui-primary: 25 100% 55%;
  --nextui-primary-foreground: 0 0% 7%;
  --nextui-secondary: 30 3% 13%;
  --nextui-secondary-foreground: 36 39% 96%;
  --nextui-default: 30 7% 17%;
  --nextui-default-foreground: 36 39% 96%;
  --nextui-default-50: 30 3% 13%;
  --nextui-default-100: 30 7% 17%;
  --nextui-default-200: 25 12% 20%;
  --nextui-default-300: 26 25% 37%;
  --nextui-default-400: 30 19% 65%;
  --nextui-default-500: 30 19% 75%;
  --nextui-default-600: 30 19% 80%;
  --nextui-default-700: 36 25% 86%;
  --nextui-default-800: 36 30% 92%;
  --nextui-default-900: 36 39% 96%;
  color-scheme: dark;
  accent-color: var(--bf-orange);
}

html[data-event-palette="blackfriday"] body {
  background: var(--bf-ink);
  color: var(--bf-paper);
}

html[data-event-palette="blackfriday"] ::selection {
  background: var(--bf-orange);
  color: var(--bf-ink);
}

/* Gerarchia comune alle hero prodotto, anche quando il sottotitolo è dentro l'h1. */
html[data-event-palette="blackfriday"] [data-landing-kicker] {
  color: var(--bf-paper);
}

html[data-event-palette="blackfriday"] [data-landing-title],
html[data-event-palette="blackfriday"] [data-landing-title] :is(span, strong) {
  color: var(--bf-orange);
}

html[data-event-palette="blackfriday"] [data-landing-subtitle] {
  color: var(--bf-orange-soft);
  background: none;
  -webkit-text-fill-color: currentColor;
}

/* I colori editoriali salvati nelle promo cedono al contrasto del tema. */
html[data-event-palette="blackfriday"] :is(
  [data-promo-card],
  [data-promo-article],
  [data-promo-content],
  [data-promo-dialog-surface],
  [data-promo-dialog-close]
) {
  background: var(--bf-ink) !important;
  color: #fff !important;
}

html[data-event-palette="blackfriday"] [data-promo-content] * {
  color: #fff !important;
  -webkit-text-fill-color: currentColor;
}

html[data-event-palette="blackfriday"] [data-promo-content] [style] {
  background: transparent !important;
}

html[data-event-palette="blackfriday"] [data-promo-preview]::after {
  background: linear-gradient(to bottom, rgb(17 17 17 / 0%), var(--bf-ink) 88%);
}

/* Le preview su fondo chiaro non devono moltiplicarsi con le card scure. */
html[data-event-palette="blackfriday"] [data-sector-preview] {
  mix-blend-mode: normal;
}

/* Il fondo chiaro della preview resta visibile: l'immagine prende la sua misura (al posto del
   riquadro di `fill` con `contain`) così gli angoli arrotondati cadono sulla foto. */
html[data-event-palette="blackfriday"] img[data-sector-preview] {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  border-radius: 18px;
}

/* Verde trasparente sulla fotografia, arancione per i testi della card ambiente. */
html[data-event-palette="blackfriday"] [data-home-environment] {
  --home-environment-overlay: linear-gradient(
    90deg,
    rgb(19 42 31 / 96%) 0%,
    rgb(19 42 31 / 92%) 42%,
    rgb(19 42 31 / 38%) 78%,
    rgb(19 42 31 / 16%) 100%
  );
  border-color: rgb(172 208 181 / 24%);
  background-origin: border-box;
  background-repeat: no-repeat;
  color: var(--bf-orange);
}

html[data-event-palette="blackfriday"] [data-home-environment] :is(h2, h3, p),
html[data-event-palette="blackfriday"] [data-environment-principles] svg {
  color: var(--bf-orange);
}

html[data-event-palette="blackfriday"] [data-home-environment] a {
  max-width: 100%;
  height: auto;
  white-space: normal;
}

html[data-event-palette="blackfriday"] [data-environment-kicker],
html[data-event-palette="blackfriday"] [data-environment-principles] article {
  border-color: rgb(172 208 181 / 28%);
  background: rgb(19 42 31 / 92%);
}

@media (max-width: 760px) {
  html[data-event-palette="blackfriday"] [data-home-environment] {
    --home-environment-overlay: linear-gradient(
      180deg,
      rgb(19 42 31 / 94%) 0%,
      rgb(19 42 31 / 88%) 55%,
      rgb(19 42 31 / 76%) 100%
    );
  }
}

/* Agganci condivisi con il tema natalizio, senza alterare le immagini dei prodotti. */
html[data-event-palette="blackfriday"] :is([data-site-footer], [data-dark-cta]) {
  --tertiary: var(--bf-orange);
  border-color: var(--bf-rule);
  background: var(--bf-ink);
  color: var(--bf-paper);
}

html[data-event-palette="blackfriday"] [data-site-footer] {
  border-block-start: 1px solid var(--bf-rule);
}

html[data-event-palette="blackfriday"] [data-dark-cta] > div:first-child > p:first-child {
  color: var(--bf-orange) !important;
}

html[data-event-palette="blackfriday"] [data-design-surface] {
  background: var(--event-viewer-background);
}

html[data-event-palette="blackfriday"] :is(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--bf-orange);
}

/* Righe, quantità e spedizioni restano leggibili anche nella barra mobile. */
html[data-event-palette="blackfriday"] :is(
  .configurator-setting-row,
  .configurator-dimensions-card,
  .configurator-references-card,
  .configurator-quantity-card,
  .configurator-quantity-mobile-card,
  .configurator-mobile-purchase-card,
  .configurator-shipping-card
) {
  border-color: var(--bf-rule) !important;
  background: var(--bf-surface) !important;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%) !important;
}

html[data-event-palette="blackfriday"] :is(
  .configurator-setting-row:hover,
  .configurator-fixed-size.is-selected,
  .configurator-selection-option.is-selected,
  .configurator-selection-model-option.is-selected,
  .configurator-label-die.is-selected,
  .configurator-roll-option.is-selected,
  .configurator-renderer-tool.is-active,
  .configurator-shipping-card.is-selected,
  .configurator-quantity-card.is-selected,
  .configurator-label-support-grid button.is-active,
  .configurator-renderer-view-switch button.is-active,
  .configurator-renderer-opener-modes button.is-active
) {
  border-color: var(--bf-orange) !important;
  background: var(--bf-hover) !important;
  color: var(--bf-paper) !important;
}

html[data-event-palette="blackfriday"] .configurator-shipping-card {
  --shipping-ticket-tint: 255 122 26;
}

html[data-event-palette="blackfriday"] .configurator-shipping-card.is-selected :is(
  .configurator-shipping-icon,
  .configurator-shipping-date,
  .configurator-shipping-price-current
) {
  color: var(--bf-orange);
}

/* Un solo badge per la campagna: etichetta sui prezzi, pillola sulle altre promo. */
html[data-event-palette="blackfriday"] [data-pack-friday-badge][data-pack-friday-badge] {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  height: auto;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--bf-orange) !important;
  border-radius: 999px;
  background: var(--configurator-promo-red) !important;
  color: #fff !important;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgb(0 0 0 / 22%) !important;
}

html[data-event-palette="blackfriday"] [data-pack-friday-badge]::before {
  display: none;
  content: none;
}

html[data-event-palette="blackfriday"] [data-pack-friday-claim] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  background: var(--bf-orange);
  color: var(--bf-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1.1;
}

html[data-event-palette="blackfriday"] [data-pack-friday-value] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  background: var(--configurator-promo-red);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
}

/* Righe del configuratore: l'etichetta resta intera, con la pillola accanto. Nel layout a
   colonne del desktop (da 1300 px, come in globals.css) la colonna del titolo si allarga fino
   al suo contenuto (il valore prende il resto) e la pillola è più compatta; se non c'è posto
   la pillola va sotto l'etichetta. */
@media (min-width: 1300px) {
  html[data-event-palette="blackfriday"] .configurator-setting-row-content {
    grid-template-columns: minmax(270px, max-content) minmax(0, 1fr) 28px !important;
  }

  html[data-event-palette="blackfriday"] .configurator-setting-row-title-content [data-pack-friday-badge][data-pack-friday-badge] {
    min-height: 22px;
  }

  html[data-event-palette="blackfriday"] .configurator-setting-row-title-content [data-pack-friday-claim] {
    padding: 6px;
    font-size: 10px;
  }

  html[data-event-palette="blackfriday"] .configurator-setting-row-title-content [data-pack-friday-value] {
    padding: 5px 7px;
    font-size: 11px;
  }
}

html[data-event-palette="blackfriday"] .configurator-setting-row-title-content:has(> [data-pack-friday-badge]) {
  flex-wrap: wrap;
  row-gap: 4px;
}

html[data-event-palette="blackfriday"] .configurator-setting-row-title-content:has(> [data-pack-friday-badge]) > span:first-child {
  flex-shrink: 0;
  max-width: 100%;
}

html[data-event-palette="blackfriday"] .configurator-setting-row-body:has([data-pack-friday-badge]) {
  height: auto !important;
  min-height: 2.75rem;
  padding-block: 6px;
}

html[data-event-palette="blackfriday"] [data-pack-friday-badge="ticket"][data-pack-friday-badge] {
  position: static;
  flex-direction: column;
  align-self: center;
  border-radius: 11px;
  transform: rotate(-3deg);
}

html[data-event-palette="blackfriday"] [data-pack-friday-badge="ticket"] [data-pack-friday-value] {
  padding: 6px 10px;
  font-size: 24px;
  font-weight: 900;
}

html[data-event-palette="blackfriday"] .configurator-shipping-price-content:has([data-pack-friday-badge]) {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

html[data-event-palette="blackfriday"] .configurator-shipping-card[data-has-discount="true"] {
  height: auto !important;
  min-height: 0;
  container-type: inline-size;
}

html[data-event-palette="blackfriday"] .configurator-shipping-card[data-has-discount="true"] .configurator-shipping-card-body {
  grid-template-rows: 88px minmax(154px, auto);
}

@container (min-width: 240px) {
  html[data-event-palette="blackfriday"] .configurator-shipping-card[data-has-discount="true"] .configurator-shipping-card-body {
    grid-template-rows: 88px minmax(82px, auto);
  }
}

/* La vecchia bandierina diagonale delle modalità d'ordine diventa orizzontale. */
html[data-event-palette="blackfriday"] [data-pack-friday-badge="pill"].configurator-order-promo {
  position: static;
  margin-top: 8px;
  transform: none;
}

html[data-event-palette="blackfriday"] [data-promo-badge-container] {
  container-type: inline-size;
}

@container (max-width: 210px) {
  html[data-event-palette="blackfriday"] [data-pack-friday-badge="pill"][data-pack-friday-badge] {
    right: 4px;
    max-width: calc(100% - 8px);
  }

  html[data-event-palette="blackfriday"] [data-pack-friday-badge="pill"] [data-pack-friday-claim] {
    max-width: 56px;
    padding: 6px;
    white-space: normal;
  }

  html[data-event-palette="blackfriday"] [data-pack-friday-badge="pill"] [data-pack-friday-value] {
    min-width: 0;
    padding: 6px;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 639px) {
  html[data-event-palette="blackfriday"] .configurator-selection-option-body:has([data-pack-friday-badge]) {
    flex-wrap: wrap;
  }

  html[data-event-palette="blackfriday"] .configurator-selection-option-body [data-pack-friday-badge] {
    margin-left: auto;
  }
}

html[data-event-palette="blackfriday"] .configurator-purchase-bar .configurator-add-to-cart {
  border-color: var(--bf-orange) !important;
  background: var(--hp-button-primary-gradient) !important;
  color: var(--bf-ink) !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 30%) !important;
}

html[data-event-palette="blackfriday"] .configurator-purchase-bar .configurator-action-icon {
  border-color: rgb(17 17 17 / 18%);
  background: rgb(17 17 17 / 8%);
}

html[data-event-palette="blackfriday"] #hp-navbar {
  border-color: var(--bf-rule) !important;
  background: rgb(22 21 20 / 91%);
  box-shadow: 0 12px 34px rgb(0 0 0 / 24%);
  color: var(--bf-paper);
}

html[data-event-palette="blackfriday"] #hp-navbar.hp-navbar--solid {
  background: rgb(22 21 20 / 97%);
}

html[data-event-palette="blackfriday"] #hp-navbar::before {
  content: none;
}

html[data-event-palette="blackfriday"] .hp-navbar__brand img {
  filter: brightness(0) invert(1);
}

html[data-event-palette="blackfriday"] .hp-navbar__nav {
  border-color: #3b322c;
  background: #201e1b;
}

html[data-event-palette="blackfriday"] #hp-navbar :is(.hp-navbar__nav-link, .hp-navbar__info-trigger) {
  color: var(--bf-paper) !important;
}

html[data-event-palette="blackfriday"] #hp-navbar :is(
  .hp-navbar__nav-link:hover,
  .hp-navbar__info-trigger:hover,
  .hp-navbar__nav-link--open,
  .hp-navbar__resources[open] > summary,
  .hp-navbar__link--active
) {
  background: var(--bf-hover);
  box-shadow: none;
  color: var(--bf-orange) !important;
}

html[data-event-palette="blackfriday"] #hp-navbar :is([data-tooltip], [data-navbar-menu-trigger]) {
  background: var(--bf-control) !important;
  border-color: var(--bf-rule) !important;
  color: var(--bf-paper) !important;
  box-shadow: none !important;
}

html[data-event-palette="blackfriday"] #hp-navbar [data-tooltip] > [aria-hidden="true"],
html[data-event-palette="blackfriday"] #hp-navbar [data-tooltip] svg {
  color: inherit;
}

html[data-event-palette="blackfriday"] #hp-navbar :is([data-tooltip], [data-navbar-menu-trigger]):is(:hover, :focus-visible, [data-open="true"]) {
  background: var(--bf-hover) !important;
  color: var(--bf-orange) !important;
}

html[data-event-palette="blackfriday"] #hp-navbar [data-tooltip]::after {
  border-color: var(--bf-rule);
  background: var(--bf-control);
  color: var(--bf-orange);
  box-shadow: 0 10px 28px rgb(0 0 0 / 40%);
}

html[data-event-palette="blackfriday"] #hp-navbar [data-navbar-cart-count] {
  border-color: var(--bf-surface);
  background: var(--bf-orange);
  color: var(--bf-ink);
  box-shadow: 0 3px 10px rgb(0 0 0 / 30%);
}

html[data-event-palette="blackfriday"] :is(.hp-navbar__cta, [data-navbar-drawer-cta]) {
  background: var(--bf-orange);
  color: var(--bf-ink) !important;
  box-shadow: none;
}

html[data-event-palette="blackfriday"] :is(.hp-navbar__cta, [data-navbar-drawer-cta]):is(:hover, :focus-visible) {
  background: #ff9b52;
  box-shadow: none;
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu-popover, [role="dialog"]:has([data-navbar-drawer])) {
  border-color: var(--bf-rule) !important;
  background: var(--bf-surface) !important;
  color: var(--bf-paper);
  box-shadow: 0 18px 48px rgb(0 0 0 / 32%) !important;
}

html[data-event-palette="blackfriday"] .hp-navbar-drawer-backdrop {
  background: rgb(0 0 0 / 66%) !important;
  backdrop-filter: blur(6px);
}

html[data-event-palette="blackfriday"] [role="dialog"]:has([data-navbar-drawer])::before {
  background: linear-gradient(90deg, var(--bf-orange), #5a3621);
}

html[data-event-palette="blackfriday"] .hp-navbar-drawer-close {
  border-color: var(--bf-rule) !important;
  background: var(--bf-control) !important;
  color: var(--bf-paper) !important;
  box-shadow: none;
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu__intro > span, [data-navbar-drawer] > div:first-child > span, [data-navbar-drawer] h2) {
  color: var(--bf-orange);
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu-popover, [data-navbar-drawer]) :is(strong, .hp-navbar-language-menu__label) {
  color: var(--bf-paper);
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu-popover, [data-navbar-drawer]) :is(p, small) {
  color: var(--bf-muted);
}

html[data-event-palette="blackfriday"] .hp-navbar-menu__links {
  border-color: var(--bf-rule);
}

html[data-event-palette="blackfriday"] :is(
  .hp-navbar-menu__link,
  .hp-navbar-menu__contact,
  .hp-navbar-language-menu__item,
  [data-navbar-drawer] a:not([data-navbar-drawer-cta])
) {
  border-color: var(--bf-rule);
  background: var(--bf-control);
  color: var(--bf-paper) !important;
  box-shadow: none;
}

html[data-event-palette="blackfriday"] :is(
  .hp-navbar-menu__link,
  .hp-navbar-menu__contact,
  .hp-navbar-language-menu__item,
  [data-navbar-drawer] a:not([data-navbar-drawer-cta])
):is(:hover, :focus-visible, [aria-current="page"], .hp-navbar__link--active) {
  border-color: var(--bf-orange);
  background: var(--bf-hover);
  color: var(--bf-orange) !important;
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu__link-icon, .hp-navbar-menu__contact-icon, [data-navbar-drawer] a:not([data-navbar-drawer-cta]) > span:first-child) {
  border-color: var(--bf-rule);
  background: var(--bf-hover);
  color: var(--bf-orange);
  box-shadow: none;
}

html[data-event-palette="blackfriday"] :is(.hp-navbar-menu__link, [data-navbar-drawer] a:not([data-navbar-drawer-cta])) > svg {
  color: currentColor;
}

html[data-event-palette="blackfriday"] :is(#hp-navbar, .hp-navbar-menu-popover, [role="dialog"]:has([data-navbar-drawer])) :is(a, button, summary):focus-visible {
  outline: 2px solid var(--bf-orange);
  outline-offset: 2px;
}
