
:root {
    --color-primary: #3c2f8b;
    --color-primary-dark: #090058;
    --color-secondary: #F36B21;
    --color-white: #FFFFFF;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); font-size: 1rem; line-height: 1.6; color: var(--color-gray-800); background-color: var(--color-white); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color 0.15s; }
ul { list-style: none; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }

/* Widgets en colonnes */
.widgets-container { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.widget-wrapper { box-sizing: border-box; }
.page-main-content.widgets-container { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
@media (max-width: 768px) {
    .widget-wrapper { width: 100% !important; }
}

.navbar { position: fixed; top: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.98); box-shadow: 0 1px 3px rgba(0,0,0,0.08); z-index: 1000; transition: all 0.3s; }
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; min-height: 70px; }
.logo { display: flex; align-items: center; gap: 0; font-weight: 700; color: var(--color-primary); transition: transform 0.15s; flex-shrink: 0; }
.logo:hover { transform: scale(1.02); }
.logo-img { height: 50px; width: auto; object-fit: contain; max-width: 180px; }
.logo-text { font-size: 1.25rem; font-weight: 800; }
.nav-menu { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.nav-menu li { margin: 0; padding: 0; }
.nav-link { font-weight: 500; color: var(--color-gray-700); position: relative; padding: 0.5rem 0.75rem; transition: color 0.15s; font-size: 0.875rem; display: block; text-decoration: none; }
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.btn-connection { background: var(--color-primary); color: white !important; border-radius: 0.5rem; padding: 0.625rem 1.25rem !important; font-weight: 600; white-space: nowrap; }
.btn-connection:hover { background: var(--color-primary-dark); transform: translateY(-1px); }

/* Megamenu */
.nav-item-dropdown { position: relative; }
.dropdown-toggle { display: flex; align-items: center; gap: 0.25rem; }
.dropdown-arrow { font-size: 0.625rem; transition: transform 0.2s; }
.mega-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); background: white; border-radius: 1rem; box-shadow: 0 20px 40px rgba(0,0,0,0.15); padding: 1.5rem; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 1001; min-width: 500px; }
.nav-item-dropdown:hover .mega-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-item-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.mega-menu-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.mega-menu-column { }
.mega-menu-title { font-size: 0.75rem; font-weight: 700; color: var(--color-gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.75rem; }
.mega-menu-links { display: flex; flex-direction: column; gap: 0.25rem; }
.mega-menu-link { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem; border-radius: 0.5rem; transition: background 0.15s; }
.mega-menu-link:hover { background: var(--color-gray-50); }
.mega-menu-icon { font-size: 1.25rem; }
.mega-menu-link strong { display: block; font-weight: 600; color: var(--color-gray-900); margin-bottom: 0.125rem; }
.mega-menu-link span { font-size: 0.75rem; color: var(--color-gray-500); }

.mobile-menu-toggle { 
    display: none; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    gap: 6px; 
    background: var(--color-gray-50); 
    border: 1px solid var(--color-gray-200); 
    border-radius: 8px;
    cursor: pointer; 
    padding: 10px; 
    z-index: 1002;
    width: 48px;
    height: 48px;
}
.mobile-menu-toggle span { 
    width: 24px; 
    height: 2px; 
    background: var(--color-gray-700); 
    transition: all 0.3s ease; 
    border-radius: 2px;
    display: block;
}
.mobile-menu-toggle.active { background: var(--color-primary); border-color: var(--color-primary); }
.mobile-menu-toggle.active span { background: white; }
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 968px) {
    .nav-wrapper { min-height: 60px; padding: 0.5rem 0; }
    .logo-img { height: 40px; max-width: 140px; }
    .logo-text { font-size: 1.125rem; }
    .mobile-menu-toggle { display: flex; }
    .nav-menu { 
        position: fixed; 
        top: 0; 
        left: 0; 
        right: 0; 
        bottom: 0;
        background: #ffffff; 
        flex-direction: column; 
        padding: 80px 1.5rem 2rem; 
        transform: translateX(100%); 
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); 
        gap: 0; 
        overflow-y: auto;
        z-index: 1001;
        list-style: none;
    }
    .nav-menu.active { transform: translateX(0); }
    .nav-menu li { width: 100%; }
    .nav-link { 
        font-size: 1rem; 
        padding: 1rem 0; 
        border-bottom: 1px solid var(--color-gray-100); 
        display: block; 
        width: 100%;
        color: var(--color-gray-800);
    }
    .nav-link:hover { color: var(--color-primary); background: none; }
    .nav-item-dropdown { width: 100%; }
    .mega-menu { 
        position: static; 
        transform: none !important; 
        opacity: 1; 
        visibility: visible; 
        box-shadow: none; 
        min-width: auto; 
        padding: 0.5rem 0 1rem 1rem; 
        background: var(--color-gray-50);
        border-radius: 0.5rem;
        margin: 0.5rem 0;
    }
    .mega-menu-content { grid-template-columns: 1fr; gap: 0.25rem; }
    .mega-menu-link { padding: 0.625rem 0.75rem; }
    .mega-menu-link strong { font-size: 0.875rem; }
    .btn-connection { 
        width: 100%; 
        text-align: center; 
        margin-top: 1.5rem; 
        padding: 1rem !important; 
        font-size: 1rem; 
        border-radius: 0.75rem !important;
    }
}

.footer { background: var(--color-gray-900); color: var(--color-white); padding: 3rem 0 1rem; margin-top: 4rem; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-section { }
.footer-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1rem; }
.footer-description { font-size: 0.875rem; opacity: 0.8; line-height: 1.6; }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.875rem; opacity: 0.7; }

/* BUTTONS */
.btn { display: inline-block; padding: 0.75rem 1.5rem; font-weight: 600; border-radius: 0.5rem; transition: all 0.15s ease-in-out; cursor: pointer; border: none; font-size: 1rem; text-align: center; text-decoration: none; }
.btn-primary { background: var(--color-white); color: var(--color-primary); }
.btn-primary:hover { background: var(--color-gray-100); transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.btn-secondary { background: transparent; color: var(--color-white); border: 2px solid var(--color-white); }
.btn-secondary:hover { background: var(--color-white); color: var(--color-primary); }
.btn-large { padding: 1rem 2rem; font-size: 1.125rem; }

/* SECTIONS */
section { padding: 3rem 0; }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-title { font-size: 1.875rem; font-weight: 800; color: var(--color-gray-900); margin-bottom: 0.75rem; }
.section-subtitle { font-size: 1rem; color: var(--color-gray-600); max-width: 600px; margin: 0 auto; line-height: 1.6; }

/* HERO */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 3rem; overflow: hidden; }

/* FAQ */
.faq-item { background: #F9FAFB; border-radius: 0.75rem; margin-bottom: 1rem; overflow: hidden; border: 1px solid #E5E7EB; }
.faq-question { padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.3s; gap: 1rem; }
.faq-question:hover { background: #F3F4F6; }
.faq-question h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #111827; flex: 1; }
.faq-question span { font-size: 1.5rem; font-weight: 300; width: 30px; min-width: 30px; text-align: center; transition: transform 0.3s ease; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.5s ease-in-out; }
.faq-answer p { color: #374151; line-height: 1.8; font-size: 0.95rem; margin: 0; padding: 0 1.5rem 1.5rem; }
.faq-item.active .faq-answer { max-height: 2000px; }
.faq-item.active .faq-question span { transform: rotate(45deg); }
.faq-item.active .faq-question { background: rgba(var(--color-primary-rgb), 0.05); }

/* ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }

.loading { text-align: center; padding: 2rem; color: var(--color-gray-500); }

/* Cookie Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(17, 24, 39, 0.97); backdrop-filter: blur(10px); z-index: 999999; padding: 1rem; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); animation: slideUp 0.4s ease-out; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cookie-content { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.cookie-text { display: flex; align-items: flex-start; gap: 1rem; flex: 1; min-width: 280px; color: #E5E7EB; }
.cookie-icon { font-size: 2rem; color: var(--color-secondary); flex-shrink: 0; }
.cookie-text strong { display: block; font-size: 1rem; font-weight: 700; color: white; margin-bottom: 0.25rem; }
.cookie-text p { font-size: 0.875rem; line-height: 1.5; margin: 0; }
.cookie-text a { color: var(--color-secondary); text-decoration: underline; }
.cookie-text a:hover { color: white; }
.cookie-buttons { display: flex; gap: 0.75rem; flex-shrink: 0; }
.cookie-btn { padding: 0.625rem 1.25rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: all 0.2s; border: none; }
.cookie-btn-primary { background: var(--color-secondary); color: white; }
.cookie-btn-primary:hover { background: var(--color-primary); transform: translateY(-1px); }
.cookie-btn-secondary { background: transparent; color: #9CA3AF; border: 1px solid #4B5563; }
.cookie-btn-secondary:hover { background: #374151; color: white; }
@media (max-width: 640px) { .cookie-content { flex-direction: column; align-items: stretch; } .cookie-buttons { justify-content: stretch; } .cookie-btn { flex: 1; text-align: center; } }

/* Mobile Navigation Bar */
.mobile-nav-bar { 
    display: none; 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: #ffffff; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12); 
    z-index: 99998; 
    padding: 0; 
    border-top: 1px solid #e5e7eb;
    height: auto;
    min-height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-content { 
    display: flex; 
    justify-content: space-around; 
    align-items: stretch; 
    min-height: 60px;
    max-width: 100%; 
    margin: 0; 
    padding: 8px 0; 
}
.mobile-nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 4px; 
    color: #6B7280; 
    text-decoration: none; 
    padding: 8px 12px; 
    transition: all 0.2s; 
    flex: 1; 
    min-width: 0;
    border-top: 3px solid transparent;
    min-height: 50px;
}
.mobile-nav-item i { 
    font-size: 1.25rem; 
    transition: all 0.2s; 
    line-height: 1;
}
.mobile-nav-item span { 
    font-size: 0.625rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.mobile-nav-item:hover, .mobile-nav-item.active { 
    color: var(--color-primary); 
    background: linear-gradient(to top, rgba(var(--color-primary-rgb, 60, 47, 139), 0.08), transparent);
    border-top-color: var(--color-primary);
}
.mobile-nav-item.active i { 
    transform: scale(1.1); 
}

/* ============================================ */
/* RESPONSIVE - TABLET (max 968px) */
/* ============================================ */
@media (max-width: 968px) {
    .container { padding: 0 1.5rem; }
    section { padding: 3rem 0; }
    .section-title { font-size: 1.75rem; }
    .section-subtitle { font-size: 0.9375rem; }
    
    /* Hero */
    .hero { min-height: auto; padding: 6rem 0 4rem; }
    .hero-content { text-align: center; }
    .hero h1 { font-size: 2rem !important; }
    .hero p { font-size: 1rem !important; }
    .hero-buttons { flex-direction: column; gap: 1rem; align-items: center; }
    .hero-buttons .btn { width: 100%; max-width: 300px; }
    
    /* Stats */
    .stats-grid, [class*='stats'] > div { 
        display: grid !important; 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 1.5rem !important; 
    }
    
    /* Footer */
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

/* ============================================ */
/* RESPONSIVE - MOBILE (max 768px) */
/* ============================================ */
@media (max-width: 768px) {
    html { font-size: 15px; }
    body { 
        padding-bottom: 75px !important; 
        padding-bottom: calc(75px + env(safe-area-inset-bottom, 0)) !important;
    }
    .container { padding: 0 1rem; max-width: 100%; }
    section { padding: 2.5rem 0; overflow-x: hidden; }
    
    /* Mobile Nav Bar visible */
    .mobile-nav-bar { display: block; }
    .cookie-banner { bottom: 85px; }
    
    /* Hero adjustments */
    .hero { min-height: auto; padding: 5rem 1rem 3rem; }
    .hero h1 { font-size: 1.75rem !important; line-height: 1.3 !important; }
    .hero p { font-size: 0.9375rem !important; }
    
    /* Hide hero stats box on mobile */
    .hero-stats-box { display: none !important; }
    
    /* Section titles */
    .section-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .section-subtitle { font-size: 0.875rem; }
    
    /* Grids to single column */
    .formation-grid, 
    .catalogue-grid,
    .features-grid,
    .services-grid,
    [class*='-grid'] { 
        display: grid !important;
        grid-template-columns: 1fr !important; 
        gap: 1.25rem !important; 
    }
    
    /* Stats 2 columns on mobile */
    .stats-grid, [class*='stats'] > div { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 1rem !important; 
    }
    .stat-item, [class*='stat-'] { 
        padding: 1rem !important; 
    }
    .stat-item h3, [class*='stat-'] h3 { font-size: 1.75rem !important; }
    .stat-item p, [class*='stat-'] p { font-size: 0.75rem !important; }
    
    /* Cards */
    .formation-card, .category-card, .session-card {
        margin: 0 !important;
    }
    
    /* Page with Sidebar - CRITICAL FIX */
    .page-with-sidebar,
    .page-layout,
    [style*='display: grid'][style*='grid-template-columns'] {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }
    .page-with-sidebar > .main-content,
    .page-layout > .main-content,
    .page-with-sidebar > div:first-child,
    .page-layout > div:first-child {
        order: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    .page-with-sidebar > .page-sidebar,
    .page-with-sidebar > aside,
    .page-layout > aside,
    .page-with-sidebar > div:last-child:not(.main-content),
    .page-layout > div:last-child:not(.main-content) {
        order: 2 !important;
        width: 100% !important;
        position: static !important;
        margin-top: 1.5rem !important;
    }
    .page-sidebar {
        position: static !important;
        top: auto !important;
    }
    
    /* Contact info */
    .contact-info-grid { 
        grid-template-columns: 1fr !important; 
        gap: 1rem !important;
    }
    .contact-item { 
        flex-direction: row !important; 
        gap: 1rem !important;
        padding: 1rem !important;
    }
    
    /* Legal sections */
    .legal-section, .legal-content section { 
        padding: 1.25rem !important; 
        margin-bottom: 1.5rem !important;
    }
    
    /* Footer */
    .footer { padding: 2.5rem 0 1rem; margin-top: 2rem; }
    .footer-content { 
        grid-template-columns: 1fr !important; 
        gap: 1.5rem; 
        text-align: center; 
    }
    .footer-section { margin-bottom: 1rem; }
    .footer-bottom { padding-top: 1.5rem; font-size: 0.8125rem; }
    
    /* Buttons */
    .btn { padding: 0.875rem 1.5rem; font-size: 0.9375rem; }
    .btn-large { padding: 1rem 1.75rem; font-size: 1rem; }
    
    /* CTA blocks */
    .cta-section, [class*='cta'] {
        padding: 2rem 1.5rem !important;
    }
    .cta-section h2, [class*='cta'] h2 { font-size: 1.375rem !important; }
    
    /* FAQ */
    .faq-question { padding: 1rem; }
    .faq-question h3 { font-size: 0.9375rem; }
    .faq-answer p { padding: 0 1rem 1rem; font-size: 0.875rem; }
    
    /* Process steps */
    .process-steps, [class*='processus'] > div {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    /* Session cards */
    .session-card-header { flex-direction: column; gap: 0.75rem; }
    .session-details { flex-direction: column; gap: 0.5rem; }
    
    /* Highlights */
    .highlight-box, [class*='highlight'] {
        padding: 1.5rem !important;
    }
    .highlight-box h1, .highlight-box h2 { font-size: 1.5rem !important; }
    
    /* Breadcrumb */
    .breadcrumb { font-size: 0.8125rem; flex-wrap: wrap; gap: 0.25rem; }
    
    /* Images */
    img { max-width: 100%; height: auto; }
    
    /* Prevent horizontal overflow */
    * { max-width: 100vw; }
    [style*='width:'] { max-width: 100% !important; }
}

/* ============================================ */
/* RESPONSIVE - SMALL MOBILE (max 480px) */
/* ============================================ */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .container { padding: 0 0.75rem; }
    section { padding: 2rem 0; }
    
    .hero h1 { font-size: 1.5rem !important; }
    .hero p { font-size: 0.875rem !important; }
    
    .section-title { font-size: 1.25rem; }
    
    /* Stats single column on very small */
    .stats-grid, [class*='stats'] > div { 
        grid-template-columns: 1fr !important; 
    }
    
    .btn { padding: 0.75rem 1.25rem; font-size: 0.875rem; }
    .btn-large { padding: 0.875rem 1.5rem; font-size: 0.9375rem; }
    
    .footer-content { gap: 1.25rem; }
    
    /* Mobile nav - keep it usable on small screens */
    .mobile-nav-bar { 
        min-height: 56px; 
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .mobile-nav-content {
        min-height: 56px;
        padding: 6px 0;
    }
    .mobile-nav-item { 
        padding: 6px 8px; 
        gap: 3px;
        min-height: 44px;
    }
    .mobile-nav-item i { font-size: 1.125rem; }
    .mobile-nav-item span { 
        font-size: 0.5625rem; 
        letter-spacing: 0; 
    }
}

/* ============================================ */
/* FORMATIONS CATALOGUE PAGE - PRO DESIGN */
/* ============================================ */
.formations-catalogue { width: 100%; }
.formations-grid { display: grid; gap: 1.5rem; }

/* Card hover effects */
.formation-card { cursor: pointer; }
.formation-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.12); 
    border-color: var(--color-primary);
}
.formation-card:hover .card-image img { transform: scale(1.08); }
.formation-card:hover .card-overlay { opacity: 1; }
.formation-card:hover .card-cta { 
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary)); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

/* View toggle buttons */
.view-btn { transition: all 0.2s; }
.view-btn:hover { background: var(--color-gray-50); }
.view-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Sidebar */
.catalogue-sidebar .filter-label:hover { background: var(--color-gray-50); }
.catalogue-sidebar input[type='radio']:checked + span { color: var(--color-primary); font-weight: 600; }

/* List view */
.formations-grid.list-view { grid-template-columns: 1fr !important; }
.formations-grid.list-view .formation-card { 
    flex-direction: row; 
    max-height: 220px;
}
.formations-grid.list-view .card-image { 
    width: 280px; 
    min-width: 280px; 
    height: 100%; 
}
.formations-grid.list-view .card-content { 
    padding: 24px; 
}
.formations-grid.list-view .card-meta { 
    grid-template-columns: repeat(4, auto); 
    justify-content: flex-start;
}

@media (max-width: 992px) {
    .formations-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
    .formations-grid { grid-template-columns: 1fr !important; }
    .catalogue-sidebar { margin-bottom: 1.5rem; }
    .formations-grid.list-view .formation-card { flex-direction: column; max-height: none; }
    .formations-grid.list-view .card-image { width: 100%; height: 180px; min-width: auto; }
    .formations-grid.list-view .card-meta { grid-template-columns: repeat(2, 1fr); }
    .catalogue-header { flex-direction: column; gap: 1rem; align-items: stretch !important; }
}

/* ============================================ */
/* PAGE LAYOUT IMPROVEMENTS */
/* ============================================ */
.page-layout, .page-with-sidebar {
    display: grid;
    gap: 2rem;
}
.page-layout.sidebar-left { grid-template-columns: 280px 1fr; }
.page-layout.sidebar-right { grid-template-columns: 1fr 280px; }
.page-layout.sidebar-left .page-sidebar { order: 0; }
.page-layout.sidebar-right .page-sidebar { order: 1; }

@media (max-width: 968px) {
    .page-layout, .page-with-sidebar {
        display: flex !important;
        flex-direction: column !important;
    }
    .page-layout .page-sidebar,
    .page-with-sidebar .page-sidebar,
    .page-layout aside,
    .page-with-sidebar aside {
        order: 10 !important;
        width: 100% !important;
        position: static !important;
    }
    .page-layout .main-content,
    .page-with-sidebar .main-content {
        order: 0 !important;
        width: 100% !important;
    }
}

/* ============================================ */
/* FORMATIONS CATALOGUE - OVERFLOW FIX */
/* ============================================ */
.catalogue-container {
    min-width: 0;
}
.catalogue-container > * {
    min-width: 0;
}
.page-main-content { 
    min-width: 0; 
    overflow: hidden;
    width: 100%;
}
.formations-catalogue { 
    width: 100%; 
    min-width: 0;
    overflow: visible;
}
.formations-grid {
    min-width: 0;
    width: 100%;
}
.formation-card {
    min-width: 0;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.formation-card .card-content {
    min-width: 0;
}
.formation-card h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive catalogue container */
@media (max-width: 968px) {
    .catalogue-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    .catalogue-container > aside,
    .catalogue-container > .catalogue-sidebar {
        order: -1;
        width: 100% !important;
        position: static !important;
        margin-bottom: 1.5rem;
    }
    .catalogue-container > main,
    .catalogue-container > .page-main-content {
        width: 100% !important;
    }
}

/* ============================================ */
/* UTILITY CLASSES FOR OVERFLOW */
/* ============================================ */
.overflow-hidden { overflow: hidden !important; }
.w-full { width: 100% !important; }
.max-w-full { max-width: 100% !important; }
