/* ========================================
   LAYOUT.CSS — PRIMSO
   Topbar, Navigation, Footer
   ======================================== */

/* === HEADER UNIFIÉ === */
.site-header {
    background: var(--color-primary);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .primso-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

/* Homepage : header transparent dans le hero */
.site-header--home {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    z-index: 100;
}

/* Effet scroll : le header home passe sticky + fond bleu */
.site-header--home.scrolled {
    position: fixed;
    background: #3783CD;
    box-shadow: 0 2px 20px rgba(55,131,205,0.35);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Pages internes : léger renforcement ombre au scroll */
.site-header:not(.site-header--home).scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.primso-logo {
    display: flex;
    align-items: center;
    z-index: 100;
    flex-shrink: 0;
}

.primso-logo img {
    height: 55px;
    width: auto;
}

.primso-nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

.primso-contact-btn {
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    color: white;
    background: #2B75BB;
    border: none;
    transition: var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.primso-contact-btn:hover {
    background: #1e5a94;
    color: white;
}

.primso-depot-btn {
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    color: var(--color-primary);
    background: white;
    border: none;
    transition: var(--transition-base);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    text-decoration: none;
}

.primso-depot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--color-primary);
}

/* === NAVIGATION === */
.site-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Bouton "Déposer mon dossier" burger : masqué en desktop */
.nav-depot-btn-mobile {
    display: none;
}

.site-nav > a,
.site-nav .nav-dropdown > a {
    color: white;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    transition: var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    padding: 8px 0;
}

.site-nav > a:hover,
.site-nav > a.active,
.site-nav .nav-dropdown > a:hover,
.site-nav .nav-dropdown > a.active {
    color: var(--color-accent-green);
}

.site-nav .nav-dropdown {
    position: relative;
}

.site-nav .nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 10px 0;
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-base);
    z-index: 100;
}

.site-nav .dropdown-menu li {
    list-style: none;
}

.site-nav .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-dark) !important;
    font-size: 14px;
    font-weight: 600;
}

.site-nav .dropdown-menu a:hover {
    background: var(--color-bg-light);
    color: var(--color-primary) !important;
}

/* Menu mobile toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    z-index: 101;
    background: none;
    border: none;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: white;
    transition: var(--transition-base);
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* === FOOTER === */
.site-footer {
    background: var(--color-dark-green);
    color: white;
    padding: 60px 20px 30px;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    margin-bottom: 15px;
    color: var(--color-accent-green);
}

.footer-col p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-col ul li a:hover {
    color: var(--color-accent-green);
    padding-left: 5px;
}

.footer-logo {
    display: block;
    max-width: 150px;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 100%;
    height: auto;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.footer-social a {
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition-base);
}

.footer-social a:hover {
    color: var(--color-accent-green);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.footer-legal {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition-base);
}

.footer-legal a:hover {
    color: var(--color-accent-green);
}

.footer-legal span {
    color: rgba(255, 255, 255, 0.3);
}

.footer-col ul li a svg {
    vertical-align: middle;
    margin-right: 6px;
}

/* === NEWSLETTER BUTTON & MODAL === */
.btn-newsletter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-newsletter:hover {
    background: #1e5a94;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 117, 187, 0.4);
}

.newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.newsletter-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.newsletter-modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition-base);
    z-index: 2;
}

.newsletter-modal-close:hover {
    background: #1e5a94;
    transform: scale(1.1);
}

/* === RESPONSIVE LAYOUT === */
@media (max-width: 1024px) {
    .site-nav { gap: 18px; }
    .site-nav > a,
    .site-nav .nav-dropdown > a { font-size: 14px; }
    .primso-contact-btn,
    .primso-depot-btn { padding: 8px 16px; font-size: 14px; }
}

@media (max-width: 768px) {
    .site-header .primso-topbar-inner {
        padding: 10px 0;
    }
    .primso-logo img { height: 45px; }
    .primso-nav-right { display: none; }

    /* Menu burger à droite */
    .menu-toggle {
        display: flex;
        margin-left: auto;
    }

    .site-header .primso-topbar-inner {
        flex-wrap: nowrap;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .footer-logo { margin: 0 auto 20px; }
    .footer-social { justify-content: center; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-legal { justify-content: center; }

    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--color-dark-green);
        flex-direction: column;
        padding: 80px 30px 30px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 100;
        overflow-y: auto;
        align-items: flex-start;
    }

    .site-nav.active { right: 0; }

    .site-nav > a,
    .site-nav .nav-dropdown > a {
        font-size: 18px;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .site-nav .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        opacity: 1;
        visibility: visible;
        transform: none;
        border-radius: 8px;
        margin: 5px 0 10px;
        padding: 5px 0;
        min-width: auto;
        border: none;
    }

    .site-nav .dropdown-menu li {
        border: none;
    }

    .site-nav .dropdown-menu a {
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 15px;
        padding: 8px 15px;
        border: none;
    }

    .site-nav .dropdown-menu a:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--color-light-green) !important;
    }

    /* Bouton déposer mon dossier dans burger menu */
    .nav-depot-btn-mobile {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        padding: 12px 24px;
        margin-top: 20px;
        background: white;
        color: var(--color-primary) !important;
        font-size: 15px;
        font-weight: 700;
        font-family: 'Nunito', sans-serif;
        border-radius: var(--radius-full);
        text-decoration: none;
        transition: var(--transition-base);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        width: auto;
        border-bottom: none !important;
    }

    .nav-depot-btn-mobile:hover {
        background: var(--color-accent-green);
        color: var(--color-dark-green) !important;
        text-decoration: none;
    }
}

@media (max-width: 480px) {
    .primso-logo img { height: 40px; }
}
