/* ============================================= */
/* CHARTE COULEURS — Vert, Blanc, Noir, Gris     */
/* ============================================= */

:root,
[data-bs-theme] {
    --color-primary: #28a745;
    --color-primary-dark: #1e7e34;
    --color-primary-light: #d4edda;

    /* Override TOUTES les variables warning de Bootstrap 5.3 */
    --bs-warning: #28a745;
    --bs-warning-rgb: 40, 167, 69;
    --bs-warning-text-emphasis: #1e7e34;
    --bs-warning-bg-subtle: #d4edda;
    --bs-warning-border-subtle: #a3d9a5;

    /* Override des variables de bouton warning */
    --bs-btn-bg: #28a745;
    --bs-btn-border-color: #28a745;
    --bs-btn-hover-bg: #1e7e34;
    --bs-btn-hover-border-color: #1e7e34;
    --bs-btn-active-bg: #1e7e34;
    --bs-btn-active-border-color: #1e7e34;
}

/* ============================================= */
/* GLOBAL                                        */
/* ============================================= */

body {
    font-family: 'Poppins', sans-serif;
    color: #333;
    overflow-x: hidden;
}

a {
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* Scrollbar personnalisée (optionnel, Chrome/Edge) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

/* ============================================= */
/* OVERRIDE BOOTSTRAP — Warning → Vert           */
/* ============================================= */

.btn-warning,
.btn-warning:active,
.btn-warning:visited {
    --bs-btn-bg: #28a745;
    --bs-btn-border-color: #28a745;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #1e7e34;
    --bs-btn-hover-border-color: #1e7e34;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1e7e34;
    --bs-btn-active-border-color: #1e7e34;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: #28a745;
    --bs-btn-disabled-border-color: #28a745;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #1e7e34 !important;
    border-color: #1e7e34 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-outline-warning,
.btn-outline-warning:visited {
    --bs-btn-color: #28a745;
    --bs-btn-border-color: #28a745;
    --bs-btn-hover-bg: #28a745;
    --bs-btn-hover-border-color: #28a745;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1e7e34;
    --bs-btn-active-border-color: #1e7e34;
    color: #28a745 !important;
    border-color: #28a745 !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background-color: #28a745 !important;
    color: #fff !important;
}

/* Texte, badges, bg, bordures — garder le reste tel quel */
.text-warning {
    color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #28a745 !important;
    color: #fff !important;
}

.bg-warning {
    background-color: #28a745 !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.border-warning {
    border-color: #28a745 !important;
}

.table-warning {
    --bs-table-bg: rgba(40, 167, 69, 0.15) !important;
    --bs-table-border-color: rgba(40, 167, 69, 0.3) !important;
}

/* ============================================= */
/* NAVBAR                                        */
/* ============================================= */

.navbar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(33, 37, 41, 0.98) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand span {
    font-size: 1.1rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
    position: relative;
}

/* Soulignement animé au hover */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
    left: 20%;
}

.nav-link.active {
    color: var(--color-primary) !important;
}

/* ============================================= */
/* HERO SECTION                                  */
/* ============================================= */

.hero-section {
    background-image: url('/images/hero-deratisation.webp');
    background-size: cover;
    background-position: center;
    min-height: 80vh;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 0;
}

.hero-section .container {
    z-index: 1;
}

.hero-section h1 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-section .lead {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}

/* ============================================= */
/* SECTIONS GÉNÉRALES                            */
/* ============================================= */

section {
    scroll-margin-top: 80px; /* Compense la navbar fixed pour les ancres */
}

.page-header {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

/* ============================================= */
/* CARTES SERVICES (Accueil)                     */
/* ============================================= */

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(40, 167, 69, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

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

.service-card:hover .service-icon i {
    color: #fff !important;
}

/* ============================================= */
/* AVANTAGES                                     */
/* ============================================= */

#avantages .bg-light {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
}

#avantages .bg-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.avantage-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
}

/* ============================================= */
/* TÉMOIGNAGES                                   */
/* ============================================= */

#temoignages .card {
    transition: transform 0.3s ease;
    border-radius: 12px;
}

#temoignages .card:hover {
    transform: translateY(-5px);
}

/* ============================================= */
/* BANDEAU CTA URGENCE                           */
/* ============================================= */

.cta-urgence {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.cta-urgence .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================= */
/* PAGE SERVICES — Détails                       */
/* ============================================= */

#deratisation,
#desinsectisation,
#desinfection,
#depigeonnage {
    scroll-margin-top: 80px;
}

/* Cartes insectes (désinsectisation) */
#desinsectisation .bg-light {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
}

#desinsectisation .bg-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

/* ============================================= */
/* FAQ — Accordion                               */
/* ============================================= */

.accordion-button:not(.collapsed) {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--color-primary);
    box-shadow: inset 0 -1px 0 var(--color-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.accordion-button::after {
    transition: transform 0.3s ease;
}

/* ============================================= */
/* PAGE CONTACT                                  */
/* ============================================= */

/* Style des inputs au focus → bordure verte */
.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

/* Carte contact infos */
.card .bg-warning.bg-opacity-10.rounded-circle {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================= */
/* FOOTER                                        */
/* ============================================= */

footer a.text-secondary:hover {
    color: var(--color-primary) !important;
}

footer .fa-brands {
    transition: color 0.3s ease, transform 0.3s ease;
}

footer .fa-brands:hover {
    color: var(--color-primary) !important;
    transform: scale(1.2);
}

/* ============================================= */
/* BOUTON RETOUR EN HAUT                         */
/* Positionné AU-DESSUS du bouton WhatsApp       */
/* ============================================= */

#backToTop {
    position: fixed;
    bottom: 105px;  /* WhatsApp (60px) + marge bas (30px) + espace (15px) */
    right: 35px;    /* Aligné avec centre WhatsApp : (60-50)/2 + 30 = 35 */
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff;
}

#backToTop.visible {
    display: flex;
    opacity: 1;
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* ============================================= */
/* ANIMATIONS — Apparition au scroll             */
/* ============================================= */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Délais pour effet cascade sur les cartes */
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ============================================= */
/* RESPONSIVE                                    */
/* ============================================= */

/* ===== Tablettes (max 991px) ===== */
@media (max-width: 991.98px) {
    .hero-section {
        min-height: 70vh;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    /* Navbar mobile : menu centré */
    .navbar-collapse {
        text-align: center;
        padding: 1rem 0;
    }

    .navbar-nav .btn-warning {
        margin-top: 0.5rem;
    }
}

/* ===== Mobiles (max 767px) ===== */
@media (max-width: 767.98px) {
    .hero-section {
        min-height: 60vh;
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    /* Boutons CTA hero empilés */
    .hero-section .d-flex {
        flex-direction: column;
    }

    /* Sections : moins de padding */
    section.py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    /* Titres plus petits */
    h2 {
        font-size: 1.5rem;
    }

    /* Footer : tout centré */
    footer .col-lg-4,
    footer .col-lg-2,
    footer .col-lg-3 {
        text-align: center;
    }

    footer .d-flex.gap-3 {
        justify-content: center;
    }

    /* Bouton retour en haut : plus petit + repositionné au-dessus de WhatsApp mobile */  
        #backToTop {  
            width: 40px;  
            height: 40px;  
            bottom: 90px;   /* WhatsApp mobile (55px) + marge bas (20px) + espace (15px) */  
            right: 27px;    /* Aligné avec centre WhatsApp mobile : (55-40)/2 + 20 = 27.5 */  
        }
}

/* ===== Petits mobiles (max 575px) ===== */
@media (max-width: 575.98px) {
    .hero-section h1 {
        font-size: 1.4rem;
    }

    .hero-section .lead {
        font-size: 0.9rem;
    }

    .btn-lg {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }

    /* Cartes services : pleine largeur */
    .service-card {
        margin-bottom: 1rem;
    }
}

/* ============================================= */
/* BOUTON WHATSAPP FLOTTANT                       */
/* ============================================= */

.whatsapp-float {
    /* Position fixe en bas à droite */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999; /* Au-dessus de la plupart des éléments */
    
    /* Dimensions du bouton rond */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    
    /* Couleur WhatsApp officielle */
    background-color: #25D366;
    color: #ffffff;
    
    /* Centrer l'icône */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    
    /* Ombre pour relief */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    
    /* Enlever le soulignement du lien */
    text-decoration: none;
    
    /* Animation douce au hover */
    transition: all 0.3s ease;
    
    /* Animation de pulsation pour attirer l'œil */
    animation: whatsapp-pulse 2s infinite;
}

/* Effet au survol : grossit légèrement + s'éclaircit */
.whatsapp-float:hover {
    background-color: #20BA5A;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    animation: none; /* Stoppe la pulsation au hover */
}

/* Animation de pulsation (cercle vert qui se diffuse) */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
                    0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
                    0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25),
                    0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ============================================= */
/* INFOBULLE (tooltip) au survol                  */
/* ============================================= */

.whatsapp-tooltip {
    /* Position à gauche du bouton */
    position: absolute;
    right: 75px; /* = largeur bouton + marge */
    top: 50%;
    transform: translateY(-50%);
    
    /* Apparence */
    background-color: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap; /* Empêche le retour à la ligne */
    
    /* Caché par défaut */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    /* Empêche l'infobulle de capter les clics */
    pointer-events: none;
}

/* Petite flèche à droite de l'infobulle */
.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid #333;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Affichage de l'infobulle au survol */
.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================= */
/* RESPONSIVE — Mobile                            */
/* ============================================= */

/* ============================================= */
/* RESPONSIVE — Mobile                            */
/* ============================================= */

@media (max-width: 767.98px) {  /* ← aligné avec le reste du CSS */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 28px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
}

/* ============================================= */
/* BANDEAU COOKIES RGPD                           */
/* ============================================= */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060; /* Au-dessus de tout, y compris back-to-top/WhatsApp */
    
    /* Couleur foncée qui tranche */
    background-color: rgba(33, 37, 41, 0.98);
    color: #fff;
    backdrop-filter: blur(8px); /* Effet verre dépoli moderne */
    
    /* Bordure haute verte pour rappel charte */
    border-top: 3px solid var(--color-primary);
    
    /* Padding */
    padding: 1.5rem 1rem;
    
    /* Cachée par défaut — affichée via JS */
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    visibility: hidden;
}

/* Bandeau visible (classe ajoutée par JS) */
.cookie-banner.visible {
    transform: translateY(0);
    visibility: visible;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text h5 {
    color: #fff;
}

.cookie-text p {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.cookie-link {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-link:hover {
    color: #fff;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-buttons .btn {
    min-width: 130px;
    transition: all 0.3s ease;
}

.cookie-buttons .btn:hover {
    transform: translateY(-2px);
}

/* ============================================= */
/* MODAL DE PERSONNALISATION                      */
/* ============================================= */

.cookie-category {
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cookie-category:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.cookie-category:last-child {
    margin-bottom: 0;
}

/* Switch vert (charte) */
.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

/* ============================================= */
/* RESPONSIVE — Mobile                            */
/* ============================================= */

@media (max-width: 767.98px) {
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-buttons .btn {
        width: 100%;
    }
}

/* ============================================= */
/* PLACEHOLDER GOOGLE MAPS (si consentement refusé) */
/* ============================================= */

.map-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.map-placeholder i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.map-placeholder .btn {
    margin-top: 1rem;
}

/* ============================================= */
/* COMPTEURS ANIMÉS                              */
/* ============================================= */

.counter-box {
    padding: 2rem 1rem;
    transition: transform 0.3s ease;
}

.counter-box:hover {
    transform: translateY(-5px);
}

.counter-number {
    font-size: 3rem;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums; /* Chiffres alignés pendant l'animation */
}

.counter-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 767.98px) {
    .counter-number {
        font-size: 2.2rem;
    }
    
    .counter-label {
        font-size: 0.8rem;
    }
}



/* Page 404 — hauteur minimale pour centrer le contenu */
.min-vh-75 {
    min-height: 75vh;
}