/* ==========================================================================
   header.css — En-tête commun à toutes les pages
   Pilule flottante : logo · navigation · Instagram · bouton « Appeler »
   Mobile : logo · bouton téléphone rond · burger + menu en carte
   ========================================================================== */

:root {
    --header-accent: #A35B4B;
    --header-accent-hover: #8F4F40;
    --header-active-bg: #F6EAE5;
    --header-active-text: #9A4E3E;
    --header-icon: #C9806E;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1rem;
    pointer-events: none; /* seule la pilule capte les clics */
}

.header-pill {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1152px;
    margin: 0 auto;
    height: 64px;
    padding: 0 0.75rem 0 1.75rem;
    background-color: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color, #EAE3DE);
    border-radius: 9999px;
    box-shadow: 0 6px 24px -10px rgba(75, 45, 35, 0.18);
}

/* Logo */
.brand-logo {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary, #211C19);
    text-decoration: none;
}

/* Navigation (desktop) */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 auto;
}

.nav-link {
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted, #6B7280);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary, #211C19);
    background-color: #FAF4F0;
}

.nav-link.active {
    color: var(--header-active-text);
    background-color: var(--header-active-bg);
    font-weight: 600;
    border: 0;
}

/* Actions à droite */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.header-insta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--header-icon);
    transition: background-color 0.2s ease;
}

.header-insta:hover {
    background-color: #FAF4F0;
}

.header-insta svg {
    width: 18px;
    height: 18px;
}

.header-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 1.25rem;
    border-radius: 9999px;
    background-color: var(--header-accent);
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.header-call:hover {
    background-color: var(--header-accent-hover);
}

.header-call svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Burger (mobile seulement) */
.burger-btn {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.burger-line {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--text-primary, #211C19);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.burger-line:nth-child(1) { top: 13px; }
.burger-line:nth-child(2) { top: 19px; }
.burger-line:nth-child(3) { top: 25px; }

.burger-btn[aria-expanded="true"] .burger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-btn[aria-expanded="true"] .burger-line:nth-child(2) { opacity: 0; }
.burger-btn[aria-expanded="true"] .burger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.burger-btn:focus-visible,
.header-call:focus-visible,
.header-insta:focus-visible,
.nav-link:focus-visible,
.brand-logo:focus-visible,
.mobile-contact-item:focus-visible {
    outline: 2px solid var(--header-accent-hover);
    outline-offset: 2px;
}

/* Bloc contact : visible uniquement dans le menu mobile */
.mobile-nav-contact {
    display: none;
}

/* ---------- Mobile / tablette ---------- */
@media (max-width: 1023px) {
    .header-pill {
        height: 56px;
        padding: 0 0.625rem 0 1.25rem;
        gap: 0.75rem;
    }

    .brand-logo {
        font-size: 1.05rem;
    }

    .header-insta {
        display: none;
    }

    /* Le bouton Appeler devient un rond avec l'icône seule */
    .header-call {
        width: 40px;
        padding: 0;
    }

    .header-call span {
        display: none;
    }

    .burger-btn {
        display: block;
    }

    .header-actions {
        gap: 0.25rem;
    }

    /* Menu déroulant en carte */
    .main-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0.5rem;
        width: min(290px, calc(100vw - 2.5rem));
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 1rem;
        background-color: var(--bg-surface, #FFFFFF);
        border: 1px solid var(--border-color, #EAE3DE);
        border-radius: 1.5rem;
        box-shadow: 0 16px 40px -12px rgba(75, 45, 35, 0.25);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    }

    .main-nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0s;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .mobile-nav-contact {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-light, #F0ECE7);
    }

    .mobile-contact-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-primary, #211C19);
        text-decoration: none;
    }

    .mobile-contact-item svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        color: var(--header-icon);
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-nav,
    .burger-line {
        transition: none;
    }
}
