/* ========================================
   MODERN HEADER STYLES
   ======================================== */

/* Header Principal */
.modern-header {
    position: relative;
    z-index: 1000;
}

.wrap-menu-desktop {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wrap-menu-desktop.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* Navigation Desktop Moderne */
.modern-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.modern-nav-item {
    position: relative;
}

.modern-nav-item.has-dropdown {
    position: relative;
}

.modern-nav-item.has-dropdown:hover,
.modern-nav-item.has-dropdown:hover .mega-dropdown {
    pointer-events: auto;
}

.modern-nav-item > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.2rem 0.8rem;
    color: #2d3748;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    position: relative;
}

.modern-nav-item > .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    transition: width 0.3s ease;
}

.modern-nav-item:hover > .nav-link,
.modern-nav-item.active-menu > .nav-link {
    color: #3b82f6;
}

.modern-nav-item:hover > .nav-link::before,
.modern-nav-item.active-menu > .nav-link::before {
    width: 100%;
}

.dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.modern-nav-item:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Mega Dropdown Moderne */
.mega-dropdown {
    position: absolute;
    top: calc(100% - 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 900px;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    padding-top: 2.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* Bridge invisible pour éviter que le menu disparaisse */
.mega-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    pointer-events: auto;
}

.modern-nav-item.has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.mega-dropdown-content {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subcategory Card */
.subcategory-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    height: 100%;
}

.subcategory-card:hover {
    background: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.subcategory-card:hover .subcategory-title {
    color: #3b82f6 !important;
}

.subcategory-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-list li {
    margin-bottom: 0.5rem;
}

.activity-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    word-wrap: break-word;
    word-break: break-word;
}

.activity-link:hover {
    background: #eff6ff;
    color: #2563eb;
    padding-left: 1rem;
}

/* Icons Header Modernes */
.modern-icon {
    position: relative;
}

.modern-icon i {
    font-size: 24px;
    color: #4a5568;
    transition: all 0.3s ease;
}

.modern-icon:hover i {
    color: #3b82f6;
    transform: scale(1.1) rotate(-10deg);
}

/* Profile Offcanvas Moderne */
.modern-offcanvas .offcanvas-header {
    background: #f8f9fa;
    color: #2d3748;
    border-bottom: 1px solid #e5e7eb;
}

.modern-offcanvas .offcanvas-title {
    color: #1a202c;
    font-weight: 700;
}

.modern-profile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-profile-menu li {
    margin-bottom: 1rem;
}

.modern-profile-menu .profile-greeting {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #1e293b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 16px;
    border: 1px solid #bfdbfe;
}

.modern-profile-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.modern-profile-menu a:hover {
    background: #eff6ff;
    color: #2563eb;
    transform: translateX(5px);
}

.modern-profile-menu a.text-danger:hover {
    background: #fee;
    color: #dc3545;
}

/* Mobile Menu Moderne */
.menu-mobile {
    width: 100%;
    background-color: #ffffff;
    display: none;
    padding-top: 20px;
    border-top: 1px solid #111111;
}

.menu-mobile.show-menu-mobile {
    display: block !important;
}

.modern-menu-mobile {
    background: #ffffff;
}

.main-menu-m {
    list-style: none;
    padding: 1rem;
    margin: 0;
}

.nav-item-m {
    border-bottom: 1px solid #d1d5db;
}

.category-link-m {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    color: #111111;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-link-m:hover {
    background: #111111;
    color: #ffffff;
}

.toggle-submenu {
    transition: transform 0.3s ease;
}

.toggle-submenu.turn-arrow-main-menu-m,
.nav-item-m.open .toggle-submenu {
    transform: rotate(180deg);
}

.submenu-m {
    list-style: none;
    padding-left: 1rem;
    display: none;
}

.nav-item-m.open .submenu-m {
    display: block;
}

.subcategory-link-m {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    color: #1f2937;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.subcategory-link-m:hover {
    background: #f3f4f6;
    color: #111111;
    padding-left: 1.5rem;
}

.activity-list-m {
    list-style: none;
    padding-left: 1rem;
    display: none;
}

.subcategory-item-m.open .activity-list-m {
    display: block;
}

.activity-link-m {
    display: block;
    padding: 0.6rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.activity-link-m:hover {
    background: #111111;
    color: #ffffff;
    padding-left: 1.5rem;
}

/* Force modern mobile menu palette (override legacy main.css blue) */
.modern-header .menu-mobile.modern-menu-mobile {
    background: #ffffff !important;
    border-top: 1px solid #bfdbfe !important;
}

.modern-header .menu-mobile.modern-menu-mobile .main-menu-m {
    background: #ffffff !important;
}

.modern-header .menu-mobile.modern-menu-mobile .main-menu-m > li > a {
    color: #1f2937 !important;
}

.modern-header .menu-mobile.modern-menu-mobile .category-link-m {
    color: #1f2937 !important;
}

.modern-header .menu-mobile.modern-menu-mobile .category-link-m:hover {
    background: #dbeafe !important;
    color: #0f172a !important;
}

.modern-header .menu-mobile.modern-menu-mobile .subcategory-link-m:hover {
    background: #eff6ff !important;
    color: #1e3a8a !important;
}

.modern-header .menu-mobile.modern-menu-mobile .activity-link-m:hover {
    background: #cfe4ff !important;
    color: #0f172a !important;
}

/* Rotation du chevron pour les activities */
.subcategory-link-m .bi-chevron-right {
    transition: transform 0.3s ease;
}

.subcategory-link-m .bi-chevron-right.rotate-down {
    transform: rotate(90deg);
}

/* Responsive */
/* Desktop large (1200px+) - taille normale */

/* Desktop moyen (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .modern-nav {
        gap: 1rem;
    }
    
    .modern-nav-item > .nav-link {
        padding: 1rem 0.7rem;
        font-size: 14px;
    }
    
    .mega-dropdown {
        min-width: 800px;
    }
    
    .subcategory-title {
        font-size: 15px;
    }
    
    .activity-link {
        font-size: 13px;
        padding: 0.4rem 0.6rem;
    }
}

/* Tablettes et grands mobiles (577px - 991px) */
@media (max-width: 991px) and (min-width: 577px) {
    .wrap-menu-desktop {
        display: none;
    }
    
    .wrap-header-mobile {
        display: flex;
    }
}

/* Desktop caché, Mobile affiché */
@media (max-width: 991px) {
    .wrap-menu-desktop {
        display: none;
    }
}

/* Mobile caché, Desktop affiché */
@media (min-width: 992px) {
    .wrap-header-mobile {
        display: none !important;
    }
    
    .menu-mobile {
        display: none !important;
    }
}

/* Animations d'entrée */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modern-header {
    animation: slideInFromTop 0.6s ease;
}

/* Hover Effects */
.modern-icon,
.modern-nav-item {
    cursor: pointer;
}

/* Badge moderne pour cart count */
.badge.rounded-pill.bg-danger {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    animation: pulseBlue 2s ease-in-out infinite;
}

@keyframes pulseBlue {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
    }
}

/* ========================================
   HAMBURGER MENU ICON
   ======================================== */
.hamburger {
    padding: 10px;
    display: inline-block;
    cursor: pointer;
    transition-property: opacity, filter;
    transition-duration: 0.15s;
    transition-timing-function: linear;
    font: inherit;
    color: inherit;
    text-transform: none;
    background-color: transparent;
    border: 0;
    margin: 0;
    overflow: visible;
}

.hamburger:hover {
    opacity: 0.7;
}

.hamburger-box {
    width: 28px;
    height: 20px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 28px;
    height: 3px;
    background-color: #2d3748;
    border-radius: 4px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -8px;
}

.hamburger-inner::after {
    bottom: -8px;
}

/* Hamburger Squeeze Animation */
.hamburger--squeeze .hamburger-inner {
    transition-duration: 0.075s;
    transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger--squeeze .hamburger-inner::before {
    transition: top 0.075s 0.12s ease, opacity 0.075s ease;
}

.hamburger--squeeze .hamburger-inner::after {
    transition: bottom 0.075s 0.12s ease, transform 0.075s cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.hamburger--squeeze.is-active .hamburger-inner {
    transform: rotate(45deg);
    transition-delay: 0.12s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

.hamburger--squeeze.is-active .hamburger-inner::before {
    top: 0;
    opacity: 0;
    transition: top 0.075s ease, opacity 0.075s 0.12s ease;
}

.hamburger--squeeze.is-active .hamburger-inner::after {
    bottom: 0;
    transform: rotate(-90deg);
    transition: bottom 0.075s ease, transform 0.075s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ========================================
   BOTTOM NAVIGATION MOBILE
   ======================================== */

#tel-bottom_nav {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    z-index: 998;
    background: linear-gradient(135deg, #8b9dc3 0%, #9fa8c5 100%);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    transition: bottom 0.4s ease;
    height: 70px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 !important;
}

/* Force display on mobile even with d-md-none */
@media (max-width: 767px) {
    #tel-bottom_nav {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    #tel-bottom_nav {
        display: none !important;
    }
}

#tel-bottom_nav.show {
    bottom: 0 !important;
}

#tel-bottom_nav ul {
    display: flex !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    justify-content: space-around;
    align-items: center;
}

#tel-bottom_nav ul li {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#tel-bottom_nav ul li a,
#tel-bottom_nav ul li button {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    gap: 4px;
}

#tel-bottom_nav ul li a i,
#tel-bottom_nav ul li button i {
    font-size: 28px !important;
    width: auto !important;
    height: auto !important;
    transition: all 0.3s ease;
    color: #ffffff !important;
}

#tel-bottom_nav ul li a:hover,
#tel-bottom_nav ul li button:hover {
    background: rgba(255, 255, 255, 0.12);
}

#tel-bottom_nav ul li a:hover i,
#tel-bottom_nav ul li button:hover i {
    transform: scale(1.12) translateY(-2px);
}

/* Badge panier */
#tel-bottom_nav #cart-count_bottom {
    position: absolute;
    top: 12px;
    right: 50%;
    transform: translateX(15px);
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    font-size: 11px !important;
    background: #ff5252;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 82, 82, 0.3);
}

/* Active state */
#tel-bottom_nav ul li a.active::before,
#tel-bottom_nav ul li button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background: #ffffff;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.4);
}
