/*
 * Header modèle 2 (Theme Builder › Header › Modèle 2) — partial themes/builder/partials/headers/header-model-2.blade.php
 * Chargé uniquement quand ce modèle est actif. Toutes les règles sont préfixées .tlh2 pour ne rien changer ailleurs.
 * Couleurs : --tlh2-bg / --tlh2-text (couleurs du header du Theme Builder), --main-color (couleur principale).
 */
.tlh2 {
  --tlh2-accent: var(--main-color, #E16923);
  --tlh2-accent-dark: color-mix(in srgb, var(--tlh2-accent) 82%, #000);
  --tlh2-accent-soft: color-mix(in srgb, var(--tlh2-accent) 10%, #fff);
  --tlh2-line: color-mix(in srgb, var(--tlh2-text) 12%, transparent);
  --tlh2-muted: color-mix(in srgb, var(--tlh2-text) 62%, transparent);
  --tlh2-topbar-h: 38px;
  --tlh2-bar-h: 78px;
  position: relative;
  z-index: 60;
  width: 100%;
  background: var(--tlh2-bg) !important;
  color: var(--tlh2-text);
  font-size: 15px;
  line-height: 1.4;
}
.tlh2 *, .tlh2 *::before, .tlh2 *::after { box-sizing: border-box; }
.tlh2 a { color: inherit; text-decoration: none; }
.tlh2 svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tlh2 .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tlh2 :focus-visible { outline: 3px solid var(--tlh2-accent); outline-offset: 2px; border-radius: 8px; }
.tlh2-wrap { display: flex; align-items: center; }

/* ── En-tête fixe : la barre de contact défile, la barre principale reste visible ── */
.tlh2--sticky { position: sticky; top: 0; }
.tlh2--sticky.tlh2--has-topbar { top: calc(-1 * var(--tlh2-topbar-h)); }

/* ── Barre de contact ── */
.tlh2-topbar {
  background: var(--tlh2-text);
  color: var(--tlh2-bg);
  font-size: 12.5px;
}
.tlh2-topbar-inner { justify-content: space-between; gap: 16px; min-height: var(--tlh2-topbar-h); }
.tlh2-topbar-contact { display: flex; gap: 22px; flex-wrap: wrap; min-width: 0; }
.tlh2-topbar-contact a { display: inline-flex; align-items: center; gap: 7px; opacity: .88; transition: opacity .15s; }
.tlh2-topbar-contact a:hover { opacity: 1; }
.tlh2-topbar-contact svg { width: 14px; height: 14px; flex: none; color: var(--tlh2-accent); }
.tlh2-topbar-selects { display: flex; gap: 6px; margin-inline-start: auto; }
/* Sélecteur renforcé + !important sur la taille : les styles globaux des <select> du site l'écrasent sinon */
.tlh2 .tlh2-topbar .tlh2-select select {
  appearance: none; -webkit-appearance: none;
  height: auto; min-height: 0; margin: 0; box-shadow: none;
  background-color: transparent; color: inherit; border: 1px solid color-mix(in srgb, var(--tlh2-bg) 28%, transparent);
  border-radius: 999px; padding: 3px 24px 3px 10px;
  font-family: inherit; font-size: 12.5px !important; line-height: 1.4; font-weight: 600; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 52%, calc(100% - 8px) 52%;
  background-size: 4px 4px; background-repeat: no-repeat;
}
.tlh2-select option { color: #1e1e22; }
@media (max-width: 640px) {
  .tlh2-topbar-contact a:nth-child(2) { display: none; }
}

/* ── Barre principale ── */
.tlh2-main { background: var(--tlh2-bg); border-bottom: 1px solid var(--tlh2-line); }
.tlh2--sticky .tlh2-main { background: color-mix(in srgb, var(--tlh2-bg) 94%, transparent); backdrop-filter: blur(12px); }
.tlh2-bar { position: relative; gap: 24px; min-height: var(--tlh2-bar-h); }
.tlh2-logo { display: inline-flex; align-items: center; flex: none; }
.tlh2-logo img { height: 46px; width: auto; max-width: 190px; object-fit: contain; }
.tlh2-logo-text { font-weight: 800; font-size: 18px; }

.tlh2-nav { margin-inline-start: 8px; align-self: stretch; display: flex; min-width: 0; }
.tlh2-nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 2px; }
.tlh2-item { position: relative; display: flex; align-items: center; }
.tlh2-item.tlh2-is-mega { position: static; }
.tlh2-link {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 9px 14px; border: 0; border-radius: 999px; background: transparent;
  color: var(--tlh2-text); font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: background .15s, color .15s;
}
.tlh2-link:hover,
.tlh2-has-sub:hover > .tlh2-link,
.tlh2-has-sub:focus-within > .tlh2-link,
.tlh2-has-sub.is-open > .tlh2-link { background: var(--tlh2-accent-soft); color: var(--tlh2-accent-dark); }
.tlh2--active-underline .tlh2-link.is-active { background: var(--tlh2-text); color: var(--tlh2-bg); }
.tlh2-chev { width: 14px; height: 14px; transition: transform .2s; }
.tlh2-has-sub:hover .tlh2-chev,
.tlh2-has-sub:focus-within .tlh2-chev,
.tlh2-has-sub.is-open .tlh2-chev { transform: rotate(180deg); }

/* Sous-menus */
.tlh2-sub {
  position: absolute; top: 100%; z-index: 70;
  background: #fff; color: #1e1e22;
  border: 1px solid #ece7e2; border-radius: 20px;
  box-shadow: 0 30px 60px -24px rgba(23, 23, 27, .35);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.tlh2-has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.tlh2-has-sub:hover > .tlh2-sub,
.tlh2-has-sub:focus-within > .tlh2-sub,
.tlh2-has-sub.is-open > .tlh2-sub { opacity: 1; visibility: visible; transform: none; }

.tlh2-drop { inset-inline-start: 0; margin-top: 6px; min-width: 270px; padding: 8px; display: grid; }
.tlh2-drop--wide { grid-template-columns: 1fr 1fr; min-width: 520px; }
.tlh2-drop-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.tlh2-drop-link svg { width: 16px; height: 16px; flex: none; opacity: 0; transform: translateX(-4px); transition: .15s; color: var(--tlh2-accent); }
.tlh2-drop-link:hover { background: var(--tlh2-accent-soft); color: var(--tlh2-accent-dark); }
.tlh2-drop-link:hover svg { opacity: 1; transform: none; }

.tlh2-mega { inset-inline: 0; padding: 26px; }
.tlh2-mega-cols { display: grid; grid-template-columns: repeat(var(--tlh2-cols, 3), minmax(0, 1fr)); gap: 28px; }
.tlh2-mega-col { display: grid; gap: 2px; align-content: start; min-width: 0; }
.tlh2-mega-title {
  margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tlh2-accent);
}
.tlh2-mega-link {
  padding: 8px 10px; margin-inline: -10px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; line-height: 1.35; transition: background .15s, color .15s;
}
.tlh2-mega-link:hover { background: var(--tlh2-accent-soft); color: var(--tlh2-accent-dark); }

/* Actions */
.tlh2-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.tlh2-icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--tlh2-line); background: transparent; color: var(--tlh2-text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tlh2-icon-btn:hover { background: var(--tlh2-accent-soft); border-color: transparent; }
.tlh2-icon-btn svg { width: 19px; height: 19px; }
.tlh2-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  /* bordure transparente sur tous les boutons : même hauteur avec ou sans contour (Connexion / S'inscrire) */
  border: 1.5px solid transparent; border-radius: 999px; padding: 10px 20px; line-height: 1.4;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s, color .15s;
}
.tlh2-btn:hover { transform: translateY(-1px); }
.tlh2-btn svg { width: 16px; height: 16px; }
.tlh2-btn--brand { background: var(--tlh2-accent); color: #fff !important; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--tlh2-accent) 70%, transparent); }
.tlh2-btn--brand:hover { background: var(--tlh2-accent-dark); }
.tlh2-btn--ghost { background: transparent; color: var(--tlh2-text); border-color: var(--tlh2-line); }
.tlh2-btn--ghost:hover { border-color: var(--tlh2-text); }
.tlh2-btn--dark { background: var(--tlh2-text); color: var(--tlh2-bg) !important; }
.tlh2-burger, .tlh2-mobile-only { display: none; }

/* Menu compte (client connecté) : icône + prénom, sous-menu aligné à droite */
.tlh2-account-btn { gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--tlh2-line); }
.tlh2-account-icon {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--tlh2-accent-soft); color: var(--tlh2-accent-dark);
}
.tlh2-account-icon svg { width: 18px; height: 18px; }
.tlh2-account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.tlh2-account-drop { inset-inline-start: auto; inset-inline-end: 0; min-width: 230px; }
.tlh2-account-logout { margin-top: 4px; border-top: 1px solid #ece7e2; border-radius: 0 0 12px 12px; color: #b91c1c; }
.tlh2-account-logout:hover { background: #fef2f2; color: #b91c1c; }
.tlh2-account-logout svg { color: #b91c1c; }
.tlh2-drawer-account { text-align: center; font-weight: 800; font-size: 16px; }

@media (max-width: 1180px) {
  .tlh2-link { padding: 9px 10px; font-size: 14px; }
  .tlh2-actions .tlh2-btn--ghost { display: none; }
}
@media (max-width: 1080px) {
  .tlh2 { --tlh2-bar-h: 68px; }
  .tlh2-nav, .tlh2-desktop-only { display: none !important; }
  .tlh2-burger, .tlh2-mobile-only { display: grid; }
  .tlh2-logo img { height: 40px; }
}
@media (max-width: 640px) {
  .tlh2-account-btn { padding: 4px; }
  .tlh2-account-name, .tlh2-account-btn .tlh2-chev { display: none; }
}

/* ── Mode transparent (au-dessus du slider de la page d'accueil) ── */
.tlh2--transparent { position: absolute; inset-inline: 0; top: 0; background: transparent !important; color: #fff; }
.tlh2--transparent .tlh2-topbar { background: rgba(0, 0, 0, .28); color: #fff; }
.tlh2--transparent .tlh2-topbar .tlh2-select select { border-color: rgba(255, 255, 255, .35); }
.tlh2--transparent .tlh2-main { background: transparent; border-color: rgba(255, 255, 255, .18); }
.tlh2--transparent .tlh2-link,
.tlh2--transparent .tlh2-icon-btn,
.tlh2--transparent .tlh2-btn--ghost,
.tlh2--transparent .tlh2-logo-text { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.tlh2--transparent .tlh2-icon-btn,
.tlh2--transparent .tlh2-btn--ghost { border-color: rgba(255, 255, 255, .45); }
.tlh2--transparent .tlh2-btn--dark { background: #fff; color: #1e1e22 !important; }
.tlh2--transparent .tlh2-has-sub:hover > .tlh2-link,
.tlh2--transparent .tlh2-has-sub:focus-within > .tlh2-link { background: rgba(255, 255, 255, .16); color: #fff; }

/* ── Menu mobile ── */
.tlh2-drawer { position: fixed; inset: 0; z-index: 1000; }
.tlh2-drawer[hidden] { display: none; }
.tlh2-drawer-backdrop { position: absolute; inset: 0; background: rgba(15, 15, 18, .5); opacity: 0; transition: opacity .25s; }
.tlh2-drawer-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100%);
  background: #fff; color: #1e1e22; display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px));
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto;
}
html[dir="rtl"] .tlh2-drawer-panel { transform: translateX(-100%); }
.tlh2-drawer.is-open .tlh2-drawer-backdrop { opacity: 1; }
.tlh2-drawer.is-open .tlh2-drawer-panel { transform: none; }
.tlh2-drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #ece7e2; }
.tlh2-drawer-head .tlh2-icon-btn { color: #1e1e22; border-color: #ece7e2; }
.tlh2-drawer-title { font-weight: 800; font-size: 18px; }
.tlh2-drawer-nav { display: grid; gap: 2px; padding-block: 12px; }
.tlh2-acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px; border: 0; border-radius: 12px; background: transparent; color: inherit;
  font: inherit; font-weight: 700; font-size: 17px; text-align: start; cursor: pointer;
}
.tlh2-acc-btn:hover { background: #f8f6f3; }
.tlh2-acc-btn[aria-expanded="true"] { color: var(--tlh2-accent-dark); }
.tlh2-acc-btn[aria-expanded="true"] .tlh2-chev { transform: rotate(180deg); }
.tlh2-acc-panel { display: grid; gap: 2px; padding: 0 0 10px 12px; border-inline-start: 2px solid var(--tlh2-accent-soft); margin-inline-start: 12px; }
.tlh2-acc-panel[hidden] { display: none; }
.tlh2-acc-link, .tlh2-acc-all { padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.tlh2-acc-all { color: var(--tlh2-accent-dark); }
.tlh2-acc-link:hover, .tlh2-acc-all:hover { background: #f8f6f3; }
/* Élément sans lien (titre de sous-menu) : même mise en forme, ni curseur ni survol de lien */
.tlh2-nolink { cursor: default; }
.tlh2-drop-link.tlh2-nolink:hover, .tlh2-mega-link.tlh2-nolink:hover, .tlh2-acc-link.tlh2-nolink:hover { background: none; color: inherit; }
.tlh2-acc-group { padding: 12px 12px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--tlh2-accent); }
.tlh2-drawer-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid #ece7e2; }
.tlh2-drawer-foot .tlh2-btn { width: 100%; padding: 13px 20px; }
.tlh2-drawer-foot .tlh2-btn--ghost { color: #1e1e22; border-color: #d8d2cc; }
.tlh2-drawer-foot .tlh2-btn--dark { background: #1e1e22; color: #fff !important; }
.tlh2-drawer-contact { text-align: center; font-size: 14px; color: #6e6e76; }
html.tlh2-lock, html.tlh2-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .tlh2 *, .tlh2 *::before, .tlh2 *::after { transition: none !important; }
}
