/* Menu mobile */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background-color: white;
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid var(--gris-clair);
}

.close-mobile-menu {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--bleu-fonce);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-mobile-menu:hover {
    color: var(--orange);
}

.mobile-primary-menu {
    list-style: none;
    padding: 20px;
    flex: 1;
}

.mobile-primary-menu li {
    margin-bottom: 15px;
}

.mobile-primary-menu a {
    color: var(--bleu-fonce);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--gris-clair);
    transition: color 0.3s ease;
}

.mobile-primary-menu a:hover {
    color: var(--orange);
}

.mobile-menu-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid var(--gris-clair);
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-description {
        margin: 0 auto 25px;
    }
}

/* Typographie responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 32px !important;
    }
    
    h2 {
        font-size: 28px !important;
    }
    
    h3 {
        font-size: 22px !important;
    }
    
    p, li {
        font-size: 16px !important;
    }
}

/* Boutons responsive */
@media (max-width: 480px) {
    .btn-primary,
    .btn-hero-primary,
    .btn-hero-secondary,
    .btn-cta {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .hero-actions {
        flex-direction: column;
    }
}

/* Padding responsive */
@media (max-width: 768px) {
    .hero-section,
    .categories-section,
    .featured-courses,
    .cta-section {
        padding: 60px 0;
    }
    
    .footer-top {
        padding: 50px 0;
    }
    
    .container {
        padding: 0 15px;
    }
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .primary-menu {
        gap: 25px;
    }
    
    .btn-cta {
        padding: 10px 22px;
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .top-bar-content {
        justify-content: center;
        gap: 15px;
    }
    
    .contact-info {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .important-message {
        text-align: center;
    }
    
    .primary-menu {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-actions .btn-login span {
        display: none;
    }
    
    .header-actions .btn-login {
        padding: 10px;
    }
    
    .site-logo a {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 10px 0;
        font-size: 12px;
    }
    
    .contact-info {
        gap: 10px;
    }
    
    .contact-item {
        gap: 5px;
    }
    
    .important-message {
        padding: 3px 8px;
    }
    
    .message-text {
        font-size: 11px;
    }
    
    .site-header {
        padding: 12px 0;
    }
    
    .btn-cta {
        padding: 10px 18px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .top-bar {
        display: none;
    }
    
    .mobile-menu {
        width: 280px;
    }
    
    .header-actions .btn-cta {
        display: none;
    }
    
    .header-actions .btn-login {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-logo a {
        font-size: 24px;
    }
}

/* Afficher le bouton Mon compte sur desktop seulement */
@media (min-width: 993px) {
    .btn-login.desktop-login {
        display: flex !important;
    }
}

@media (max-width: 992px) {
    /* Cacher le bouton Mon compte sur mobile (sera dans le menu mobile) */
    .btn-login.desktop-login {
        display: none !important;
    }
    
    /* Afficher le panier mobile dans le menu */
    .mobile-menu-actions .cart-icon.mobile-cart {
        display: flex !important;
    }
    
    /* Styles pour les sous-menus mobiles */
    .mobile-primary-menu .mobile-sub-menu {
        background-color: rgba(132, 164, 197, 0.05);
        margin-left: 10px;
        border-left-width: 2px;
    }
    
    .mobile-primary-menu .mobile-sub-menu .mobile-sub-menu {
        background-color: rgba(132, 164, 197, 0.02);
        margin-left: 10px;
    }
}


/* Styles du bouton hamburger */
.menu-toggle {
    display: none; /* Caché par défaut */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--bleu-fonce);
    transition: all 0.3s ease;
    border-radius: 3px;
}

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

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

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

/* Afficher le bouton hamburger sur mobile */
@media (max-width: 992px) {
    .menu-toggle {
        display: flex !important; /* Force l'affichage */
    }
}



/* Par défaut : caché (mobile & tablette) */
.currency-selector {
    display: none;
}

/* Affiché uniquement sur ordinateur (≥ 1024px) */
@media screen and (min-width: 1024px) {
    .currency-selector {
        display: block; /* ou flex / inline-block selon ton layout */
    }
}


@media screen and (min-width: 768px) {
    .currency-selector {
        display: block;
    }
}




/* Dans votre responsive.css - Section menu hamburger */
.menu-toggle {
    display: none;
    width: 30px;
    height: 20px;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: 15px;
}

.menu-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--bleu-fonce);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.menu-toggle span:nth-child(1) {
    top: 0px;
}

.menu-toggle span:nth-child(2) {
    top: 8px;
}

.menu-toggle span:nth-child(3) {
    top: 16px;
}

.menu-toggle.active span:nth-child(1) {
    top: 8px;
    transform: rotate(135deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.menu-toggle.active span:nth-child(3) {
    top: 8px;
    transform: rotate(-135deg);
}

/* Afficher sur mobile */
@media (max-width: 992px) {
    .menu-toggle {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Pour être sûr qu'il est cliquable */
    .menu-toggle {
        width: 40px;
        height: 30px;
        padding: 10px;
    }
}

/* Si le problème persiste, ajoutez un contour */
.menu-toggle {
    outline: 2px solid rgba(16, 66, 131, 0.3);
    outline-offset: 3px;
    border-radius: 4px;
}



/* ===== MENU MOBILE RESTRUCTURÉ ===== */
.mobile-menu {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Contenu principal au milieu */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Commence en haut */
}

/* Menu principal */
.mobile-primary-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.mobile-primary-menu > li {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--gris-clair);
}

.mobile-primary-menu > li:last-child {
    border-bottom: none;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--bleu-fonce);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 15px 0;
    transition: all 0.3s ease;
    width: 100%;
}

.mobile-menu-link:hover {
    color: var(--orange);
}

/* Sous-menus */
.mobile-sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(132, 164, 197, 0.05);
    margin-left: 15px;
    border-radius: 8px;
}

.mobile-sub-menu.active {
    max-height: 500px;
    padding: 10px 0;
}

.mobile-sub-menu.level-0 {
    margin-left: 0;
    background: transparent;
    padding-left: 15px;
    border-left: 2px solid var(--bleu-pastel);
}

.mobile-sub-menu li {
    margin-bottom: 0;
}

.mobile-sub-menu .mobile-menu-link {
    font-size: 16px;
    padding: 12px 15px;
    font-weight: 400;
}

/* Bouton toggle pour sous-menus */
.mobile-submenu-toggle {
    background: none;
    border: none;
    color: var(--bleu-fonce);
    cursor: pointer;
    padding: 10px 15px;
    margin-left: auto;
    transition: transform 0.3s ease;
    min-width: 44px; /* Pour l'accessibilité */
    min-height: 44px;
}

.mobile-submenu-toggle.active {
    transform: rotate(180deg);
    color: var(--orange);
}

.mobile-submenu-toggle i {
    font-size: 14px;
}

/* Pied de page du menu mobile */
.mobile-menu-footer {
    background: var(--gris-clair);
    padding: 20px;
    border-top: 2px solid var(--bleu-pastel);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-footer-top {
    display: flex;
    justify-content: center;
}

/* Sélecteur de devise */
.mobile-currency-selector {
    width: 100%;
    max-width: 200px;
}

.mobile-currency-selector .alloformation-currency-switcher {
    width: 100%;
}

.mobile-currency-selector .currency-switcher-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: white;
    border: 2px solid var(--bleu-clair);
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
}

/* Actions en bas */
.mobile-footer-bottom {
    display: flex;
    justify-content: space-around;
    align-items: center;

}

.mobile-footer-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--bleu-fonce);
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.mobile-footer-action:hover {
    background: white;
    color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mobile-footer-action i {
    font-size: 22px;
    margin-bottom: 5px;
}

.mobile-footer-action span {
    font-size: 14px;
    font-weight: 500;
}

/* Compteur panier */
.mobile-cart-count {
    position: absolute;
    top: -5px;
    right: 5px;
    background: var(--orange);
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-action {
    position: relative;
}

/* Animation d'entrée */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-menu-footer > * {
    animation: slideInUp 0.4s ease forwards;
}

.mobile-footer-bottom .mobile-footer-action:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-footer-bottom .mobile-footer-action:nth-child(2) {
    animation-delay: 0.2s;
}

/* Responsive pour très petits écrans */
@media (max-width: 375px) {
    .mobile-footer-bottom {
        justify-content: space-between;
        gap: 5px;
    }
    
    .mobile-footer-action {
        padding: 8px 10px;
        min-width: 70px;
    }
    
    .mobile-footer-action i {
        font-size: 20px;
    }
    
    .mobile-footer-action span {
        font-size: 12px;
    }
}


/* Indicateur visuel pour les éléments avec sous-menus */
.mobile-primary-menu .menu-item-has-children > .mobile-menu-link::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bleu-clair);
    margin-left: 10px;
    opacity: 0.5;
}

/* État actif pour la page courante */
.mobile-primary-menu .current-menu-item > .mobile-menu-link {
    color: var(--orange);
    font-weight: 600;
}

.mobile-primary-menu .current-menu-item > .mobile-menu-link::before {
    content: "•";
    margin-right: 10px;
    color: var(--orange);
}

/* Animation de l'overlay */
.mobile-menu-overlay {
    transition: opacity 0.3s ease;
}



/* ===== SOUS-MENUS MOBILES ===== */
.mobile-primary-menu .menu-item-has-children {
    position: relative;
}

.mobile-submenu-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(132, 164, 197, 0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bleu-fonce);
    transition: all 0.3s ease;
    z-index: 10;
}

.mobile-submenu-toggle:hover {
    background: rgba(16, 66, 131, 0.15);
    color: var(--orange);
}

.mobile-submenu-toggle.active {
    background: var(--bleu-clair);
    color: white;
    transform: translateY(-50%) rotate(180deg);
}

.mobile-submenu-toggle i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* Sous-menus */
.mobile-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 15px;
    margin: 0;
    list-style: none;
    background: rgba(132, 164, 197, 0.05);
    border-radius: 8px;
    margin-top: 5px;
}

.mobile-sub-menu.active {
    max-height: 1000px; /* Assez grand pour contenir tous les éléments */
    padding: 10px 0;
}

.mobile-sub-menu li {
    margin: 0;
    padding: 0;
    border-bottom: none;
}

.mobile-sub-menu .mobile-menu-link {
    font-size: 16px;
    padding: 10px 15px;
    font-weight: 400;
    color: var(--bleu-fonce);
    opacity: 0.9;
}

.mobile-sub-menu .mobile-menu-link:hover {
    color: var(--orange);
    opacity: 1;
    padding-left: 20px;
}

/* Sous-menus de niveau 2 */
.mobile-sub-menu .mobile-sub-menu {
    background: rgba(132, 164, 197, 0.02);
    margin-left: 10px;
}

/* Indicateur visuel pour les éléments avec sous-menus */
.mobile-primary-menu .menu-item-has-children > .mobile-menu-link {
    padding-right: 50px; /* Espace pour le bouton toggle */
}

/* Animation de l'icône */
@keyframes rotateDown {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

@keyframes rotateUp {
    from { transform: rotate(180deg); }
    to { transform: rotate(0deg); }
}

.mobile-submenu-toggle.active i {
    animation: rotateDown 0.3s ease forwards;
}

.mobile-submenu-toggle:not(.active) i {
    animation: rotateUp 0.3s ease forwards;
}



/* Animation des sous-menus */
.mobile-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height;
}

.mobile-sub-menu.active {
    max-height: 1000px; /* Une valeur assez grande */
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation de l'icône */
.mobile-submenu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-submenu-toggle.active i {
    transform: rotate(180deg);
}

/* Style pour voir quand c'est actif */
.mobile-submenu-toggle.active {
    background-color: var(--bleu-clair);
    color: white;
}

.mobile-sub-menu.level-0 {
    background: rgba(132, 164, 197, 0.05);
    margin-left: 15px;
    border-left: 2px solid var(--bleu-pastel);
    padding-left: 10px;
}

/* Désactiver temporairement les transitions pour debug */
/* 
.mobile-sub-menu {
    transition: none !important;
}
*/


/* Animation fluide pour les sous-menus */
.mobile-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sub-menu.active {
    max-height: 500px; /* Assez grand pour tout contenu */
}

/* Animation de l'icône */
.mobile-submenu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-submenu-toggle.active i {
    transform: rotate(180deg);
}

/* Empêcher la sélection de texte pendant l'animation */
.mobile-menu * {
    user-select: none;
}

.mobile-menu a {
    user-select: text;
}




.mobile-sub-menu {
    display: none;
    padding-left: 15px;
}

.mobile-sub-menu.active {
    display: block;
}