/**
 * MMD Menu Primary - Megamenu Styles
 * Based on EXAMPLE prototype with centered overlay
 * @author MMD
 * @version 1.0.0
 */

/* === Menu Principal === */
.mmd-menu-primary {
    width: 100%;
}

.mmd-primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.mmd-primary-menu > li {
    position: relative;
    margin-right: 1rem;
}

.mmd-primary-menu > li > a {
    display: block;
    padding: 0.75rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mmd-primary-menu > li > a:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.mmd-primary-menu > li.current > a {
    font-weight: 600;
    color: #007bff;
}

/* === Megamenu Overlay === */
.megamenu-overlay {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 1200px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 9999;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* État actif */
.megamenu-overlay.active {
    display: block;
    opacity: 1;
}

/* Container interne avec padding */
.megamenu-container {
    padding: 30px;
}

/* Contenu principal */
.megamenu-content {
    width: 100%;
}

/* Colonnes */
.megamenu-col {
    padding: 0 15px;
}

/* Titres */
.megamenu-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2c3e50;
}

.megamenu-subtitle {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #34495e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Description */
.megamenu-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* CTA principal */
.megamenu-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.megamenu-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.megamenu-cta .material-icons {
    font-size: 18px;
}

/* Liste de liens */
.megamenu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.megamenu-links li {
    margin-bottom: 10px;
}

.megamenu-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 5px 0;
}

.megamenu-links a:hover {
    color: #007bff;
    padding-left: 5px;
}

.megamenu-links .material-icons {
    font-size: 18px;
    color: #95a5a6;
    transition: color 0.2s ease;
}

.megamenu-links a:hover .material-icons {
    color: #007bff;
}

/* Bloc promotion */
.megamenu-highlight {
    border-left: 1px solid #ecf0f1;
}

.megamenu-promo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    overflow: hidden;
    color: white;
}

.megamenu-promo-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    opacity: 0.8;
}

.megamenu-promo-content {
    padding: 20px;
}

.megamenu-promo-content h5 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.megamenu-promo-content p {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.megamenu-promo-content .btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.megamenu-promo-content .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Footer avec tags */
.megamenu-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.megamenu-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.megamenu-tag-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 14px;
}

.megamenu-tags .badge {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.megamenu-tags .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Animation d'entrée */
@keyframes megamenuFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.megamenu-overlay.animating {
    animation: megamenuFadeIn 0.3s ease forwards;
}

/* === Megamenu Products === */
.megamenu-products .row {
    margin: 0;
}

.megamenu-products .col-md-4 {
    padding: 0 1rem;
}

.megamenu-col-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.megamenu-subcategories > li {
    margin-bottom: 0.75rem;
}

.megamenu-subcategories > li > a {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
}

.megamenu-subcategories > li > a:hover {
    color: #007bff;
}

.megamenu-sub-subcategories {
    margin-top: 0.5rem;
    padding-left: 1rem;
}

.megamenu-sub-subcategories li {
    margin-bottom: 0.25rem;
}

.megamenu-sub-subcategories a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.megamenu-sub-subcategories a:hover {
    color: #007bff;
}

.megamenu-col-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.megamenu-col-promo {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.megamenu-promo-block h3,
.megamenu-promo-block h4 {
    margin-top: 0;
    color: #333;
}

/* === Megamenu Marques === */
.megamenu-marques .megamenu-title {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.megamenu-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.megamenu-brand-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid #eee;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.megamenu-brand-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.megamenu-brand-item img {
    max-width: 100%;
    max-height: 50px;
}

/* === Megamenu Promo === */
.megamenu-promo-banner {
    text-align: center;
}

.megamenu-promo-banner img,
.megamenu-promo-block img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.megamenu-promo-placeholder {
    padding: 2rem;
    background: #f8f9fa;
    text-align: center;
    color: #999;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

/* === Dropdown Classique (fallback) === */
.mmd-primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mmd-primary-menu .sub-menu.show {
    display: block;
}

.mmd-primary-menu .sub-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

.mmd-primary-menu .sub-menu li a:hover {
    background-color: #f5f5f5;
    color: #007bff;
}

/* === Images in menu === */
.mmd-primary-menu img {
    max-height: 30px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* === Responsive === */
@media (max-width: 991px) {
    .megamenu-overlay {
        width: 95vw;
        left: 2.5vw;
        transform: none;
    }

    .megamenu-container {
        padding: 20px;
    }

    .megamenu-col {
        margin-bottom: 20px;
    }

    .megamenu-highlight {
        border-left: none;
        border-top: 1px solid #ecf0f1;
        padding-top: 20px;
    }
}

@media (max-width: 767px) {
    .mmd-primary-menu {
        flex-direction: column;
    }

    .mmd-primary-menu > li {
        margin-right: 0;
        border-bottom: 1px solid #eee;
    }

    .megamenu-overlay {
        width: 100vw;
        left: 0;
        border-radius: 0;
        max-height: 80vh;
        overflow-y: auto;
    }

    .megamenu-container {
        padding: 15px;
    }

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

    .megamenu-products .col-md-4 {
        margin-bottom: 1rem;
    }
}
