/* v2 campaign bar — Black Week 2026 (components/v2/campaign-bar.html.twig). Tokens from
   css/v2/tokens.css. Replaces css/v2/promo-bar.css while the campaign runs, with the same frame:
   sticky right under the sticky header, fixed height published as --bf-promo-h (video-hero.css,
   finder.css, directory.css, the scroll-margin-tops subtract it), z-index just under the header's.
     mobile  (< 960px)  : maquette Flotante "Móvil · barra fija" (390×60), kept at the top under the
                          header: "Black Week" + price + "valued at" on the left, "Ver oferta" on the right
     desktop (>= 960px) : maquette Web-barra (1440×72), one centred row; below 1280px the gift line
                          goes (the gloves stay), below 1120px the pack line too. */

/* --bf-bw-bar-h is the bar's own height; --bf-promo-h publishes it to the page layout, except on a
   page with a Black Week hero (html.bf-bw-reveal, base_v2.html.twig): there the bar waits until the
   hero is off screen (script in campaign-bar.html.twig), then slides down over the page, fixed under
   the header, taking no room in the layout. */
:root {
  --bf-bw-bar-h: 60px;
}

:root:not(.bf-bw-reveal) {
  --bf-promo-h: var(--bf-bw-bar-h);
}

.bf-bw-bar {
  /* Mobile sizes: the maquette draws the bar 540px wide; at 390px (368px between the 14px / 8px
     paddings) its row needs ~400px, so the whole design is scaled by (100vw - 22px) / 400 (0.92 at
     390px, less on narrower phones). Longer locales scale further, see below. */
  --bw-u: min(1px, calc((100vw - 22px) / 400));
  --bw-gold: #997A00;
  position: -webkit-sticky;
  position: sticky;
  top: var(--bf-header-h);
  z-index: calc(var(--bf-z-header) - 1);
  box-sizing: border-box;
  height: var(--bf-bw-bar-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bf-c-white);
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  color: var(--bf-c-black);
  font-family: var(--bf-font-body);
}

.bf-bw-bar__inner {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--bw-u));
  width: 100%;
  box-sizing: border-box;
}

.bf-bw-bar__title,
.bf-bw-bar__pack {
  margin: 0;
  white-space: nowrap;
  text-transform: uppercase;
}

.bf-bw-bar__title {
  font: 900 calc(22 * var(--bw-u))/.85 var(--bf-font-numeric);
}

.bf-bw-bar__prices {
  display: flex;
  align-items: flex-end;
  gap: calc(4 * var(--bw-u));
  white-space: nowrap;
}

.bf-bw-bar__price {
  font: 900 calc(30 * var(--bw-u))/.85 var(--bf-font-numeric);
  letter-spacing: .04em;
}

/* "Valued at" + amount, stacked and glued to the price (desktop sizes below). */
.bf-bw-bar__value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(2 * var(--bw-u));
  padding-bottom: 1px;
  color: var(--bw-gold);
}

.bf-bw-bar__value-label {
  padding-top: 1px;
  font: 400 calc(10 * var(--bw-u))/.9 var(--bf-font-display);
  letter-spacing: .03em;
  text-transform: uppercase;
}

.bf-bw-bar__value-amount {
  font: 800 calc(13 * var(--bw-u))/.85 var(--bf-font-numeric);
  letter-spacing: .04em;
}

/* amount_of_money glues the euro to the number ("24,95€"): the maquette spaces it. */
.bf-bw--eur .currency {
  margin-left: .12em;
}

.bf-bw-bar__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  margin-left: auto;
  padding: 0 calc(16 * var(--bw-u));
  box-sizing: border-box;
  background: var(--bf-c-yellow);
  color: var(--bf-c-black);
  border-radius: var(--bf-radius-btn);
  font: 400 calc(20 * var(--bw-u))/.85 var(--bf-font-display);
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--bf-dur) var(--bf-ease), color var(--bf-dur) var(--bf-ease);
}

/* Black with white text on hover, as every Black Week CTA (canvas of 2026-11-20). */
.bf-bw-bar__btn:hover,
.bf-bw-bar__btn:focus {
  background: var(--bf-c-black);
  color: var(--bf-c-white);
  text-decoration: none;
}

@media (max-width: 959px) {
  /* The maquette's 14px / 8px paddings instead of the container's 20px gutters. */
  .bf-bw-bar .bf-bw-bar__inner {
    padding-left: 14px;
    padding-right: 8px;
  }

  /* The maquette's shadow points up (a bar fixed at the bottom); at the top it points down. */
  .bf-bw-bar {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
  }

  /* Per-locale text fit (es-es is the reference): the same design, scaled down further for the
     longer texts / amounts. es-es itself: "Consíguelo" is 3px too wide at /400. */
  .language-es-es .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 408));
  }

  .language-fr-fr .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 426));
  }

  .language-pt-br .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 428));
  }

  .language-ca-es .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 440));
  }

  .language-es-ar .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 436));
  }

  .language-de-de .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 416));
  }

  .language-it-it .bf-bw-bar {
    --bw-u: min(1px, calc((100vw - 22px) / 412));
  }
}

/* ---- Desktop (UIkit @m) ---- */

@media (min-width: 960px) {
  :root {
    --bf-bw-bar-h: 72px;
  }

  .bf-bw-bar {
    top: var(--bf-header-h-desktop);
  }

  .bf-bw-bar__inner {
    justify-content: center;
    gap: 24px;
  }

  /* Fira caps sit low in their line box: 3px padding-top as the maquette. */
  .bf-bw-bar__title {
    padding-top: 3px;
    font-size: 38px;
  }

  .bf-bw-bar__prices {
    gap: 5px;
  }

  /* Two lines when the locale's text holds a <br> (fr): 2 × 22px × .9 fits the bar. */
  .bf-bw-bar__pack {
    padding-top: 2px;
    font: 400 22px/.9 var(--bf-font-display);
  }

  .bf-bw-bar__price {
    padding-top: 0;
    font-size: 38px;
  }

  .bf-bw-bar__value {
    gap: 2px;
  }

  .bf-bw-bar__value-label {
    font-size: 10px;
  }

  .bf-bw-bar__value-amount {
    font-size: 16px;
  }

  .bf-bw-bar__divider {
    flex: none;
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, .15);
  }

  .bf-bw-bar__gift {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .bf-bw-bar__gloves {
    display: block;
    width: auto;
    height: 39.6px;
  }

  .bf-bw-bar__gift-label {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
  }

  .bf-bw-bar__btn {
    height: 46px;
    margin-left: 0;
    padding: 0 29px;
    font-size: 22px;
  }
}

@media (min-width: 960px) and (max-width: 1279px) {
  .bf-bw-bar__gift-label {
    display: none;
  }
}

@media (min-width: 960px) and (max-width: 1119px) {
  .bf-bw-bar__pack {
    display: none !important;
  }
}

/* ---- Reveal mode: page with a Black Week hero (html.bf-bw-reveal) ----
   Hidden above the viewport (not just under the header: the view_promotion observer in
   analytics.js must not count it as seen), then slid down under the header once the hero is off
   screen (.is-shown). Anchors (#ofertas, #clubes) still land below the bar: scroll-padding. */

.bf-bw-reveal {
  scroll-padding-top: var(--bf-bw-bar-h);
}

.bf-bw-reveal .bf-bw-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  visibility: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
  transition: transform .25s var(--bf-ease), visibility 0s .25s;
}

.bf-bw-reveal .bf-bw-bar.is-shown {
  transform: translateY(var(--bf-header-h));
  visibility: visible;
  transition: transform .25s var(--bf-ease), visibility 0s;
}

@media (min-width: 960px) {
  .bf-bw-reveal .bf-bw-bar.is-shown {
    transform: translateY(var(--bf-header-h-desktop));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-bw-reveal .bf-bw-bar,
  .bf-bw-reveal .bf-bw-bar.is-shown {
    transition: none;
  }
}
