/* ===== RESPONSIVE CSS SHEVA SIMPLIFIÉ ===== */

/* Correction du problème de scroll horizontal */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== BOUTON HAMBURGER MOBILE ===== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 25px;
    height: 20px;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

.mobile-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Correction du header pour éviter le scroll horizontal */
.header {
    width: 100%;
    max-width: 100vw;
}

.nav-container {
    width: 100%;
    max-width: 100%;
}

/* ===== VERSION PC (769px et plus) ===== */
@media (min-width: 769px) {
    .header {
        position: relative;
        z-index: 1000;
        overflow: visible;
    }
    .nav-container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }
    .nav-menu li {
        position: relative;
    }

    /* Dropdowns PC */
    .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background: linear-gradient(
            135deg,
            rgb(94, 180, 174) 0%,
            rgb(69, 144, 150) 100%
        );
        min-width: 250px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        border-radius: 8px;
        overflow: hidden;
        z-index: 9999;
        margin: 0;
        padding: 0;
    }

    .dropdown-parent:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.9rem;
        color: white;
        display: block;
        text-decoration: none;
        transition: background 0.3s ease;
        white-space: nowrap;
    }

    .dropdown a:last-child {
        border-bottom: none;
    }

    .dropdown a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Container adaptatif PC */
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
        width: 100%;
    }
    /* Navigation flexible PC */
    .nav-main {
        display: flex;
        width: auto;
        flex: 1;
        justify-content: center;
    }

    .nav-menu {
        display: flex;
        gap: 2rem;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Grids adaptatifs PC */
    .content-grid,
    .preview-grid,
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* Sections en dessous */
    .hero-banner,
    .page-hero,
    .labels-section,
    .news-section,
    .preview-section,
    .content-section {
        z-index: 1;
        position: relative;
    }
}

/* ===== VERSION MOBILE (768px et moins) ===== */
@media (max-width: 768px) {
    /* Navigation mobile */
    /* Responsive pour les petits écrans */

    .labels-section {
        padding: 1.5rem 0;
    }

    .labels-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .label-badge {
        font-size: 0.9rem;
        padding: 0.5rem 1.2rem;
    }

    .label-badge:hover {
        transform: translateY(-2px);
    }

    .label-logos {
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
        max-width: 100%;
        padding: 0 1rem;
    }

    .label-logos img {
        height: 60px;
        max-width: 45%;
        object-fit: contain;
    }

    .mobile-toggle {
        display: block;
        position: relative;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .mobile-toggle:hover,
    .mobile-toggle:focus {
        background: rgba(255, 255, 255, 0.2);
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .header {
        position: sticky !important; /* vs sticky */
        top: 0 !important;
        z-index: 1000;
        width: 100%;
        max-width: 100vw;
        transform: none !important;
        transition: none !important; /* vs. None */
        min-height: 60px;
        padding: 0.3rem 0;
    }

    .nav-container {
        position: relative;
        width: 100%;
        max-width: 100%;
        min-height: 50px;
        gap: 1rem;
        padding: 0 1rem;
    }

    /* Navigation principale mobile */
    .nav-main {
        position: fixed;
        top: 60px;
        right: 0;
        width: 85vw;
        height: calc(100vh - 60px);
        max-width: 100vw;
        background: linear-gradient(
            135deg,
            rgb(94, 180, 174) 0%,
            rgb(69, 144, 150) 100%
        );
        flex-direction: column;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        opacity: 0;
        transform: translateX(100%);
        transition: all 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        visibility: hidden;
    }

    .nav-main.active {
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nav-menu a {
        padding: 1rem;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        min-height: 48px;
        margin: 0;
        color: #ffffff;
        background: transparent;
        text-decoration: none;
        transition: all 0.3s ease;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-menu a:hover,
    .nav-menu a:focus {
        background: rgba(255, 255, 255, 0.1);
        outline: 2px solid #fff;
        outline-offset: -2px;
    }

    .nav-menu a.active {
        background: rgba(255, 255, 255, 0.25);
        font-weight: bold;
        border-left: 4px solid #ffffff;
        color: #ffffff;
    }

    /* Dropdown mobile - toujours visibles */
    .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: rgba(0, 0, 0, 0.2) !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        overflow: visible !important;
        min-width: auto !important;
        z-index: 1 !important;
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        max-width: none !important;
        top: 0;
    }

    .dropdown a {
        padding: 0.8rem 2rem !important;
        font-size: 0.95rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        color: #ffffff !important;
        background: transparent !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        min-height: 48px !important;
        transition: all 0.3s ease !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        pointer-events: auto;
    }

    .dropdown a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    .dropdown-parent > a {
        padding: 1rem !important;
        font-size: 1.1rem !important;
        display: flex !important;
        align-items: center !important;
        min-height: 48px !important;
        margin: 0 !important;
        color: #ffffff !important;
        background: transparent !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative;
        z-index: auto;
    }

    .dropdown-parent > a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    .dropdown-parent {
        display: flex;
        flex-direction: column; /* empile le lien + le menu */
    }

    /* Bouton compte mobile */
    .btn-account {
        margin: 1rem;
        margin-top: auto;
        align-self: center;
        flex-shrink: 0;
        width: calc(100% - 2rem);
        max-width: 300px;
        text-align: center;
        box-sizing: border-box;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-account:focus {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    /* Container mobile */
    .container {
        padding: 0 1rem;
        width: 100%;
        max-width: 100vw;
    }

    /* Logo mobile */
    .logo-section {
        gap: 0.8rem;
    }

    .logo-image {
        height: 35px;
        max-width: 35px;
        padding: 2px;
    }

    .secondary-image {
        height: 30px;
        max-width: 30px;
        padding: 2px;
    }

    /* Hero mobile */
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    .hero-banner {
        padding: 4rem 1rem 3rem;
        min-height: 50vh;
    }

    /* Sections mobile */
    .section-title {
        font-size: 1.8rem;
    }

    .subsection-title {
        font-size: 1.3rem;
    }

    /* Grids mobile - toujours 1 colonne */
    .content-grid,
    .preview-grid,
    .news-grid,
    .stats-grid,
    .horse-grid,
    .installations-grid,
    .ca-grid,
    .functioning-grid,
    .contact-grid,
    .pricing-grid,
    .special-pricing,
    .location-grid,
    .calendar-grid-wrapper,
    .inscription-steps,
    .documents-grid,
    .access-methods,
    .access-grid,
    .equipment-grid,
    .competition-equipment,
    .features-grid,
    .organization-grid,
    .payment-grid,
    .terms-grid,
    .policy-content,
    .discounts-grid,
    .notes-grid,
    .highlights-grid,
    .safety-grid,
    .contact-quick {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Services grid - 2 colonnes sur mobile */
    .services-grid,
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Boutons mobile */
    .quick-buttons {
        flex-direction: column;
        align-items: center;
    }

    .quick-btn {
        width: 90%;
        max-width: 300px;
        padding: 0.8rem 1.5rem;
    }

    .download-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* Cards mobile */
    .content-card,
    .preview-content,
    .news-content {
        padding: 1.5rem;
    }

    /* Team mobile */
    .team-card {
        flex-direction: column;
    }

    .team-info {
        text-align: center;
    }

    .team-name {
        text-align: center;
    }

    .team-role {
        text-align: center;
    }

    .team-specs {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .team-spec {
        display: inline-block;
    }

    .team-bio {
        text-align: center;
    }

    .ca-content {
        text-align: center;
    }

    .ca-content h3 {
        text-align: center;
    }

    .ca-role {
        text-align: center;
    }

    .ca-specs {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ca-content p {
        text-align: center;
    }

    /* Planning mobile */
    .schedule-container {
        grid-template-columns: 1fr;
    }

    .time-slot {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }

    /* Location mobile */
    .location-maps-container,
    .location-photo-container {
        height: 250px;
    }

    /* Form mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Wellbeing mobile */
    .wellbeing-features .features-grid {
        grid-template-columns: 1fr;
    }

    /* Sections padding mobile */
    .news-section,
    .preview-section,
    .quick-access {
        padding: 3rem 1rem;
    }
    .footer {
        padding: 2rem 1rem 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        justify-content: center;
    }

    .footer-logos {
        flex-direction: column;
        gap: 1rem;
        justify-content: center;
    }

    .footer-logos img {
        height: 40px;
    }

    .footer-copyright {
        order: 1;
        font-size: 0.9rem;
    }
    .social-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
        align-items: center;
    }
}

/* ===== PRÉFÉRENCES D'ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .nav-main {
        transform: none !important;
        transition: opacity 0.2s ease !important;
    }
}

/* ===== IMPRESSION ===== */
@media print {
    .header,
    .footer,
    .quick-access,
    .mobile-toggle,
    .nav-main {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .preview-card,
    .news-card,
    .content-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
    }

    * {
        color: black !important;
        background: white !important;
    }

    a {
        text-decoration: underline !important;
    }
}

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

@media (max-width: 600px) {
    .member-inputs {
        grid-template-columns: 1fr;
    }

    .popup-container {
        width: 95%;
        margin: 10px;
    }

    .popup-content {
        padding: 20px;
    }

    .popup-header {
        padding: 20px;
    }

    .popup-title {
        font-size: 20px;
    }
}

@media (max-width: 400px) {
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 16px;
    }
    .label-logos {
        flex-direction: column;
        gap: 1rem;
    }

    .label-logos img {
        height: 70px;
        max-width: 80%;
    }
}
