/*
 * EURAYSTORE Z2 — header : logo, recherche unique, icones Material.
 * Charge dans _partials/head.tpl juste APRES euray-topbar.css (donc apres le bloc
 * <style id="angarthemeconfigurator-colors">) : specificite egale ou +1 max,
 * zero !important sauf rattrapage d'une cascade legacy en !important (mentionne).
 * Uniquement var(--brand-*) ; le teal --brand-accent reste decoratif, jamais de fond.
 * Mobile <= 767 px : complete euray-mobile-ux.css (ne le repete pas).
 */

/* 1. Logo : dimensions reservees au ratio reel (CLS). Pas de fetchpriority :
 * mesure Lighthouse mobile 2026-11-21 : LCP = texte sur accueil/categorie/fiche,
 * jamais le logo (voir rapport DSN-Z2). decoding="async" dans le markup. */
#_desktop_logo .logo {
  width: 200px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 400 / 171;
}

@media (max-width: 767px) {
  #_desktop_logo .logo {
    aspect-ratio: 400 / 59;
  }
}

/* 2. Recherche : la version mobile devient la version unique, toutes largeurs.
 * Arrondi 14 px, bordure --brand-border-strong, icone --brand-primary,
 * placeholder « Rechercher une offre… » 16 px (dur en FR comme le mobile). */
#header div#search_widget form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 48px;
  padding: 0 4px 0 14px;
  border: 1px solid var(--brand-border-strong);
  border-radius: 14px;
  background: var(--brand-white);
}

#header div#search_widget form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--brand-text);
  font-size: 16px;
}

#header div#search_widget form input[type="text"]::placeholder {
  color: var(--brand-text-muted);
  opacity: 1;
  font-size: 16px;
}

#header div#search_widget form button[type="submit"] {
  position: static;
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: auto;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brand-primary);
  cursor: pointer;
}

/* Variante accrochee au header-nav (configurateur) : memes codes, hauteur compacte. */
.header-nav div#search_widget form {
  min-height: 40px;
}

/* 3. Icones du header : Material Icons partout, --brand-primary.
 * Tue les substitutions fontello d'AngarTheme (recherche \e91a, panier \e905) :
 * les <i class="material-icons"> des TPL parlent enfin eux-memes. */
#header div#search_widget form button i.search,
#header #rwd_menu #menu-icon2 .material-icons,
#header #rwd_menu #search-icon,
#header #rwd_menu #user-icon .material-icons {
  font-family: 'Material Icons';
  color: var(--brand-primary);
}

#header div#search_widget form button i.search {
  font-size: 20px;
  line-height: 1;
}

#header div#search_widget form button i.search::before {
  content: none;
}

/* Panier desktop : bouton PRIMAIRE (decision DSN-021). Texte #ffffff sur
 * --brand-primary #5e2ee6 = 6,98:1, AA OK. */
.cart_style_1 #header div#_desktop_cart .blockcart .header {
  background: var(--brand-primary);
}

.cart_style_1 #header div#_desktop_cart .blockcart .header a.cart_link {
  color: var(--brand-on-primary);
}

.cart_style_1 #header div#_desktop_cart .blockcart .header a.cart_link:hover,
.cart_style_1 #header div#_desktop_cart .blockcart .header a.cart_link:active {
  background: var(--brand-primary-hover);
}

#header .blockcart .header a.cart_link > i {
  font-family: 'Material Icons';
  color: var(--brand-on-primary);
}

#header .blockcart .header a.cart_link > i::before {
  content: none;
}

/* 4. Cibles 44 px en (pointer: coarse) uniquement, comme Z1 (souris inchangee). */
@media (pointer: coarse) {
  #header div#search_widget form button[type="submit"] {
    min-width: 44px;
    min-height: 44px;
  }

  #header .blockcart .header a.cart_link {
    min-height: 44px;
  }

  #header #rwd_menu .rwd_menu_item {
    min-width: 44px;
    min-height: 44px;
  }

  body:not(#checkout) .euray-mobile-search button,
  .euray-mobile-home__search button {
    width: 44px;
    height: 44px;
  }
}

/* 5. Focus clavier visible, anneau --brand-focus-ring, comme Z1. */
#header div#search_widget form input[type="text"]:focus-visible,
#header div#search_widget form button[type="submit"]:focus-visible,
#header .blockcart .header a.cart_link:focus-visible,
#header #rwd_menu .rwd_menu_item:focus-visible,
#mobile-app-bottom-nav a:focus-visible,
nav.header-nav .lang_currency_top button:focus-visible {
  outline: none;
  box-shadow: var(--brand-focus-ring);
  border-radius: var(--brand-radius-sm);
}

#header div#search_widget form:focus-within {
  border-color: var(--brand-primary);
  box-shadow: var(--brand-focus-ring);
}
