/* ============================================================
   AL SOUDANI — Shared Header
   Chargé sur toutes les pages via functions.php
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

/* === VARIABLES === */
:root {
    --background:               #131313;
    --surface:                  #131313;
    --surface-container-low:    #1c1b1b;
    --surface-container:        #20201f;
    --surface-container-high:   #2a2a2a;
    --surface-container-highest:#353535;
    --surface-container-lowest: #0e0e0e;
    --surface-bright:           #393939;
    --on-surface:               #e5e2e1;
    --on-surface-variant:       #e7bdb8;
    --primary:                  #ffb4ab;
    --primary-container:        #e31e24;
    --on-primary:               #4f2500;
    --on-primary-container:     #fffafa;
    --secondary:                #ffb4ab;
    --secondary-container:      #c68315;
    --on-secondary-container:   #3d2400;
    --outline-variant:          #564337;
    --error:                    #ffb4ab;
    --muted:                    #707070;
    --tertiary:                 #c7c6c6;
    --outline:                  #ae8883;
}

/* === LOGOS (spécificité renforcée : WooCommerce force `img { height:auto }` sur panier/commande) === */
.site-nav .brand-logo,
.woocommerce-page .site-nav .brand-logo,
.woocommerce-cart .site-nav .brand-logo,
.woocommerce-checkout .site-nav .brand-logo {
    height: 60px;
    max-height: 60px;
    width: auto;
}

.mob-header .mob-header-logo,
.woocommerce-page .mob-header .mob-header-logo,
.woocommerce-cart .mob-header .mob-header-logo,
.woocommerce-checkout .mob-header .mob-header-logo {
    height: 50px;
    max-height: 50px;
    width: auto;
}

/* === BASE === */
html { scroll-behavior: smooth; }

body {
    background-color: var(--background);
    color: var(--on-surface);
    font-family: 'Inter', sans-serif;
}

body ::selection {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
}

.page-content {
    min-height: 60vh;
    padding: 112px 24px 80px;
}

.page-content > * {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
}

/* ============================================================
   MOBILE HEADER (visible mobile < 768px)
   ============================================================ */
.mob-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    background-color: rgba(19, 19, 19, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 40px 60px -15px rgba(0, 0, 0, 0.3);
    display: flex;
}

.mob-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 4rem;
    width: 100%;
}

.mob-header-btn {
    background: none;
    border: none;
    color: #e5e2e1;
    display: flex;
    align-items: center;
    transition: transform 0.2s, color 0.3s;
}

.mob-header-btn:active { transform: scale(0.95); }
.mob-header-btn:hover  { color: #ffb4ab; }
.mob-header-btn--phone { color: #ffb4ab; }

.mob-header-title {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mob-header-logo {
    height: 50px;
    width: auto;
    display: block;
}

.page-slug-menu .mob-header-logo {
    height: 32px;
}

.woocommerce-shop .mob-header-logo,
.post-type-archive-product .mob-header-logo {
    height: 50px;
}

.mob-language-switcher {
    color: var(--on-surface);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: 'Noto Serif', serif;
}

.mob-language-switcher .is-active{
    color: var(--primary); 
}

.mob-language-switcher .is-active {
    border-bottom: 2px solid var(--primary-container);
    padding-bottom: 4px;
}

.mob-language-switcher a {
    color: var(--on-surface);
    text-transform: uppercase;
}



/* ============================================================
   DESKTOP NAV (visible desktop ≥ 768px)
   ============================================================ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
    background: rgba(19, 19, 19, 0.9);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    display: none;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 32px;
    gap: 24px;
}

.woocommerce-shop .nav-inner,
.post-type-archive-product .nav-inner {
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 60px;
    width: auto;
    display: block;
}

.page-slug-menu .brand-logo {
    height: 36px;
}

.woocommerce-shop .brand-logo,
.post-type-archive-product .brand-logo {
    height: 60px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--on-surface);
    font-family: 'Noto Serif', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links .is-active {
    color: var(--primary);
}

.nav-links .is-active {
    border-bottom: 2px solid var(--primary-container);
    padding-bottom: 4px;
}

.primary-pill {
    border: 0;
    border-radius: 999px;
    background: var(--primary-container);
    color: #fffafa;
    font-weight: 700;
    padding: 8px 24px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.primary-pill:hover  { opacity: 0.92; }
.primary-pill:active { transform: scale(0.95); }

/* ============================================================
   RESPONSIVE SHOW / HIDE
   ============================================================ */
@media (min-width: 768px) {
    .mob-header { display: none; }
    .site-nav   { display: block; }

    .page-content {
        padding-top: 104px;
    }
}

body.admin-bar .site-nav {
    top: 32px;
}

body.admin-bar .mob-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-nav,
    body.admin-bar .mob-header {
        top: 46px;
    }
}

.language-switcher {
    color: var(--on-surface);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: 'Noto Serif', serif;
}

.language-switcher a:hover,
.language-switcher .is-active{
    color: var(--primary);
}

.language-switcher .is-active {
    border-bottom: 2px solid var(--primary-container);
    padding-bottom: 4px;
}

.language-switcher ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-switcher li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-switcher a {
    text-transform: uppercase;
}

/* ============================================================
   SÉLECTEUR DE LANGUE — style « segmenté » + état actif
   ============================================================ */
.language-switcher,
.mob-language-switcher {
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(231, 189, 184, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.language-switcher a,
.mob-language-switcher a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 5px 12px;
    border: 0;
    border-radius: 999px;
    color: var(--on-surface);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.language-switcher a:hover,
.mob-language-switcher a:hover {
    color: var(--primary);
    background: rgba(255, 180, 171, 0.1);
}

.language-switcher a.is-active,
.mob-language-switcher a.is-active {
    border: 0;
    padding-bottom: 5px;
    background: var(--primary-container);
    color: #fffafa;
    box-shadow: 0 4px 14px rgba(227, 30, 36, 0.35);
    cursor: default;
}

.language-switcher a:active,
.mob-language-switcher a:active { transform: scale(0.95); }

.mob-language-switcher a { min-width: 34px; padding: 4px 10px; }

/* ============================================================
   ICÔNE PANIER (menu) + quantité
   ============================================================ */
.al-cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--on-surface);
    border: 1px solid rgba(231, 189, 184, 0.28);
    background: rgba(255, 255, 255, 0.04);
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.25s ease, border-color 0.3s ease;
}

.al-cart-link .material-symbols-outlined { font-size: 22px; }

.al-cart-link:hover {
    color: var(--primary);
    background: rgba(255, 180, 171, 0.1);
    border-color: rgba(255, 180, 171, 0.5);
    transform: translateY(-2px);
}

.al-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-container);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(227, 30, 36, 0.45);
}

.al-cart-count[hidden] { display: none; }

@keyframes alCartPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.al-cart-link.al-cart-bump .al-cart-count { animation: alCartPop 0.45s ease; }

/* Mobile : icône entre la langue et le téléphone */
.al-cart-link--mobile { width: 38px; height: 38px; margin-left: auto; margin-right: 10px; }
.mob-header-inner { gap: 6px; }

/* Desktop : le menu garde ses proportions */
.nav-inner .al-cart-link--desktop { margin-left: auto; }
.nav-inner .al-cart-link--desktop + .primary-pill { margin-left: 0; }
