/* ==========================================================================
   CLEAN OUEST DÉBARRAS — Design System
   Source de vérité : maquettes/maquette-homepage.html
   RGPD : aucun appel Google Fonts — polices auto-hébergées
   ========================================================================== */

/* --------------------------------------------------------------------------
   @font-face — auto-hébergées
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Bebas Neue';
    src: url('/assets/fonts/bebas-neue-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('/assets/fonts/work-sans-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('/assets/fonts/work-sans-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('/assets/fonts/work-sans-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('/assets/fonts/work-sans-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   Palette de couleurs
   -------------------------------------------------------------------------- */

:root {
    --black: #1a1a1a;
    --charcoal: #2d2d2d;
    --steel: #404040;
    --concrete: #666666;
    --silver: #999999;
    --mist: #e8e8e8;
    --light: #f8f8f8;
    --white: #ffffff;
    --accent: #e63926;
    --accent-dark: #c42d1d;
    --accent-light: #ff4d3a;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--white);
    color: var(--black);
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Conteneur
   -------------------------------------------------------------------------- */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* --------------------------------------------------------------------------
   Typographie — échelle
   -------------------------------------------------------------------------- */

/* Les titres h1 en contexte hero sont gérés dans home.css.
   Titres de section réutilisables ci-dessous. */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Bebas Neue', sans-serif;
}

/* --------------------------------------------------------------------------
   Composant : .section-tag
   -------------------------------------------------------------------------- */

.section-tag {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.section-tag::before {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.section-tag span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Composant : .section-title + .section-header
   -------------------------------------------------------------------------- */

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--black);
    line-height: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 80px;
}

/* --------------------------------------------------------------------------
   Composants : boutons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateX(5px);
}

.btn-outline {
    background: transparent;
    color: var(--black);
    border: 2px solid var(--mist);
    padding: 13px 28px;
}

.btn-outline:hover {
    border-color: var(--black);
}

.btn-white {
    background: white;
    color: var(--accent);
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
}

.btn-white:hover {
    background: var(--black);
    color: white;
}

.btn-outline-white {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 13px 28px;
}

.btn-outline-white:hover {
    background: white;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Composant : .service-card
   -------------------------------------------------------------------------- */

.service-card {
    background: var(--light);
    padding: 45px 35px;
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.4s ease;
}

.service-card:hover {
    background: var(--white);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.service-card:hover::before {
    background: var(--accent);
}

.service-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem;
    color: rgba(0, 0, 0, 0.03);
    position: absolute;
    top: 20px;
    right: 20px;
    line-height: 1;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--white);
    border: 1px solid var(--mist);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    background: var(--accent);
    border-color: var(--accent);
}

.service-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--charcoal);
    transition: fill 0.4s ease;
}

.service-card:hover .service-icon svg {
    fill: white;
}

.service-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: var(--black);
}

.service-desc {
    color: var(--concrete);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.service-link:hover {
    color: var(--accent);
}

.service-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.service-link:hover svg {
    transform: translateX(5px);
}

/* --------------------------------------------------------------------------
   Composant : .trust-bar / .trust-item
   -------------------------------------------------------------------------- */

.trust-bar {
    padding: 60px 0;
    background: var(--white);
    border-top: 1px solid var(--mist);
    border-bottom: 1px solid var(--mist);
}

.trust-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.trust-icon {
    width: 50px;
    height: 50px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trust-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

.trust-text h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: var(--black);
    letter-spacing: 1px;
}

.trust-text p {
    color: var(--concrete);
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Composant : .about-feature
   -------------------------------------------------------------------------- */

.about-feature {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-left: 3px solid var(--accent);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.feature-text h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.feature-text p {
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Composant : .zone-item / .zone-map
   -------------------------------------------------------------------------- */

.zone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--light);
    transition: all 0.3s ease;
}

.zone-item:hover {
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.zone-item::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    flex-shrink: 0;
}

.zone-item span {
    font-weight: 500;
    color: var(--black);
}

.zone-map {
    position: relative;
    background: var(--light);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zone-map::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--mist) 1px, transparent 1px),
        linear-gradient(var(--mist) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

.map-radius {
    position: absolute;
    width: 80%;
    height: 80%;
    border: 2px dashed var(--accent);
    border-radius: 50%;
    opacity: 0.4;
}

.map-center {
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    position: relative;
    animation: pulse 2s infinite;
    z-index: 2;
}

.map-city {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--charcoal);
    background: white;
    padding: 5px 10px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 1;
}

.map-city::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* --------------------------------------------------------------------------
   Composant : .cta (section rouge)
   -------------------------------------------------------------------------- */

.cta {
    padding: 100px 0;
    background: var(--accent);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: 'DEVIS GRATUIT';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18vw;
    color: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cta-text h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    color: white;
    line-height: 1;
    margin-bottom: 10px;
}

.cta-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
}

.cta-actions {
    display: flex;
    gap: 20px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    padding: 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--mist);
}

#header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.logo {
    display: flex;
    align-items: center;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav a {
    color: var(--concrete);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--black);
}

nav a:hover::after {
    width: 100%;
}

/* Aligner les items de nav sur une seule ligne */
.main-nav > ul {
    align-items: center;
}

.main-nav li {
    position: relative;
}

/* Sous-menu déroulant (desktop) — sorti du flux pour ne pas décaler la nav */
.main-nav .submenu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--white);
    border-top: 2px solid var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    list-style: none;
    gap: 0;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1050;
}

.main-nav .has-children:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav .submenu li {
    display: block;
}

.main-nav .submenu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.main-nav .submenu a::after {
    display: none;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 25px;
}

.phone-header {
    color: var(--black);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

footer {
    background: var(--black);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    margin-bottom: 20px;
}

.footer-logo-img {
    height: 60px;
    background: white;
    padding: 10px;
    border-radius: 5px;
}

.footer-desc {
    color: var(--silver);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 45px;
    height: 45px;
    background: var(--steel);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.footer-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    color: white;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--silver);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-light);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-contact-item span {
    color: var(--silver);
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--steel);
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: var(--concrete);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    gap: 30px;
}

.footer-legal a {
    color: var(--concrete);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   Animations globales
   -------------------------------------------------------------------------- */

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 38, 0.5);
    }
    50% {
        box-shadow: 0 0 0 30px rgba(230, 57, 38, 0);
    }
}

/* --------------------------------------------------------------------------
   Responsive — breakpoints globaux
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .trust-items {
        flex-wrap: wrap;
        gap: 30px;
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Masquer la nav desktop — remplacée par .main-nav.open en mobile */
    nav.main-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 15px 20px;
    }

    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .cta-actions {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Burger — bouton hamburger (3 barres)
   -------------------------------------------------------------------------- */

/* Caché sur desktop, visible en mobile */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1100;
}

.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--black);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animation croix quand ouvert */
.burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Navigation mobile — .main-nav.open affiché en dropdown sous le header
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
    /* Afficher le burger */
    .burger {
        display: flex;
    }

    /* Masquer le CTA "DEVIS GRATUIT" pour éviter l'encombrement mobile */
    .header-cta .btn {
        display: none;
    }

    /* Menu mobile : positionné sous le header, pleine largeur */
    .main-nav.open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 2px solid var(--accent);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        z-index: 1050;
        padding: 20px 0;
    }

    /* Liens empilés verticalement */
    .main-nav.open ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
    }

    .main-nav.open ul li {
        border-bottom: 1px solid var(--mist);
    }

    .main-nav.open ul li:last-child {
        border-bottom: none;
    }

    .main-nav.open ul a {
        display: block;
        padding: 14px 0;
        color: var(--black);
        font-size: 0.9rem;
        font-weight: 500;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    .main-nav.open ul a:hover {
        color: var(--accent);
    }

    /* Sous-menu Services : visible et indenté */
    .main-nav.open .submenu {
        display: flex !important;
        flex-direction: column;
        padding-left: 16px;
        padding-bottom: 8px;
        gap: 0;
    }

    .main-nav.open .submenu li {
        border-bottom: none;
    }

    .main-nav.open .submenu a {
        padding: 10px 0;
        font-size: 0.82rem;
        color: var(--concrete);
        letter-spacing: 0.5px;
    }

    .main-nav.open .submenu a:hover {
        color: var(--accent);
    }

    /* Le header doit être en position relative pour que
       le menu absolu se positionne par rapport à lui */
    #header {
        position: fixed; /* déjà fixed, on ajoute overflow visible */
        overflow: visible;
    }
}
