/* ============================================================
   NAV.PHP + FOOTER.PHP — CSS partagé, site entier
   Identité marine / blanc / rouge, ruban tricolore en signature.
   Chargé en absolu (/styles/nav-footer.css) pour fonctionner
   depuis n'importe quel sous-dossier du site.
============================================================ */

/* Tokens (:root), reset du body, focus visible et apparition au scroll (.reveal)
   vivent désormais dans styles/base.css, chargé avant cette feuille. */

/* Transition douce native entre deux pages (Chrome/Edge récents — se
   dégrade en navigation normale ailleurs, aucun JS ni framework requis). */
@view-transition {
    navigation: auto;
}

/* ── État de chargement générique pour les boutons d'action ── */
.mc-btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.mc-btn-loading::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px;
    margin: -8px 0 0 -8px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
    border-radius: 50%; animation: mc-spin 0.7s linear infinite;
}
.mc-icon-btn.mc-btn-loading::after,
.mc-btn-loading[style*="border"]::after { border-color: rgba(11,30,61,0.25); border-top-color: var(--mc-navy); }
@keyframes mc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .mc-btn-loading::after { animation: none; }
}

/* ── Toast (site-ux.js — mcToast) ──────────────────────────────────────
   Remplace les alert()/confirm() natifs du navigateur par un message à
   l'identité du site : carte blanche, liseré de couleur selon le type,
   apparition/disparition douces, empilable. */
#mc-toast-container {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 10500; /* au-dessus du bandeau cookies (10000) */
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}
.mc-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #ffffff;
    border-left: 4px solid var(--mc-navy);
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(11,30,61,0.18);
    padding: 14px 14px 14px 16px;
    font-size: 0.88rem;
    color: #33455e;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity var(--mc-transition-fast), transform var(--mc-transition-fast);
    pointer-events: auto;
}
.mc-toast-show { opacity: 1; transform: translateY(0) scale(1); }
.mc-toast-error { border-left-color: var(--mc-red); }
.mc-toast-success { border-left-color: #2f9e5b; }
.mc-toast-icone { font-size: 1.05rem; line-height: 1.4; flex-shrink: 0; }
.mc-toast-corps { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mc-toast-texte { line-height: 1.45; }
.mc-toast-action {
    background: var(--mc-navy); color: #fff; border: none; border-radius: 4px;
    padding: 6px 12px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
    transition: background var(--mc-transition-fast);
}
.mc-toast-action:hover { background: var(--mc-navy-2); }
.mc-toast-fermer {
    background: none; border: none; color: #64748b; font-size: 0.8rem; cursor: pointer;
    min-width: 32px; min-height: 32px; padding: 2px 4px; flex-shrink: 0; border-radius: 4px; transition: color 0.15s ease, background 0.15s ease;
}
.mc-toast-fermer:hover { color: var(--mc-navy); background: rgba(11,30,61,0.06); }

@media (max-width: 480px) {
    #mc-toast-container { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .mc-toast { transition: opacity 0.2s linear; transform: none !important; }
}

/* ── Header ── */
.mc-site-header {
    position: sticky;
    top: 0;
    z-index: 5000;
    background: var(--mc-navy);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(to right, var(--mc-navy-2) 0 33.34%, #ffffff 33.34% 66.66%, var(--mc-red) 66.66% 100%) 1;
}
.mc-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    max-width: 1280px;
    margin: 0 auto;
}
.mc-header-side { flex: 1; display: flex; align-items: center; }
.mc-header-side-right { justify-content: flex-end; gap: 6px; }
.mc-header-center { display: flex; align-items: center; height: 100%; flex-shrink: 0; }
.mc-logo-link { display: flex; align-items: center; text-decoration: none; }
.mc-header-logo { height: 76px; width: auto; display: block; vertical-align: middle; }
.mc-logo-fallback {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #ffffff;
    letter-spacing: -0.01em;
    text-decoration: none;
    display: block;
}

/* ── Icônes panier / compte ── */
.mc-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}
.mc-icon-btn:hover { background: rgba(255,255,255,0.1); }

.mc-burger { position: relative; }
.mc-point-messages {
    position: absolute; top: 8px; right: 8px; width: 11px; height: 11px;
    background: var(--mc-red, #c41e3a); border-radius: 50%;
    box-shadow: 0 0 0 2px var(--mc-navy, #0b1e3d);
}
.mc-nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-left: 8px;
    background: var(--mc-red, #c41e3a); color: #fff;
    font-size: 0.68rem; font-weight: 800; line-height: 1;
    border-radius: 20px; vertical-align: middle;
}
.mc-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 16px; height: 16px;
    padding: 0 3px;
    background: var(--mc-red, #c41e3a);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--mc-navy, #0b1e3d);
}

.mc-account-wrap { position: relative; }
.mc-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.16);
    min-width: 220px;
    overflow: hidden;
    z-index: 200;
}
.mc-account-dropdown.show { display: block; }
.mc-account-bonjour {
    padding: 14px 18px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--mc-navy, #0b1e3d);
    border-bottom: 1px solid rgba(11,30,61,0.08);
}
.mc-account-dropdown a {
    display: block;
    padding: 13px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    color: #33455e;
    text-decoration: none;
    transition: background 0.15s ease;
}
.mc-account-dropdown a:hover { background: var(--mc-ivoire, #faf7f2); color: var(--mc-navy, #0b1e3d); }
.mc-account-dropdown a.mc-logout-link { color: var(--mc-red, #c41e3a); border-top: 1px solid rgba(11,30,61,0.08); }
.mc-account-dropdown a.mc-logout-link:hover { background: #fdecef; }

/* Burger : vrai <button> (zone de clic 44×44), les 3 barres sont décoratives */
.mc-burger {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}
.mc-burger:hover { background: rgba(255,255,255,0.1); }
.mc-burger-lines {
    width: 24px;
    height: 17px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mc-burger-lines span {
    display: block;
    height: 2px;
    width: 100%;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.mc-burger.active .mc-burger-lines span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mc-burger.active .mc-burger-lines span:nth-child(2) { opacity: 0; }
.mc-burger.active .mc-burger-lines span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Menu principal : replié = invisible ET non focusable (visibility:hidden) */
.mc-main-nav {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--mc-navy-2);
    transition: max-height 0.3s ease, visibility 0s linear 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mc-main-nav.show { max-height: 400px; visibility: visible; transition-delay: 0s; }
.mc-main-nav a, .mc-main-nav .mc-logout-link {
    display: block;
    width: 100%;
    max-width: 1280px;
    text-align: center;
    padding: 16px 24px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    border-top: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s ease, color 0.2s ease;
}
.mc-main-nav a:hover { background: rgba(255,255,255,0.06); color: #ffffff; }
.mc-main-nav a[aria-current="page"] { color: #ffffff; font-weight: 700; box-shadow: inset 3px 0 0 var(--mc-red); }

/* À partir de 900px : le menu principal est affiché en ligne, le burger disparaît */
@media (min-width: 900px) {
    /* Seule la barre du logo reste collée en haut : le menu (dans le flux) défile
       et disparaît sous elle dès qu'on scrolle. */
    .mc-site-header { display: contents; }
    .mc-header-bar {
        position: sticky;
        top: 0;
        z-index: 5000;
        max-width: none;
        padding-left: max(24px, calc((100% - 1280px) / 2 + 24px));
        padding-right: max(24px, calc((100% - 1280px) / 2 + 24px));
        background: var(--mc-navy);
        border-bottom: 3px solid transparent;
        border-image: linear-gradient(to right, var(--mc-navy-2) 0 33.34%, #ffffff 33.34% 66.66%, var(--mc-red) 66.66% 100%) 1;
    }
    .mc-main-nav { position: relative; z-index: 1; }
    .mc-burger { display: none; }
    .mc-main-nav {
        max-height: none;
        overflow: visible;
        visibility: visible;
        flex-direction: row;
        justify-content: center;
        gap: 4px;
        transition: none;
    }
    .mc-main-nav a, .mc-main-nav .mc-logout-link {
        width: auto;
        max-width: none;
        padding: 12px 28px;
        border-top: none;
    }
    .mc-main-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--mc-red); }
}
@media (prefers-reduced-motion: reduce) {
    .mc-main-nav { transition: none; }
}

/* ── Footer ── */
.mc-site-footer { background: var(--mc-navy); padding: 0 0 40px; }
.mc-footer-ruban {
    height: 4px;
    background: linear-gradient(to right, var(--mc-navy-2) 0 33.34%, #ffffff 33.34% 66.66%, var(--mc-red) 66.66% 100%);
}
.mc-footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 24px 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
}
.mc-footer-col h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    margin: 0 0 16px;
    line-height: 1.3;
    text-align: inherit; /* les feuilles de gabarit produit centrent les h2 : le footer garde son alignement */
}
.mc-footer-brand h2 { font-size: 1.3rem; }
.mc-footer-col p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin: 0 0 6px;
    line-height: 1.6;
}
.mc-footer-credit { color: rgba(255,255,255,0.7) !important; font-size: 0.78rem !important; margin-top: 14px !important; }
/* « Gérer les cookies » : vrai bouton, rendu comme un lien souligné */
.mc-footer-lien-bouton {
    background: none; border: none; padding: 8px 0; margin: 0;
    font: inherit; color: inherit; text-decoration: underline; cursor: pointer;
}
.mc-footer-lien-bouton:hover { color: #ffffff; }
.mc-footer-col ul { list-style: none; margin: 0; padding: 0; }
.mc-footer-col li { margin-bottom: 10px; }
.mc-footer-col a {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.2s ease;
}
.mc-footer-col a { display: inline-block; padding: 4px 0; }
.mc-footer-col a:hover { color: #ffffff; text-decoration: underline; } /* le rouge #c41e3a sur marine n'atteint pas 4.5:1 */
.mc-footer-adresse {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}

.mc-social-icons { display: flex; gap: 14px; }
.mc-social-icons a {
    width: 44px; height: 44px; padding: 0; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}
.mc-social-icons a:hover { background: var(--mc-red); transform: translateY(-2px); }
.mc-social-icons svg { color: #ffffff; display: block; }

@media (max-width: 720px) {
    .mc-footer-container { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
    .mc-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .mc-footer-container { grid-template-columns: 1fr; text-align: center; }
    .mc-social-icons { justify-content: center; }
    .mc-header-logo { height: 52px; }
    .mc-header-bar { padding: 8px 8px 8px 12px; }
    .mc-header-side-right { gap: 0; }
    .mc-header-side-left { flex: 0 0 0; }
    .mc-header-center { margin-right: auto; }
    .mc-account-dropdown { right: -10px; }
}

/* ── Tiroir mini-panier (ouvert à l'ajout d'un article) ── */
.mc-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(11,30,61,0.35);
    z-index: 5100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.mc-drawer-overlay.show { opacity: 1; pointer-events: auto; }

.mc-mini-panier {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    height: 100dvh; /* barre d'adresse mobile : évite que les boutons du bas soient masqués */
    width: 380px;
    max-width: 92vw;
    background: #ffffff;
    z-index: 5200;
    box-shadow: -10px 0 40px rgba(0,0,0,0.18);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
    display: flex;
    flex-direction: column;
}
.mc-mini-panier.show { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.mc-mini-panier-titre { margin: 0; font: inherit; color: inherit; text-align: left; line-height: inherit; }

.mc-mini-panier-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 24px;
    background: var(--mc-navy);
    color: #ffffff;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05rem;
}
.mc-mini-panier-close {
    background: none; border: none; color: #ffffff; font-size: 1.1rem; cursor: pointer;
    width: 44px; height: 44px; border-radius: 50%; transition: background 0.2s ease;
}
.mc-mini-panier-close:hover { background: rgba(255,255,255,0.15); }

.mc-mini-panier-expiration {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.78rem;
    color: #64748b;
    background: var(--mc-ivoire, #faf7f2);
    border-bottom: 1px solid rgba(11,30,61,0.08);
    transition: background 0.3s ease, color 0.3s ease;
}
.mc-mini-panier-expiration.show { display: flex; }
.mc-mini-panier-expiration.urgent { background: #fdecec; color: var(--mc-red); font-weight: 700; }

.mc-mini-panier-liste {
    flex: 1;
    overflow-y: auto;
    padding: 8px 24px;
}
.mc-mini-panier-vide { text-align: center; color: #64748b; font-size: 0.88rem; padding: 40px 0; }

.mc-mini-panier-item {
    display: flex; gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(11,30,61,0.08);
}
.mc-mini-panier-item:last-child { border-bottom: none; }
.mc-mini-panier-img {
    display: block;
    width: 64px; height: 64px; border-radius: 6px; overflow: hidden;
    background: var(--mc-ivoire, #faf7f2); flex-shrink: 0;
}
.mc-mini-panier-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-mini-panier-nom {
    display: block;
    font-weight: 700; color: var(--mc-navy); font-size: 0.9rem; margin-bottom: 4px;
    text-decoration: none;
}
.mc-mini-panier-nom:hover { color: var(--mc-red); }
.mc-mini-panier-detail { font-size: 0.78rem; color: #64748b; margin-bottom: 4px; }
.mc-mini-panier-qte { font-size: 0.82rem; color: #33455e; font-weight: 600; }

.mc-mini-panier-info { position: relative; flex: 1; min-width: 0; }
.mc-mini-panier-item.is-loading { opacity: 0.55; pointer-events: none; }
.mc-mini-panier-qte-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.mc-mini-panier-qte-ctrl {
    display: inline-flex; align-items: center;
    border: 1px solid rgba(11,30,61,0.18); border-radius: 999px; overflow: hidden;
}
.mc-mini-qty-btn {
    width: 30px; height: 30px; border: none; background: transparent; cursor: pointer;
    font-size: 1.05rem; line-height: 1; color: var(--mc-navy, #0b1e3d); font-family: inherit;
}
.mc-mini-qty-btn:hover:not(:disabled) { background: rgba(11,30,61,0.07); }
.mc-mini-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mc-mini-qty-val { min-width: 26px; text-align: center; font-size: 0.85rem; font-weight: 700; color: #33455e; }
.mc-mini-panier-prix { font-size: 0.88rem; font-weight: 700; color: #33455e; white-space: nowrap; }
.mc-mini-supprimer {
    margin-top: 6px; padding: 0; border: none; background: none; cursor: pointer;
    font-size: 0.76rem; color:#5b6b80; text-decoration: underline; font-family: inherit;
}
.mc-mini-supprimer:hover:not(:disabled) { color: #b42318; }
.mc-mini-panier-erreur {
    margin: 0; padding: 10px 24px; font-size: 0.82rem; color: #b42318; background: #fef3f2;
}

.mc-mini-panier-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px;
    border-top: 1px solid rgba(11,30,61,0.08);
    font-weight: 800; font-size: 1.05rem; color: var(--mc-navy);
}

.mc-mini-panier-actions {
    padding: 18px 24px 22px;
    display: flex; flex-direction: column; gap: 10px;
    border-top: 1px solid rgba(11,30,61,0.08);
}
.mc-mini-panier-btn-primary, .mc-mini-panier-btn-secondary {
    display: block; text-align: center;
    padding: 13px 20px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.mc-mini-panier-btn-primary { background: var(--mc-red); color: #ffffff; border: none; }
.mc-mini-panier-btn-primary:hover { background: #a6172f; }
.mc-mini-panier-btn-secondary { background: none; border: 1.5px solid var(--mc-navy); color: var(--mc-navy); }
.mc-mini-panier-btn-secondary:hover { background: var(--mc-navy); color: #ffffff; }

@media (prefers-reduced-motion: reduce) {
    .mc-mini-panier, .mc-drawer-overlay { transition: none !important; }
    .mc-mini-panier { visibility: hidden; }
    .mc-mini-panier.show { visibility: visible; }
}

/* ── Bandeau mode vacances ── */
.mc-bandeau-vacances {
    background: #0b1e3d; color: #faf7f2; text-align: center;
    font-size: 0.85rem; font-weight: 600; padding: 10px 20px;
    letter-spacing: 0.02em;
}

/* ── Bouton Admin (visible uniquement si connecté en tant qu'admin) ── */
.mc-admin-btn {
    background: rgba(196, 30, 58, 0.1);
    color: #c41e3a;
}
.mc-admin-btn:hover {
    background: #c41e3a;
    color: #fff;
}
