/**
 * Header « neuf » ride&co / Giant, assorti au footer photo (footer-photo.css) :
 * même largeur (85rem, marge de 1rem), mêmes arrondis, couleur exacte de la marque.
 * Gabarit : header-neuf.php, script : src/js/header-neuf.js.
 * Au-delà de 1100px menu en ligne (panneaux au survol ou au clic),
 * en dessous menu plein écran avec rubriques en accordéon.
 */

.rh {
    /* ride&co : noir avec touches du vert exact de la marque */
    --rh-bg: #111;
    --rh-pill-bg: #138a6e;
    --rh-pill-ink: #fff;
    /* Touches de couleur (liens « Tout voir », flèche, lien en cours) : le vrai vert */
    --rh-soft: #138a6e;
    /* Textes secondaires */
    --rh-muted: rgba(255, 255, 255, 0.72);
    --rh-line: rgba(255, 255, 255, 0.14);
    --rh-hover: rgba(255, 255, 255, 0.1);
    --rh-bar-h: 4.5rem;
    --rh-gap: 0.75rem;
    --rh-side: 1rem;
    --rh-radius: 1.75rem;
    --rh-admin: 0px;

    /* Fixe et non sticky : le thème met overflow hidden sur body et #page, ce qui casse sticky.
       La place est réservée par .rh-spacer. */
    position: fixed;
    top: var(--rh-admin);
    left: 0;
    right: 0;
    z-index: 1000;
    color: #fff;
    font-size: 1rem;
    pointer-events: none;
    transition: top 0.25s ease;
}

.rh--giant {
    /* Giant : bleu exact de la marque, touches claires */
    --rh-bg: #120A8F;
    --rh-pill-bg: #e2e0ff;
    --rh-pill-ink: #120A8F;
    --rh-soft: #e2e0ff;
    --rh-muted: rgba(255, 255, 255, 0.8);
    --rh-line: rgba(255, 255, 255, 0.2);
    --rh-hover: rgba(255, 255, 255, 0.14);
}

.rh > * {
    pointer-events: auto;
}

/* Menu mobile ouvert : devant les fenêtres des extensions (pub, chat), derrière Axeptio */
.rh.is-menu-open {
    z-index: 2147483000;
}

/* Barre d'admin WordPress : le header se cale dessous */
.admin-bar .rh {
    --rh-admin: 32px;
}

@media (max-width: 782px) {
    .admin-bar .rh {
        --rh-admin: 46px;
    }
}

@media (max-width: 600px) {
    .admin-bar .rh {
        --rh-admin: 0px;
    }
}

.rh-spacer {
    height: var(--rh-total-h, 7.5rem);
}

/* L'ancien header mobile réservait sa place par html body { margin-top: 109px } (style.css) :
   ici c'est .rh-spacer qui s'en charge */
html body.has-rh {
    margin-top: 0;
}

/* Accueil : le header flotte sur la grande photo, sans réserver de place.
   La photo garde sa hauteur pleine (l'ancien calcul retirait les 109px du vieil header mobile). */
.rh-over-hero .rh-spacer,
.rh-over-hero .storefront-breadcrumb {
    display: none;
}

/* L'ancien header remontait la photo de 100px sous lui (.content-area-home et
   .content-area-blog-home, style.css) */
.has-rh .content-area-home,
.has-rh .content-area-blog-home {
    margin-top: 0;
}

/* Ancres et défilements automatiques : ne pas s'arrêter sous le header fixe */
html:has(body.has-rh) {
    scroll-padding-top: calc(var(--rh-total-h, 7.5rem) + 0.5rem);
}

/* Texte « Ride … » de l'accueil : descendu pour respirer sous le header flottant
   (l'ancien header ne recouvrait pas la photo) */
@media (min-width: 769px) {
    .has-rh .fullscreen-image .image-overlay {
        top: 55%;
    }
}

@media (max-width: 768px) {
    .rh-over-hero .fullscreen-image {
        height: 60vh;
    }

    .has-rh .fullscreen-image .image-overlay {
        bottom: 2.5rem;
    }
}

.rh *,
.rh *::before,
.rh *::after {
    box-sizing: border-box;
}

.rh ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rh li {
    margin: 0;
}

.rh li::before {
    content: none;
}

.rh a {
    text-decoration: none;
}

.rh__skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1001;
    padding: 0.75rem 1rem;
    background: #fff;
    color: #111;
}

.rh__skip:focus {
    left: 1rem;
    top: 1rem;
}

/* ─── Offres : onglet raccordé sous la barre ───────────────────────────── */
/* La barre et l'onglet forment une seule forme : même couleur, pas de bordure,
   et deux coins concaves (dégradés radiaux) qui adoucissent la jonction. */

.rh__tab {
    --rh-curve: 1rem;

    position: absolute;
    top: calc(var(--rh-bar-h) - 1px);
    left: 50%;
    z-index: 1;
    width: max-content;
    /* Jamais au-delà du bas droit de la barre : les courbes ne doivent pas toucher ses coins arrondis */
    max-width: calc(100% - 2 * var(--rh-side) - 2 * var(--rh-radius) - 2 * var(--rh-curve));
    padding: 0.375rem 1.25rem 0.5rem;
    color: #fff;
    background: var(--rh-bg);
    border-radius: 0 0 1.125rem 1.125rem;
    transform: translateX(-50%);
}

.rh__tab::before,
.rh__tab::after {
    content: "";
    position: absolute;
    /* Remonte d'1px sous la barre : pas de liseré clair à la jonction */
    top: -1px;
    width: var(--rh-curve);
    height: calc(var(--rh-curve) + 1px);
}

.rh__tab::before {
    right: 100%;
    background: radial-gradient(circle at 0 100%, transparent calc(var(--rh-curve) - 0.5px), var(--rh-bg) var(--rh-curve));
}

.rh__tab::after {
    left: 100%;
    background: radial-gradient(circle at 100% 100%, transparent calc(var(--rh-curve) - 0.5px), var(--rh-bg) var(--rh-curve));
}

.rh .rh__promo-msg {
    /* Taille fixée par le script (message le plus long) : le texte reste centré dedans */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    color: #fff;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.rh .rh__promo-msg.is-out {
    opacity: 0;
    transform: translateY(-4px);
}

.rh .rh__promo-msg a,
.rh .rh__promo-msg span {
    color: inherit;
    text-decoration: none;
}

/* Flèche après une offre cliquable, collée au dernier mot (espace insécable) */
.rh .rh__promo-msg a::after {
    content: "\00a0\00a0→";
    color: var(--rh-soft);
}

.rh .rh__promo-msg a:hover {
    color: var(--rh-soft);
}

/* ─── Barre principale : panneau de verre, comme le footer ───────────────── */

.rh__bar {
    position: relative;
    max-width: calc(85rem + 2 * var(--rh-side));
    margin: var(--rh-gap) auto 0;
    padding: 0 var(--rh-side);
}

.rh__bar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: var(--rh-bar-h);
    padding: 0 0.75rem 0 clamp(1.25rem, 2.5vw, 2rem);
    position: relative;
    z-index: 2;
    background: var(--rh-bg);
    border-radius: var(--rh-radius);
}

/* Ombre portée commune à la barre et à l'onglet (desktop seulement : un filter
   enfermerait le menu plein écran du mobile) */
@media (min-width: 1101px) {
    .rh__bar {
        filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.28));
    }
}

.rh__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.rh .rh__logo img {
    display: block;
    width: auto;
    height: 1.75rem;
    max-width: none;
}

.rh--giant .rh__logo img {
    height: 2.25rem;
}

/* ─── Menu (desktop) ─────────────────────────────────────────────────────── */

.rh__nav {
    flex: 1 1 auto;
    min-width: 0;
}

.rh__nav-head,
.rh__nav-foot {
    display: none;
}

.rh__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
}

.rh .rh__top {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 2.5rem;
    margin: 0;
    padding: 0 0.8rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    background: none;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.rh .rh__top:hover,
.rh .rh__top[aria-expanded="true"] {
    color: #fff;
    background: var(--rh-hover);
}

/* Rubrique de la page en cours : pastille claire */
.rh .rh__item.is-active > .rh__top,
.rh .rh__top[aria-current="page"] {
    color: var(--rh-pill-ink);
    background: var(--rh-pill-bg);
}

.rh__chevron {
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.rh__top[aria-expanded="true"] .rh__chevron {
    transform: rotate(180deg);
}

/* Petits menus déroulants : carte de verre sous la rubrique */
.rh__item {
    position: relative;
}

.rh__panel {
    position: absolute;
    top: calc(100% + 1.125rem);
    left: 0;
    z-index: 10;
    min-width: 15rem;
    padding: 0.5rem;
    background: var(--rh-bg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.25rem;
    box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* Pont invisible : le survol tient entre la rubrique et le panneau */
.rh__panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 1.25rem;
}

.rh__item.is-open > .rh__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.rh .rh__sublink,
.rh .rh__see-all.rh__see-all--drop {
    display: block;
    padding: 0.6rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.3;
    color: #fff;
    border-radius: 0.625rem;
}

.rh .rh__sublink:hover,
.rh .rh__see-all.rh__see-all--drop:hover {
    color: #fff;
    background: var(--rh-hover);
}

.rh .rh__sublink[aria-current="page"] {
    color: var(--rh-soft);
    font-weight: 600;
}

.rh .rh__see-all.rh__see-all--drop {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--rh-soft);
    border-bottom: 1px solid var(--rh-line);
    border-radius: 0.625rem 0.625rem 0 0;
}

.rh .rh__sub3 {
    padding: 0 0 0.25rem 0.75rem;
}

.rh .rh__sub3 a {
    display: block;
    padding: 0.3rem 0.75rem;
    font-size: 0.875rem;
    color: var(--rh-muted);
}

.rh .rh__sub3 a:hover {
    color: #fff;
}

/* Mega menu : carte de la largeur de la barre */
.rh__item--mega {
    position: static;
}

.rh__panel--mega {
    left: var(--rh-side);
    right: var(--rh-side);
    top: calc(100% + 0.5rem);
    padding: 0;
    border-radius: var(--rh-radius);
}

.rh__panel--mega::before {
    height: 0.75rem;
}

.rh__panel--mega .rh__panel-inner {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr) 17rem;
    gap: 2.5rem;
    padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.75rem, 3.5vw, 3rem);
}

.rh .rh__mega-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #fff;
}

.rh .rh__see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rh-soft);
}

.rh .rh__see-all:hover {
    color: #fff;
}

.rh .rh__see-all svg {
    transition: transform 0.2s ease;
}

.rh .rh__see-all:hover svg {
    transform: translateX(3px);
}

.rh__sub--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.125rem 1rem;
    align-content: start;
}

.rh__mega-card {
    align-self: start;
    padding: 1.25rem;
    background: var(--rh-hover);
    border: 1px solid var(--rh-line);
    border-radius: 1.25rem;
}

.rh .rh__mega-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.rh .rh__mega-card-text {
    margin: 0.375rem 0 1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--rh-muted);
}

/* Mêmes boutons que « Nous joindre » dans le footer */
.rh .rh__mega-card-btn,
.rh .rh__nav-call,
.rh .rh__nav-contact {
    display: block;
    padding: 0.6875rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: #fff;
    background: var(--rh-hover);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.rh .rh__mega-card-btn:hover,
.rh .rh__nav-call:hover,
.rh .rh__nav-contact:hover {
    color: var(--rh-pill-ink);
    background: var(--rh-pill-bg);
    border-color: var(--rh-pill-bg);
}

.rh .rh__mega-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rh-soft);
}

.rh .rh__mega-card-link:hover {
    color: #fff;
}

/* ─── Icônes ─────────────────────────────────────────────────────────────── */
/* Classes cart-icon / comparator-icon gardées pour custom-cart.js et comparator.js :
   on neutralise ici le style de l'ancien header (images de fond, marges). */

.rh__icons {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.rh .rh__icon.rh__icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    color: #fff;
    background: var(--rh-hover);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.rh .rh__icon.rh__icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.rh .rh__icon .cart-count,
.rh .rh__icon .comparator-count {
    position: absolute;
    top: 0.125rem;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 1.125rem;
    width: auto;
    height: 1.125rem;
    padding: 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    color: var(--rh-pill-ink);
    background: var(--rh-pill-bg);
    border-radius: 999px;
}

.rh__burger {
    display: none;
}

/* ─── Focus clavier ──────────────────────────────────────────────────────── */

.rh a:focus-visible,
.rh button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ─── Écrans moyens : menu plus serré ────────────────────────────────────── */

@media (max-width: 1280px) and (min-width: 1101px) {
    .rh__bar-inner {
        gap: 0.75rem;
    }

    .rh .rh__top {
        padding: 0 0.55rem;
        font-size: 0.875rem;
    }

    .rh__panel--mega .rh__panel-inner {
        grid-template-columns: 11rem minmax(0, 1fr) 15rem;
        gap: 1.75rem;
    }
}

/* ─── Tablette et mobile : menu plein écran ──────────────────────────────── */

@media (max-width: 1100px) {
    .rh {
        --rh-bar-h: 3.75rem;
        --rh-gap: 0.5rem;
        --rh-radius: 1.25rem;
    }

    .rh-spacer {
        height: var(--rh-total-h, 7.25rem);
    }

    .rh__bar-inner {
        gap: 0.5rem;
        padding: 0 0.375rem 0 1.125rem;
    }

    .rh__tab {
        --rh-curve: 0.75rem;
        padding: 0.3rem 0.75rem 0.4rem;
    }

    .rh .rh__promo-msg {
        font-size: 0.6875rem;
        line-height: 1.25;
    }

    .rh .rh__logo img {
        height: 1.375rem;
    }

    .rh--giant .rh__logo img {
        height: 1.875rem;
    }

    .rh__burger {
        display: inline-grid;
        align-content: center;
        justify-items: center;
        gap: 5px;
        width: 2.75rem;
        height: 2.75rem;
        margin: 0;
        padding: 0;
        background: var(--rh-hover);
        border: 0;
        border-radius: 999px;
        cursor: pointer;
    }

    .rh__burger span {
        display: block;
        width: 1.25rem;
        height: 2px;
        background: #fff;
        border-radius: 2px;
    }

    .rh__nav {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 1002;
        display: flex;
        flex-direction: column;
        width: min(26rem, 100%);
        background: var(--rh-bg);
        box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.5);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0s linear 0.28s;
    }

    .rh.is-menu-open .rh__nav {
        transform: none;
        visibility: visible;
        transition: transform 0.28s ease;
    }

    /* z-index 1 : sous la barre (z-index 2) qui porte le menu plein écran, sinon le voile le grise */
    .rh__backdrop {
        position: fixed;
        inset: 0;
        z-index: 1;
        background: rgba(0, 0, 0, 0.5);
    }

    .rh__nav-head {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 4.25rem;
        padding: 0 0.75rem 0 1.25rem;
        border-bottom: 1px solid var(--rh-line);
    }

    .rh__nav-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--rh-soft);
    }

    .rh .rh__close {
        display: grid;
        place-items: center;
        width: 2.75rem;
        height: 2.75rem;
        margin: 0;
        padding: 0;
        color: #fff;
        background: var(--rh-hover);
        border: 0;
        border-radius: 999px;
        cursor: pointer;
    }

    .rh__menu {
        flex: 1 1 auto;
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0.5rem 0;
    }

    .rh__item,
    .rh__item--mega {
        position: static;
        border-bottom: 1px solid var(--rh-line);
    }

    .rh .rh__top {
        display: flex;
        justify-content: space-between;
        width: 100%;
        height: auto;
        padding: 1rem 1.25rem;
        font-size: 1.0625rem;
        text-align: left;
        border-radius: 0;
    }

    .rh .rh__item.is-active > .rh__top,
    .rh .rh__top[aria-current="page"] {
        color: var(--rh-soft);
        background: none;
    }

    /* Accordéon : le panneau se déplie dans le flux */
    .rh__panel,
    .rh__panel--mega {
        position: static;
        display: none;
        min-width: 0;
        margin: 0;
        padding: 0 0.75rem 0.75rem;
        background: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .rh__panel::before {
        display: none;
    }

    .rh__item.is-open > .rh__panel {
        display: block;
    }

    .rh__panel--mega .rh__panel-inner {
        display: block;
        padding: 0;
    }

    .rh__mega-head .rh__mega-title,
    .rh__mega-card {
        display: none;
    }

    .rh .rh__see-all {
        margin: 0 0 0.25rem;
        padding: 0.6rem 0.75rem;
    }

    .rh .rh__see-all.rh__see-all--drop {
        border-bottom: 0;
    }

    .rh__sub--grid {
        display: block;
    }

    .rh__nav-foot {
        flex-shrink: 0;
        display: grid;
        gap: 0.5rem;
        padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--rh-line);
    }

    body.rh-lock {
        overflow: hidden;
    }
}

/* Même marge que le footer sur mobile */
@media (max-width: 640px) {
    .rh {
        --rh-side: 0.75rem;
    }
}

@media (max-width: 400px) {
    .rh .rh__icon.rh__icon,
    .rh__burger {
        width: 2.5rem;
        height: 2.5rem;
    }
}

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