/* =====================================================================
   HebergHub — header commun heberghub.fr / boutique.heberghub.fr (maquette 4A)
   Source unique : HebergHub-Site-Vitrine/assets/css/hh-header.css
   Copie à l'identique : Theme-HebergHub/views/components/navigation/hh-header-assets.blade.php
   (toute modification ici doit être reportée là-bas, et inversement)
   ===================================================================== */

:root {
    --hh-surface: #f3f4f6;
    --hh-ink: #0A2342;
    --hh-muted: #4b5563;
    --hh-line: rgba(10, 35, 66, .10);
    --hh-tile: #ffffff;
    --hh-cta-bg: #0A2342;
    --hh-cta-ink: #ffffff;
    --hh-menu-bg: #ffffff;
    --hh-menu-hover: #f3f4f6;
    --hh-toggle-bg: rgba(10, 35, 66, .08);
    --hh-orange: #ff4800;
    --hh-hub: #e03f00;
}

html.dark, html[data-theme="dark"], .dark {
    --hh-surface: #0A2342;
    --hh-ink: #ffffff;
    --hh-muted: #cbd5e1;
    --hh-line: rgba(255, 255, 255, .10);
    --hh-tile: rgba(255, 255, 255, .06);
    --hh-cta-bg: #ffffff;
    --hh-cta-ink: #0A2342;
    --hh-menu-bg: #13294b;
    --hh-menu-hover: rgba(255, 255, 255, .07);
    --hh-toggle-bg: rgba(255, 255, 255, .10);
}

.hh-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--hh-surface);
    color: var(--hh-ink);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    border-bottom: 1px solid transparent;
    transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.hh-header.is-scrolled {
    border-bottom-color: var(--hh-line);
    box-shadow: 0 8px 24px -16px rgba(10, 35, 66, .35);
}
.hh-header *, .hh-header *::before, .hh-header *::after { box-sizing: border-box; }

.hh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1680px;
    margin: 0 auto;
    padding: 28px 56px;
}
/* Hauteur constante au défilement : un header qui rétrécit décale toute la page et la fait vibrer */

.hh-header a { text-decoration: none; }
.hh-header a:hover { text-decoration: none; }

.hh-logo {
    font: 700 20px/1 'Poppins', system-ui, sans-serif;
    color: var(--hh-ink) !important;
    letter-spacing: 0;
    white-space: nowrap;
}
.hh-logo span { color: var(--hh-hub) !important; }

.hh-links {
    display: flex;
    gap: 28px;
    font: 500 14px/1 'Poppins', system-ui, sans-serif;
}
.hh-links a {
    color: var(--hh-ink) !important;
    opacity: .85;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: opacity .2s ease, border-color .2s ease;
}
.hh-links a:hover, .hh-links a[aria-current="page"] {
    opacity: 1;
    border-bottom-color: var(--hh-orange);
}

.hh-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Interrupteur clair / sombre (repris du site : pastille orange qui glisse) */
.hh-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    min-width: 60px;
    height: 30px;
    padding: 0 7px;
    border: 0;
    border-radius: 15px;
    background: var(--hh-toggle-bg);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, .15);
    color: var(--hh-ink);
    cursor: pointer;
    flex-shrink: 0;
}
.hh-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hh-orange);
    transition: transform .3s ease;
}
html.dark .hh-toggle::after, html[data-theme="dark"] .hh-toggle::after, .dark .hh-toggle::after {
    transform: translateX(30px);
}
.hh-toggle svg { position: relative; z-index: 1; width: 14px; height: 14px; }
.hh-toggle:focus-visible, .hh-cta:focus-visible, .hh-burger:focus-visible {
    outline: 2px solid var(--hh-orange);
    outline-offset: 2px;
}

/* Boutons espace client */
.hh-client { position: relative; display: flex; align-items: center; gap: 14px; }
.hh-signup {
    font: 500 14px/1 'Poppins', system-ui, sans-serif;
    color: var(--hh-ink) !important;
    opacity: .85;
    white-space: nowrap;
}
.hh-signup:hover { opacity: 1; color: var(--hh-orange) !important; }

.hh-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 0;
    border-radius: 9999px;
    background: var(--hh-cta-bg);
    color: var(--hh-cta-ink) !important;
    font: 600 14px/1.2 'Poppins', system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .3s ease, opacity .3s ease, background-color .3s ease;
}
.hh-cta:hover { transform: translateY(-2px); opacity: .92; color: var(--hh-cta-ink) !important; }
.hh-cta--user { padding: 6px 14px 6px 6px; }
.hh-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--hh-orange);
    color: #fff;
    font: 700 12px/1 'Poppins', system-ui, sans-serif;
    text-transform: uppercase;
}
.hh-avatar svg { width: 14px; height: 14px; }
.hh-chevron { width: 14px; height: 14px; transition: transform .2s ease; }
.hh-cta--user[aria-expanded="true"] .hh-chevron { transform: rotate(180deg); }

.hh-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 230px;
    padding: 8px;
    border: 1px solid var(--hh-line);
    border-radius: 16px;
    background: var(--hh-menu-bg);
    box-shadow: 0 20px 40px -12px rgba(10, 35, 66, .35);
    z-index: 60;
}
.hh-menu[hidden] { display: none; }
.hh-menu-head {
    padding: 8px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--hh-line);
    font: 600 13px/1.3 'Poppins', system-ui, sans-serif;
    color: var(--hh-ink);
}
.hh-menu-head small { display: block; font-weight: 400; opacity: .65; }
.hh-menu a, .hh-menu .hh-logout button {
    all: unset;
    box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    font: 500 14px/1.2 'Poppins', system-ui, sans-serif;
    color: var(--hh-ink) !important;
    cursor: pointer;
}
.hh-menu a:hover, .hh-menu .hh-logout button:hover { background: var(--hh-menu-hover); }
.hh-menu .hh-logout { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--hh-line); }
.hh-menu .hh-logout a, .hh-menu .hh-logout button { color: var(--hh-orange) !important; font-weight: 600; }

/* Emplacement des actions propres à la boutique (panier, notifications) */
.hh-extra { display: flex; align-items: center; gap: 8px; color: var(--hh-ink); }
.hh-extra:empty { display: none; }
.hh-extra a { color: var(--hh-ink) !important; }

/* Lien Administration (comptes avec un rôle) */
.hh-menu a.hh-admin { margin-top: 4px; border-top: 1px solid var(--hh-line); border-radius: 0 0 10px 10px; padding-top: 12px; color: var(--hh-orange) !important; font-weight: 600; }
.hh-mobile a.hh-admin { color: var(--hh-orange) !important; font-weight: 600; }

/* Panier (boutique) : pastille orange avec le nombre d'articles */
.hh-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--hh-toggle-bg);
    color: var(--hh-ink) !important;
    flex-shrink: 0;
    text-decoration: none !important;
}
.hh-cart[hidden] { display: none; }
.hh-cart svg { width: 20px; height: 20px; }
.hh-cart:hover { color: var(--hh-orange) !important; }
.hh-cart:focus-visible { outline: 2px solid var(--hh-orange); outline-offset: 2px; }
.hh-cart-n {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    background: var(--hh-orange);
    color: #fff;
    font: 600 11px/18px 'Poppins', system-ui, sans-serif;
    text-align: center;
}

/* Mobile */
.hh-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--hh-toggle-bg);
    color: var(--hh-ink);
    cursor: pointer;
}
.hh-burger svg { width: 22px; height: 22px; }
.hh-burger .hh-ico-close { display: none; }
.hh-burger[aria-expanded="true"] .hh-ico-open { display: none; }
.hh-burger[aria-expanded="true"] .hh-ico-close { display: block; }

.hh-mobile {
    border-top: 1px solid var(--hh-line);
    padding: 12px 20px 20px;
}
.hh-mobile[hidden] { display: none; }
.hh-mobile a, .hh-mobile .hh-logout button {
    all: unset;
    box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 12px 8px;
    font: 500 16px/1.2 'Poppins', system-ui, sans-serif;
    color: var(--hh-ink) !important;
    cursor: pointer;
    border-bottom: 1px solid var(--hh-line);
}
.hh-mobile .hh-mobile-client { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.hh-mobile .hh-mobile-client a.hh-cta { justify-content: center; border-bottom: 0; padding: 14px 20px; color: var(--hh-cta-ink) !important; font-weight: 600; }
.hh-mobile .hh-mobile-client a.hh-signup { text-align: center; border-bottom: 0; }
.hh-mobile .hh-logout button { color: var(--hh-orange) !important; font-weight: 600; border-bottom: 0; }

@media (max-width: 1100px) {
    .hh-bar { padding-left: 32px; padding-right: 32px; }
    .hh-links { gap: 20px; }
}
@media (max-width: 1023px) {
    .hh-bar { padding: 16px 20px; }
    .hh-links, .hh-client { display: none; }
    .hh-burger { display: inline-flex; }
}
@media (min-width: 1024px) {
    .hh-mobile { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    .hh-header, .hh-bar, .hh-toggle::after, .hh-cta { transition: none; }
    .hh-cta:hover { transform: none; }
}
