/* Topbar : le nombre de messages détermine la piste, sans case vide. */
.shop-topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    height: 30px;
    padding: 0 var(--space-page);
    background: var(--topbar-bg);
    color: var(--on-media);
    font: 400 var(--text-sm)/30px var(--font-ui);
}
.shop-topbar a { color: inherit; text-decoration: none; }
.shop-topbar__trust, .shop-topbar__phone { display: none; }
.shop-topbar--no-phrases { display: none; }
.shop-topbar__messages { height: 30px; overflow: hidden; text-align: center; }
.shop-topbar__messages > span { display: block; height: 30px; white-space: nowrap; }
.shop-topbar__messages--2 > span { animation: topbar-two 10s ease-in-out infinite; }
.shop-topbar__messages--3 > span { animation: topbar-three 15s ease-in-out infinite; }
/* La dernière ligne clone la première : le retour à 0 est invisible. */
@keyframes topbar-two {
    0%, 40% { transform: translateY(0); }
    50%, 90% { transform: translateY(-100%); }
    100% { transform: translateY(-200%); }
}
@keyframes topbar-three {
    0%, 26% { transform: translateY(0); }
    33%, 59% { transform: translateY(-100%); }
    66%, 92% { transform: translateY(-200%); }
    100% { transform: translateY(-300%); }
}
/* Le header et la navigation restent les templates du parent. */
body .site-header { background: var(--on-media); color: var(--ink); border: 0; }
body .site-header .main-header.col-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 63px;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0 var(--space-page);
}
body .site-header .site-branding { float: none; width: auto; height: auto; margin: 0; padding: 0; }
body .site-header .site-branding .custom-logo-link { display: block; line-height: 0; }
body.wp-custom-logo .site-header .site-branding .custom-logo-link img { display: block; width: auto; height: auto; max-width: 100%; max-height: 43px; }
body .site-header .site-description { display: none; }
.header-actions { display: flex; align-items: center; justify-content: space-between; width: 52px; margin-left: auto; color: var(--ink); }
body .header-actions > a,
body .header-actions > button,
body .header-actions .cart-contents {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: static;
    width: 20px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    line-height: 1;
}
/* Dessins issus des SVG Figma (assets/icons), teintés par currentColor. */
.header-icon,
body .header-actions .shoptimizer-cart-icon {
    display: block;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.header-icon--heart { width: 17px; height: 15px; -webkit-mask-image: url(../icons/header-heart.svg); mask-image: url(../icons/header-heart.svg); }
.header-icon--search { width: 18px; height: 17px; -webkit-mask-image: url(../icons/header-search.svg); mask-image: url(../icons/header-search.svg); }
.header-icon--account { width: 17px; height: 17px; -webkit-mask-image: url(../icons/header-account.svg); mask-image: url(../icons/header-account.svg); }
body .header-actions .shoptimizer-cart-icon { width: 17px; height: 17px; margin: 0; -webkit-mask-image: url(../icons/header-bag.svg); mask-image: url(../icons/header-bag.svg); }
body .header-actions .shoptimizer-cart-icon svg { display: none; }
body .header-actions .header-account,
body .header-actions .site-header-cart { display: none; }
body .header-actions .amount,
body .header-actions .mini-count,
body .header-actions .count { display: none; }
body .header-actions .cart-contents::before,
body .header-actions .cart-contents::after { content: none; }
/* Affichage de la recherche produit déjà rendue par Shoptimizer. */
body .site-header .main-header > .site-search { display: none; }
body.m-search-toggled .site-header .main-header > .site-search {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    margin: 0;
    padding: var(--space-page);
    background: var(--on-media);
    z-index: 11;
}
@media (max-width: 1199px) {
    body .site-header .site-branding .custom-logo-link { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
    body .site-header .site-branding .menu-toggle { display: block; position: static; width: 22px; height: 30px; padding: 0; background: transparent; }
    body .site-header .menu-toggle .bar-text { display: none; }
    body .site-header .menu-toggle .bar { background: var(--ink); }
}
@media (min-width: 1200px) {
    .shop-topbar { grid-template-columns: 1fr 2fr 1fr; padding: 0 var(--space-page-lg); }
    .shop-topbar--no-phrases { display: grid; }
    .shop-topbar__trust, .shop-topbar__phone { display: block; }
    .shop-topbar__stars { display: inline-block; width: 80px; height: 15px; margin-right: 10px; vertical-align: middle; }
    .shop-topbar__note { vertical-align: middle; }
    .shop-topbar__phone { text-align: right; }
    .shop-topbar__phone a { display: inline-flex; align-items: center; gap: 6px; }
    .shop-topbar__phone img { width: 24px; height: 16px; object-fit: cover; }
    body .site-header .site-branding .menu-toggle { display: none; }
    .header-actions { width: 129px; }
    body .header-actions .header-account { display: inline-flex; }
    body .header-actions .site-header-cart { display: block; float: none; width: 20px; margin: 0; padding: 0; }
    /* Une seule rangée : logo | menu | actions. Le header et son .main-header n'ont plus de boîte, leurs enfants vont dans la grille. */
    body.header-4:not(.full-width-header) .header-4-container .header-4-inner,
    body.header-4.full-width-header .header-4-container .header-4-inner { display: grid; grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr); grid-template-rows: 74px; grid-auto-rows: 0; align-items: center; position: relative; width: 100%; max-width: none; height: 74px; margin: 0; padding: 0 var(--space-page-lg); }
    body.header-4 .site-header,
    body.header-4 .site-header .main-header.col-full { display: contents; }
    body.wp-custom-logo .site-header .site-branding .custom-logo-link img { max-height: 50px; }
    body.header-4 .site-header .site-branding { grid-column: 1; grid-row: 1; justify-self: start; }
    body.header-4 .col-full-nav { grid-column: 2; grid-row: 1; width: max-content; margin: 0; padding: 0; border: 0; background: var(--on-media); }
    body.header-4 .header-actions { grid-column: 3; grid-row: 1; justify-self: end; margin: 0; }
    body .col-full-nav .shoptimizer-primary-navigation.col-full { display: flex; justify-content: center; align-items: center; height: 74px; min-height: 0; max-width: none; padding: 0; margin: 0; background: var(--on-media); }
    body .col-full-nav .main-navigation { float: none; width: auto; padding: 0; }
    body .col-full-nav .primary-navigation { position: static; display: flex; justify-content: center; width: auto; margin: 0; padding: 0; }
    body .col-full-nav .primary-navigation > .logo-mark { display: none; }
    body .col-full-nav .menu-primary-menu-container > ul { display: flex; justify-content: center; align-items: center; }
    body .col-full-nav .menu-primary-menu-container > ul > li > a { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 74px; line-height: 1.2; font: 400 var(--text-sm)/1.2 var(--font-ui); color: var(--ink); }
    body .col-full-nav .menu-primary-menu-container > ul > li > a::after { content: none; }
    body.header-4 .col-full-nav .main-navigation ul.menu > li.menu-item-has-children > a::after { content: ''; display: block; width: 8px; height: 8px; margin-left: 0; border: solid currentColor; border-width: 0 1px 1px 0; background-color: transparent; -webkit-mask-image: none; mask-image: none; transform: translateY(-2px) rotate(45deg); }
}
/* Étend le palier mobile du parent (992px) au palier du thème enfant. */
@media (min-width: 993px) and (max-width: 1199px) {
    body .col-full-nav { position: fixed; top: 0; bottom: 0; left: -300px; width: 300px; height: 100vh; padding: 0 var(--space-page); overflow: auto; background: var(--on-media); z-index: 102; transition: left .35s; }
    body.mobile-toggled .col-full-nav { left: 0; }
    body .col-full-nav .shoptimizer-primary-navigation { display: block; padding: 0; }
    body .col-full-nav .main-navigation { width: 100%; padding-top: var(--space-page); }
    body .col-full-nav .primary-navigation { display: block; }
    body .col-full-nav .menu-primary-menu-container > ul { display: block; }
    body .col-full-nav .menu-primary-menu-container > ul > li { display: block; float: none; }
    body .col-full-nav .menu-primary-menu-container > ul > li > a { color: var(--ink); line-height: 2.5; }
    body .col-full-nav .logo-mark, body .col-full-nav .mobile-extra { display: none; }
    body .col-full-nav .shoptimizer-mobile-menu { display: block; }
    body .col-full-nav .menu-primary-menu-container:has(+ .shoptimizer-mobile-menu) { display: none; }
    body.mobile-toggled { overflow: hidden; }
    body.mobile-toggled .mobile-overlay { visibility: visible; opacity: 1; }
    body .mobile-menu.close-drawer { display: block; position: fixed; top: 10px; left: 310px; visibility: hidden; }
    body.mobile-toggled .mobile-menu.close-drawer { visibility: visible; }
}
@media (prefers-reduced-motion: reduce) {
    .shop-topbar__messages > span { animation: none; }
}

/* Le layout 4 actif enveloppe les deux hooks ; conserver son conteneur sticky. */
body.header-4 .header-4-container { padding: 0; border: 0; background: var(--on-media); box-shadow: none; }
body.header-4 .header-4-inner { max-width: none; width: 100%; }
body.header-4 .site-header { width: 100%; margin-right: 0; }
body.header-4 .header-4-container .main-header.col-full { padding: 0 var(--space-page); }
@media (min-width: 1200px) {
    body.header-4 .header-4-container .main-header.col-full { padding: 0 var(--space-page-lg); }
}
