/* ==========================================================================
   QR Informatique — Additions esthétiques
   1. Effet verre (glassmorphism) sur la barre de menu
   2. Animation "pulse" autour du bouton WhatsApp flottant
   3. Sticky footer : plus de bande blanche en bas de la fenêtre
   4. WhatsApp verrouillé à droite sur toutes les pages
   5. Menu : dégradé bleu → turquoise (texte + soulignement)
   6. Banner cookies : tap targets agrandis + safe-area iPhone
   ========================================================================== */

/* Cookies — boutons cliquables sur mobile (tap target 44px, safe-area iPhone) */
.cookie-banner {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    z-index: 1300; /* au-dessus du WhatsApp pour garantir la captation des clics */
}

.cookie-banner-content,
.cookie-banner-actions,
.cookie-customize {
    pointer-events: auto;
}

.cookie-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(34, 197, 94, 0.25);
    min-height: 44px;
    padding: 10px 16px;
    user-select: none;
}

@media (max-width: 768px) {
    .cookie-banner-actions {
        gap: 10px;
    }

    .cookie-btn {
        flex: 1 1 auto;
        min-width: 110px;
        font-size: 0.95rem;
    }
}

/* Menu — dégradé bleu/turquoise au survol + soulignement dégradé */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
    background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Le bouton "Site Senior" garde son style plein — pas de dégradé de texte */
.nav-link.senior-link:hover,
.nav-link.senior-link:focus-visible {
    background: linear-gradient(135deg, #e58e00, #d97706);
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff !important;
}

.nav-link.senior-link::after {
    display: none;
}

/* Barre de menu — effet verre translucide */
.header {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

/* Sticky footer : quand le contenu est plus court que la fenêtre,
   le footer colle au bas de l'écran au lieu de laisser une zone blanche. */
html,
body {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > .footer {
    margin-top: auto;
}

/* Bouton WhatsApp — position forcée à droite, fixe, sur toutes les pages.
   Utilise une spécificité élevée pour surcharger les règles existantes. */
a.whatsapp-float,
.whatsapp-float {
    position: fixed !important;
    right: 20px !important;
    left: auto !important;
    bottom: 90px !important;
    z-index: 1100 !important;
}

body.cookie-banner-visible a.whatsapp-float,
body.cookie-banner-visible .whatsapp-float {
    bottom: 180px !important;
}

/* Fallback CSS-only : si :has() est supporté, WhatsApp reste toujours
   au-dessus du banner cookie même sans classe JS sur le body. */
@supports selector(:has(*)) {
    body:has(#cookieBanner:not([hidden])) a.whatsapp-float,
    body:has(#cookieBanner:not([hidden])) .whatsapp-float {
        bottom: 180px !important;
    }
}

@media (max-width: 768px) {
    a.whatsapp-float,
    .whatsapp-float {
        right: 14px !important;
        bottom: 80px !important;
    }

    /* Quand le banner cookie est ouvert, on remonte largement le WhatsApp
       pour éviter tout chevauchement avec les boutons Refuser/Personnaliser/Accepter. */
    body.cookie-banner-visible a.whatsapp-float,
    body.cookie-banner-visible .whatsapp-float {
        bottom: calc(260px + env(safe-area-inset-bottom, 0px)) !important;
    }

    @supports selector(:has(*)) {
        body:has(#cookieBanner:not([hidden])) a.whatsapp-float,
        body:has(#cookieBanner:not([hidden])) .whatsapp-float {
            bottom: calc(260px + env(safe-area-inset-bottom, 0px)) !important;
        }
    }
}

/* Hide renforcé : garantit que le banner disparaît même si un style
   concurrent tente d'imposer un display. */
.cookie-banner[hidden],
.cookie-banner.cookie-banner-hidden {
    display: none !important;
}

/* Bouton WhatsApp flottant — anneau pulsé */
.whatsapp-float {
    position: fixed;
}

.whatsapp-float::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    border: 2px solid rgba(37, 211, 102, 0.45);
    animation: qr-whatsapp-pulse 2.2s ease-out infinite;
    pointer-events: none;
}

@keyframes qr-whatsapp-pulse {
    0%   { transform: scale(1);    opacity: 0.7; }
    100% { transform: scale(1.35); opacity: 0;   }
}
