/* v2 header — redesign 2026, on the UIkit 3.5.7 navbar. Uses tokens from css/v2/tokens.css.
   Maquette: Web Movil (mobile, < 960px) / Web Desktop (>= 960px, UIkit @m), "Diseño web móvil HTML (4)".
   UIkit gives the structure (uk-navbar-*, uk-container-bf, uk-visible@m / uk-hidden@m);
   everything below only restores the maquette metrics on top of UIkit's navbar defaults
   (80px min-heights, 15px item padding, system font, #f8f8f8 background).
   Rendered height incl. the 1px bottom border is pinned to
   --bf-header-h / --bf-header-h-desktop: the menu panel is positioned from them.
   Sticky is plain CSS: position: sticky is enough here, uk-sticky would only add JS
   and a placeholder element. */

.bf-header.uk-navbar-container {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: var(--bf-z-header);
  box-sizing: border-box;
  height: var(--bf-header-h);
  background: var(--bf-c-header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bf-c-line-light);
  font-family: var(--bf-font-body);
}

.bf-header .uk-container,
.bf-header .uk-navbar {
  height: 100%;
}

.bf-header .uk-navbar {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* UIkit pulls left/right out by -15px to offset its 15px item padding, which we drop. */
.bf-header.uk-navbar-container > .uk-container .uk-navbar-left,
.bf-header.uk-navbar-container > .uk-container .uk-navbar-right {
  margin-left: 0;
  margin-right: 0;
}

/* ---- Logo ---- */

.bf-header .bf-header__logo {
  min-height: 0;
  padding: 0;
  line-height: 0;
}

.bf-header__logo img {
  display: block;
  width: auto;
  height: 30px;
  max-width: none;
}

.bf-header .bf-header__logo:focus-visible,
.bf-header .uk-navbar-nav > li > a:focus-visible,
.bf-header .bf-header__locale:focus-visible,
.bf-header .bf-header__burger:focus-visible {
  outline: 2px solid var(--bf-c-gold);
  outline-offset: 2px;
}

/* ---- Inline nav (desktop only: uk-visible@m) ----
   The maquette centres the nav between logo and actions (flex space-between), not on
   the page: UIkit's absolute .uk-navbar-center is put back into the flow. */

.bf-header .uk-navbar-center:not(:only-child) {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: auto;
  z-index: auto;
}

.bf-header .uk-navbar-nav {
  gap: clamp(10px, 1.6vw, 28px);
}

.bf-header .uk-navbar-nav > li > a {
  display: block;
  min-height: 0;
  padding: 0 0 4px;
  border-bottom: 2px solid transparent;
  font: 400 clamp(13px, 1.15vw, 16px)/1 var(--bf-font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--bf-c-ink-idle);
  transition: color var(--bf-dur) var(--bf-ease);
}

.bf-header .uk-navbar-nav > li:hover > a,
.bf-header .uk-navbar-nav > li > a:focus,
.bf-header .uk-navbar-nav > li.uk-active > a {
  color: var(--bf-c-black);
}

.bf-header .uk-navbar-nav > li.uk-active > a {
  border-bottom-color: var(--bf-c-gold);
}

/* ---- Right-hand actions: CTA, locale trigger (desktop), burger (mobile) ---- */

.bf-header .uk-navbar-right {
  flex-wrap: nowrap;
  gap: 12px;
}

.bf-header__locale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font: 400 15px/1 var(--bf-font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bf-c-ink-idle);
  cursor: pointer;
  transition: color var(--bf-dur) var(--bf-ease);
}

.bf-header__locale:hover,
.bf-header__locale[aria-expanded="true"] {
  color: var(--bf-c-black);
}

.bf-header__locale .fi {
  width: 18px;
  line-height: 13px;
  background-size: cover;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

/* DIN Condensed sits high in its line box: nudge the label onto the flag's centre. */
.bf-header__locale-label {
  padding-top: 2px;
}

/* Burger: maquette padding 12px 4px (WM l.47), a 30×33 hit area; the bars stay centred. */
.bf-header .bf-header__burger {
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  margin: 0;
  padding: 12px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bf-header__burger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--bf-c-black);
}

@media (prefers-reduced-motion: reduce) {
  .bf-header .uk-navbar-nav > li > a,
  .bf-header__locale {
    transition: none;
  }
}

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

@media (min-width: 960px) {
  .bf-header.uk-navbar-container {
    height: var(--bf-header-h-desktop);
  }

  .bf-header .uk-navbar {
    gap: 32px;
  }

  .bf-header__logo img {
    height: clamp(28px, 2.5vw, 36px);
  }

  .bf-header .uk-navbar-right {
    gap: 24px;
  }

  /* The CTA carries bf-btn--sm for mobile; desktop is the maquette's 16px, 14px 20px
     (140x44 in es-es, WD l.51). */
  .bf-header .bf-header__cta {
    font-size: 16px;
    padding: 14px 20px;
  }
}
