/* ========================================
   RESPONSIVE COMPLET - 3 NIVEAUX OPTIMISÉS
   Tout visible, rien de coupé, pas de scroll horizontal
   ======================================== */

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Le nav dans le header ne doit PAS clipper les dropdown menus */
.header--home .nav.container {
    overflow: visible !important;
}

/* ========================================
   MOBILE (<700px)
   ======================================== */
@media (max-width: 699px) {
    /* Container et spacing */
    .container {
        padding: 0 0.75rem !important;
        max-width: 100%;
    }
    
    body {
        font-size: 14px;
    }
    
    /* Navigation - Menu hamburger VISIBLE */
    .nav {
        padding: 0.75rem 1rem;
    }
    
    .nav__logo-img {
        height: 35px;
        width: 35px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    /* Nav publique supprimée — gérée par home-redesign.css (.header--home) */

    /* Admin - Sidebar et hamburger VISIBLE */
    .mobile-menu-btn {
        display: flex !important;
        position: fixed !important;
        top: 1rem;
        left: 1rem;
        z-index: 9999;
        width: 45px;
        height: 45px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        border: none !important;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.4rem;
    }
    
    .mobile-menu-btn i {
        color: white !important;
    }
    
    .admin-sidebar,
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -100% !important;
        width: 260px !important;
        height: 100vh !important;
        transition: left 0.4s ease;
        z-index: 9998;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .admin-sidebar.show,
    .sidebar.show {
        left: 0 !important;
    }
    
    #sidebarOverlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9997;
    }
    
    #sidebarOverlay.active {
        display: block;
    }
    
    .admin-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 4rem 0.75rem 1rem !important;
    }
    
    /* Hero */
    .hero {
        min-height: 450px !important;
        padding: 3.5rem 0 2.5rem !important;
    }
    
    .hero__content {
        padding: 0 0.75rem;
    }
    
    .hero__content h1 {
        font-size: 1.6rem !important;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .hero__content p {
        font-size: 0.9rem !important;
        margin-bottom: 1.25rem;
    }
    
    .hero__buttons {
        flex-direction: column !important;
        gap: 0.75rem;
        width: 100%;
        padding: 0 0.75rem;
    }
    
    .hero__buttons .btn {
        width: 100%;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Grilles - 1 colonne */
    .services__grid,
    .stats__grid,
    .pricing__grid,
    .employes-grid,
    .products-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Cards */
    .card,
    .service-card,
    .pricing-card,
    .product-card {
        margin: 0 0.75rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
    
    .table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem !important;
    }
    
    /* Page headers */
    .page-header {
        flex-direction: column !important;
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem !important;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    /* Calendar widget */
    .home-calendar-widget {
        padding: 1rem !important;
        margin: 0 0.75rem;
    }
    
    .calendar-grid {
        gap: 2px !important;
    }
    
    .calendar-header h3 {
        font-size: 0.95rem !important;
    }
    
    .calendar-nav-btn {
        font-size: 1.1rem !important;
        padding: 0.25rem;
    }
    
    .calendar-legend {
        flex-direction: column !important;
        gap: 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Shop */
    .shop-hero {
        padding: 3rem 0 2rem !important;
    }
    
    .shop-hero__title {
        font-size: 1.6rem !important;
        padding: 0 0.75rem;
    }
    
    .shop-filters {
        flex-direction: column !important;
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .filter-btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.6rem;
    }
    
    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
        padding: 0 0.75rem;
    }
    
    /* Sections */
    .section {
        padding: 2.5rem 0 !important;
    }
    
    .section__title {
        font-size: 1.5rem !important;
        padding: 0 0.75rem;
    }
    
    .section__description {
        font-size: 0.9rem !important;
        padding: 0 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ========================================
   TABLETTE (700-1000px)
   ======================================== */
@media (min-width: 700px) and (max-width: 1000px) {
    /* Container */
    .container {
        padding: 0 1.5rem !important;
        max-width: 100%;
    }
    
    body {
        font-size: 15px;
    }
    
    /* Navigation - Hamburger menu */
    .nav {
        padding: 1rem 1.5rem;
    }
    
    /* Nav publique supprimée — gérée par home-redesign.css (.header--home) */

    /* Admin - Sidebar hamburger */
    .mobile-menu-btn {
        display: flex !important;
        position: fixed !important;
        top: 1.25rem;
        left: 1.25rem;
        z-index: 9999;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        border: none !important;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1.5rem;
    }
    
    .mobile-menu-btn i {
        color: white !important;
    }
    
    .admin-sidebar,
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        transition: left 0.4s ease;
        z-index: 9998;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .admin-sidebar.show,
    .sidebar.show {
        left: 0 !important;
    }
    
    #sidebarOverlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9997;
    }
    
    #sidebarOverlay.active {
        display: block;
    }
    
    .admin-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 5rem 1.5rem 2rem !important;
    }
    
    /* Hero */
    .hero {
        min-height: 550px !important;
        padding: 5rem 0 3.5rem !important;
    }
    
    .hero__content h1 {
        font-size: 2rem !important;
    }
    
    .hero__content p {
        font-size: 1rem !important;
    }
    
    .hero__buttons {
        flex-direction: row !important;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    /* Grilles - 2 colonnes */
    .services__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .stats__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .pricing__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .employes-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        min-width: 700px;
    }
    
    /* Calendar */
    .home-calendar-widget {
        padding: 1.5rem !important;
    }
    
    /* Shop */
    .shop-filters {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Page headers */
    .page-header {
        flex-direction: row !important;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Footer */
    .footer__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }
    
    /* Sections */
    .section {
        padding: 3.5rem 0 !important;
    }
}

/* ========================================
   DESKTOP (>1000px)
   ======================================== */
@media (min-width: 1001px) {
    /* Container */
    .container {
        padding: 0 2.5rem !important;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    /* Nav publique supprimée — gérée par home-redesign.css (.header--home) */

    /* Admin - Sidebar fixe */
    .mobile-menu-btn {
        display: none !important;
    }
    
    .admin-sidebar,
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 100;
    }
    
    .admin-content {
        margin-left: 280px !important;
        width: calc(100% - 280px);
        padding: 2rem !important;
    }
    
    /* Hero */
    .hero {
        min-height: 650px !important;
        padding: 8rem 0 5rem !important;
    }
    
    .hero__content h1 {
        font-size: 3rem !important;
    }
    
    .hero__content p {
        font-size: 1.15rem !important;
    }
    
    /* Grilles - Layout complet */
    .services__grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2rem !important;
    }
    
    .stats__grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2rem !important;
    }
    
    .pricing__grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
    
    .employes-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
    
    .gallery__grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    /* Footer */
    .footer__grid {
        grid-template-columns: 2fr repeat(3, 1fr) !important;
        gap: 3rem;
    }
    
    /* Sections */
    .section {
        padding: 5rem 0 !important;
    }
    
    /* Hover effects */
    .btn:hover {
        transform: translateY(-2px);
    }
    
    .service-card:hover,
    .pricing-card:hover,
    .product-card:hover {
        transform: translateY(-5px);
    }
}

/* ========================================
   CORRECTIONS GLOBALES
   ======================================== */

/* Empêcher le scroll horizontal */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Images responsives */
img {
    max-width: 100%;
    height: auto;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9996;
}

.sidebar-overlay.active {
    display: block;
}

/* Touch targets */
@media (max-width: 1000px) {
    button,
    .btn,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Fix z-index hierarchy */
.nav {
    z-index: 1002;
}

/* z-index nav supprimé — géré par home-redesign.css */

.mobile-menu-btn {
    z-index: 9999;
}

.admin-sidebar {
    z-index: 9998;
}

#sidebarOverlay {
    z-index: 9997;
}
