/* Fix pour éviter la superposition du header sur mobile */

/* Assure que le body a un padding-top pour compenser le header sticky */
body {
    padding-top: 0;
}

/* Sur mobile, simplifie le header et cache la navigation */
@media (max-width: 768px) {
    /* Retire le padding du body, utilise margin sur main à la place */
    body {
        padding-top: 0;
    }
    
    header {
        position: static !important; /* Flux normal, pas de superposition */
        top: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: 1 !important;
        padding: 15px 0 !important;
        background: white !important; /* Blanc au lieu de vert */
        backdrop-filter: none !important;
        margin-bottom: 0 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important; /* Ombre légère */
        border-bottom: 1px solid #e5e5e5 !important;
        border-radius: 0 !important;
    }
    
    header .container {
        padding: 8px 15px !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: row !important;
    }
    
    /* Force le nav à afficher son contenu (logo) */
    /* IMPORTANT : styles.css cache le nav avec max-height: 0 sur mobile */
    header nav,
    header nav.container {
        display: flex !important;
        flex-direction: row !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important; /* Annule position: absolute */
        top: auto !important;
        left: auto !important;
        width: auto !important;
        background-color: transparent !important;
        box-shadow: none !important;
    }
    
    /* Cache la navigation sur mobile par défaut */
    .nav-links {
        display: none !important;
    }
    
    /* Le main n'a plus besoin de margin-top car le header n'est plus fixed */
    main.container {
        margin-top: 0 !important;
        padding-top: 1rem !important;
    }
    
    /* Ajuste le breadcrumb */
    .breadcrumb {
        margin-top: 0 !important;
        font-size: 0.85rem;
    }
    
    /* Logo plus compact et visible */
    .logo {
        display: block !important;
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        color: #6a8d73 !important;
        text-align: left !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .logo i {
        font-size: 1.4rem !important;
        color: #6a8d73 !important;
        margin-right: 8px !important;
        display: inline-block !important;
    }
    
    /* Force le texte ETERNELIS à être visible */
    header .logo {
        color: #6a8d73 !important;
        font-family: 'Lora', serif !important;
    }
    
    header nav .logo {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    /* Force l'affichage du texte dans le header */
    header, header *, header nav, header nav * {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* S'assure que le container du header est visible */
    header .container,
    header nav.container {
        display: flex !important;
        justify-content: flex-start !important;
        width: 100% !important;
    }
    
    /* Cache uniquement la navigation, pas le logo */
    header .nav-links,
    header nav ul.nav-links {
        display: none !important;
    }
    
    header .logo,
    header nav .logo,
    header .container .logo,
    header nav.container .logo {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }
    
    /* Force l'icône et le texte du logo à être visibles */
    .logo i.fa-seedling,
    header .logo i,
    header nav .logo i {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #6a8d73 !important;
        font-size: 1.4rem !important;
    }
    
    /* Force le texte ETERNELIS à être visible */
    header .logo::after {
        content: none !important; /* Au cas où il y aurait un pseudo-élément */
    }
    
    /* S'assure que le texte du logo n'est pas caché */
    header .logo,
    header nav .logo {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
        color: #6a8d73 !important;
        text-indent: 0 !important;
        text-transform: none !important;
    }
    
    /* Logo centré */
    .mobile-logo-center {
        text-align: center !important;
        padding: 12px 0 16px 0 !important;
    }
    
    .logo-text {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #6a8d73 !important;
        font-family: 'Lora', serif !important;
        margin-bottom: 8px !important;
    }
    
    .logo-text i {
        font-size: 1.5rem !important;
        color: #6a8d73 !important;
        margin-right: 8px !important;
    }
    
    .logo-tagline {
        font-size: 0.85rem !important;
        color: #666 !important;
        font-style: italic !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        font-family: 'Montserrat', sans-serif !important;
    }
    
    /* Actions rapides (3 boutons) */
    .mobile-quick-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-top: 12px !important;
        width: 100% !important;
    }
    
    .quick-action-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 12px 8px !important;
        background: white !important;
        border: 2px solid #6a8d73 !important;
        border-radius: 10px !important;
        color: #6a8d73 !important;
        text-decoration: none !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
        text-align: center !important;
    }
    
    .quick-action-btn i {
        font-size: 1.4rem !important;
        color: inherit !important;
    }
    
    .quick-action-btn span {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }
    
    /* Bouton primaire (Réserver) */
    .quick-action-btn.primary {
        background: linear-gradient(135deg, #6a8d73, #8abf9e) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 4px 12px rgba(106, 141, 115, 0.3) !important;
    }
    
    .quick-action-btn.primary i {
        color: white !important;
        animation: pulse-icon 2s ease-in-out infinite !important;
    }
    
    /* Hover sur les boutons */
    .quick-action-btn:not(.primary):hover {
        background: #6a8d73 !important;
        color: white !important;
        transform: translateY(-2px) !important;
    }
    
    .quick-action-btn.primary:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(106, 141, 115, 0.4) !important;
    }
    
    @keyframes pulse-icon {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.15); }
    }
    
    /* Cache sur desktop */
    @media (min-width: 769px) {
        .mobile-logo-center,
        .mobile-quick-actions {
            display: none !important;
        }
    }
    
    /* Étoiles et note */
    .stars-rating {
        text-align: center !important;
        margin: 1.5rem 0 !important;
        padding: 1rem !important;
        background: linear-gradient(135deg, #fafbfc 0%, #f0f4f8 100%) !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    }
    
    .stars-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .stars {
        font-size: 1.8rem !important;
        letter-spacing: 4px !important;
        line-height: 1 !important;
    }
    
    .rating-text {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #6a8d73 !important;
        font-family: 'Lora', serif !important;
    }
    
    .review-count {
        font-size: 0.9rem !important;
        color: #666 !important;
        font-style: italic !important;
    }
    
    @media (max-width: 768px) {
        .stars-rating {
            margin: 1rem 0 !important;
            padding: 0.8rem !important;
        }
        
        .stars {
            font-size: 1.5rem !important;
            letter-spacing: 2px !important;
        }
        
        .rating-text {
            font-size: 1.1rem !important;
        }
        
        .review-count {
            font-size: 0.85rem !important;
        }
    }
    
    /* Fix pour la section FAQ */
    .faq-section {
        clear: both !important;
        width: 100% !important;
        margin: 2rem 0 !important;
    }
    
    .faq-header {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }
    
    .faq-header i {
        display: block !important;
        font-size: 2.5rem !important;
        color: #6a8d73 !important;
        margin-bottom: 1rem !important;
    }
    
    .faq-header h2 {
        font-size: 2rem !important;
        color: #2c5530 !important;
        margin: 0 !important;
        text-align: center !important;
    }
    
    .faq-item {
        width: 100% !important;
        display: block !important;
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 480px) {
    header {
        padding: 10px 0 !important;
    }
    
    header .container {
        padding: 6px 10px !important;
    }
    
    main.container {
        margin-top: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .logo {
        font-size: 0.85rem;
    }
}

/* Assure qu'aucun élément ne se superpose */
@media (max-width: 768px) {
    /* Le header reste en flux normal */
    header {
        z-index: 1 !important;
        position: static !important;
    }
    
    /* Le main en flux normal aussi */
    main {
        position: relative !important;
        z-index: auto !important;
        background: white !important;
    }
    
    /* Les sliders et autres éléments interactifs gardent leur z-index */
    .slider-container {
        z-index: 10 !important;
    }
    
    .slider-handle {
        z-index: 30 !important;
    }
}

/* Fix spécifique pour les sections qui ont un margin-top négatif */
section:first-of-type {
    margin-top: 0 !important;
}

.top-slider-section:first-of-type,
.card.intro-card:first-of-type {
    margin-top: 0 !important;
}

/* Assure que le H1 n'est pas caché sous le header */
main h1:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Fix pour les ancres (liens internes) - scroll avec offset */
html {
    scroll-padding-top: 80px; /* Pour compenser le header sticky */
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    /* Ajuste les tailles des éléments sur mobile */
    main h1 {
        font-size: 1.8rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    main h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    main h3 {
        font-size: 1.3rem !important;
    }
    
    /* Ajuste les sliders sur mobile */
    .top-slider-section {
        margin: 1rem 0 2rem 0 !important;
        padding: 1.5rem 0 !important;
    }
    
    #top-slider-container {
        height: 300px !important;
        max-width: 100% !important;
    }
    
    .slider-container {
        height: 300px !important;
    }
    
    /* Cards plus compactes sur mobile */
    .card {
        padding: 1.5rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    /* Sections avec background */
    section[style*="padding"] {
        padding: 1.5rem 0 !important;
    }
}

@media (max-width: 480px) {
    main h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    #top-slider-container,
    .slider-container {
        height: 250px !important;
        border-radius: 10px !important;
    }
    
    .card {
        padding: 1.2rem !important;
    }
}
