/* ============================================================ */
/* FICHIER : public/css/responsive.css                          */
/* RÔLE    : Adaptation du site à tous les types d'écrans       */
/* ============================================================ */

/* ===== POINTS DE RUPTURE (Breakpoints) ===== */
/*
   xs  = moins de 576px    (téléphones portrait)
   sm  = 576px à 767px     (téléphones paysage)
   md  = 768px à 991px     (tablettes portrait)
   lg  = 992px à 1199px    (tablettes paysage / petits PC)
   xl  = 1200px et plus    (grands écrans)
*/

/* ===== GRANDS ÉCRANS — compression douce du menu (max 1199px) ===== */
@media (max-width: 1199px) {
    .logo-entete__nom {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .menu-principal__lien {
        font-size: 0.8rem;
        padding: 0.45rem 0.55rem !important;
    }
}

/* ===== TABLETTES (max 991px) ===== */
@media (max-width: 991px) {

    /* Cache l'adresse dans la topbar */
    .topbar-contact__item--adresse {
        display: none;
    }

    /* Slider */
    .slider-hero {
        min-height: 450px;
        max-height: 650px;
    }

    .slider-hero__titre {
        font-size: 2rem;
    }

    /* Bannière pages intérieures */
    .banniere-page {
        padding: 3rem 0 2.5rem;
    }

    /* Sections */
    .section {
        padding: 3rem 0;
    }

    /* Footer */
    .footer-principal__corps {
        padding: 3rem 0 2rem;
    }

    .footer-principal__corps .row > div {
        margin-bottom: 2rem;
    }

    /* Stats */
    .compteur-statistique {
        padding: 1rem 0.75rem;
    }

    /* Badge flottant section "pourquoi nous" : recentré */
    .badge-experience {
        right: 0 !important;
        bottom: -10px !important;
    }
}

/* ===== MOBILE (max 767px) ===== */
@media (max-width: 767px) {

    /* Topbar : hauteur auto + items comprimés — reste sur une ligne grâce à col-8/col-4 */
    .topbar-principal {
        height: auto;
        padding: 0.35rem 0;
    }

    .topbar-contact__item {
        font-size: 0.78rem;
        padding: 0 0.75rem;
    }

    .topbar-contact__item:first-child {
        padding-left: 0;
    }

    .topbar-reseaux {
        justify-content: flex-end;
        gap: 0.2rem;
    }

    .topbar-reseaux__lien {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    /* Menu burger : fond blanc avec ombre */
    .navbar-collapse {
        background-color: var(--couleur-blanc);
        border-radius: var(--rayon-lg);
        padding: var(--espace-sm);
        box-shadow: var(--ombre-lg);
        margin-top: var(--espace-xs);
        border: 1px solid var(--couleur-bordure);
    }

    /* Sous-menus mobiles : pas de dropdown flottant */
    .sous-menu {
        position: static !important;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--couleur-secondaire);
        border-radius: 0;
        padding-left: var(--espace-sm);
        margin-left: var(--espace-sm);
        animation: none;
    }

    /* CTA header pleine largeur */
    .header-actions {
        margin: var(--espace-xs) 0 0;
    }

    .bouton-principal--header {
        width: 100%;
        justify-content: center;
    }

    /* Slider */
    .slider-hero {
        height: 85vw;
        min-height: 380px;
        max-height: 520px;
    }

    .slider-hero__superposition {
        background: rgba(26, 60, 110, 0.7);
    }

    .slider-hero__titre {
        font-size: 1.6rem;
    }

    .slider-hero__description {
        font-size: var(--taille-base);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .slider-hero__boutons {
        flex-direction: column;
    }

    .slider-hero__boutons .bouton-principal,
    .slider-hero__boutons .bouton-secondaire {
        width: 100%;
        justify-content: center;
    }

    /* Sections */
    .section {
        padding: 2.5rem 0;
    }

    /* Bannière pages intérieures */
    .banniere-page {
        padding: 2rem 0 1.75rem;
    }

    .banniere-page__titre {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .banniere-page__fil-ariane {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
    }

    /* En-têtes de section */
    .entete-section {
        margin-bottom: 1.75rem;
    }

    .entete-section__surtitre::before,
    .entete-section__surtitre::after {
        display: none;
    }

    .entete-section__description {
        font-size: var(--taille-sm);
    }

    /* Cartes */
    .carte {
        margin-bottom: var(--espace-sm);
    }

    .carte__corps {
        padding: 0.875rem;
    }

    .carte__pied {
        padding: 0.6rem 0.875rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Cartes service */
    .carte-service {
        padding: 1.25rem;
    }

    .carte-service__icone-conteneur {
        width: 64px;
        height: 64px;
    }

    .carte-service__icone {
        font-size: 1.6rem;
    }

    /* Stats */
    .compteur-statistique {
        padding: var(--espace-sm);
    }

    /* Badge "expérience" (section pourquoi nous) : repositionné dans le flux */
    .badge-experience {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        display: block !important;
        width: fit-content;
        margin: 1rem auto 0;
        border-radius: 12px !important;
    }

    /* Popup */
    .popup-boite {
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    .popup-boite__image {
        height: 180px;
    }

    .popup-boite__corps {
        padding: var(--espace-sm);
    }

    /* Bouton retour haut */
    .bouton-retour-haut {
        bottom: var(--espace-sm);
        right: var(--espace-sm);
        width: 42px;
        height: 42px;
    }

    /* Footer */
    .footer-colonne {
        text-align: center;
    }

    .footer-liens__lien {
        justify-content: center;
    }

    .footer-contact__element {
        justify-content: center;
    }

    .footer-reseaux__liens {
        justify-content: center;
    }

    .footer-newsletter__champ-groupe {
        max-width: 300px;
        margin: 0 auto;
    }

    .footer-bas .row {
        text-align: center;
    }

    .footer-bas__credit {
        text-align: center !important;
        margin-top: 0.4rem;
    }

    /* iOS : empêche le zoom automatique sur les champs de formulaire */
    /* Un champ avec font-size < 16px déclenche le zoom sur Safari/iOS */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Tableaux : défilement horizontal sur mobile */
    table:not(.table-non-scrollable) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Formulaires */
    .formulaire-champ {
        font-size: 16px;
    }
}

/* ===== PETITS MOBILES (max 575px) ===== */
@media (max-width: 575px) {

    /* Topbar xs : téléphone seul (l'email est déjà d-none via Bootstrap d-sm-flex) */
    .topbar-contact__item {
        font-size: 0.72rem;
        padding: 0 0.5rem;
    }

    .topbar-contact__item:first-child {
        padding-left: 0;
    }

    .topbar-reseaux__lien {
        width: 22px;
        height: 22px;
        font-size: 0.62rem;
    }

    /* Slider plus compact */
    .slider-hero {
        height: 80vw;
        min-height: 340px;
        max-height: 480px;
    }

    .slider-hero__surtitre {
        font-size: 0.72rem;
        padding: 0.3rem 0.9rem;
        margin-bottom: var(--espace-sm);
    }

    .slider-hero__titre {
        font-size: 1.4rem;
    }

    /* Cache la description du slider — le titre suffit sur très petit écran */
    .slider-hero__description {
        display: none;
    }

    /* Sections */
    .section {
        padding: 2rem 0;
    }

    /* Bannière */
    .banniere-page {
        padding: 1.75rem 0 1.5rem;
    }

    /* Compteurs stats */
    .compteur-statistique__nombre {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    /* Cartes : ratio 4/3 au lieu de 16/9 pour voir plus de l'image */
    .carte__image-conteneur {
        aspect-ratio: 4 / 3;
    }

    /* Newsletter : empiler champ + bouton */
    .footer-newsletter__champ-groupe {
        flex-direction: column;
        max-width: 100%;
        border-radius: var(--rayon-md);
    }

    .footer-newsletter__champ {
        border-radius: var(--rayon-md) var(--rayon-md) 0 0;
    }

    .footer-newsletter__bouton {
        padding: 0.65rem;
        border-radius: 0 0 var(--rayon-md) var(--rayon-md);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Boutons */
    .bouton-principal,
    .bouton-secondaire {
        padding: 0.65rem 1.5rem;
        font-size: var(--taille-sm);
    }
}

/* ===== TRÈS PETIT MOBILE (max 380px) ===== */
@media (max-width: 380px) {

    .topbar-contact__item {
        font-size: 0.68rem;
        padding: 0 0.4rem;
    }

    .topbar-reseaux__lien {
        width: 20px;
        height: 20px;
        font-size: 0.58rem;
    }

    .slider-hero__titre {
        font-size: 1.3rem;
    }

    .bouton-principal,
    .bouton-secondaire {
        padding: 0.65rem 1rem;
        font-size: var(--taille-xs);
    }

    .banniere-page {
        padding: 1.5rem 0 1.25rem;
    }
}

/* ===== IMPRESSION ===== */
@media print {
    .topbar-principal,
    .header-principal,
    .footer-principal,
    .bouton-retour-haut,
    .slider-hero,
    [data-aos] {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
