/* =============================================
   KM Mega Menu Widget - Navigation Bar
   ============================================= */

.km-mega-menu {
    position: relative;
    width: 100%;
}

.km-mega-menu__bar {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.km-mega-menu__list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 54px;
    gap: 16px;
}

/* Push custom links to the right */
.km-mega-menu__item--link:first-of-type {
    margin-left: auto;
}

/* =============================================
   Menu Items
   ============================================= */

.km-mega-menu__item {
    position: static;
}

/* Active dropdown uses position: fixed via JS — ensure it renders above everything. */
.km-mega-menu__item--active .km-mega-menu__dropdown {
    position: fixed;
}

.km-mega-menu__item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none !important;
    color: #fff !important;
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.km-mega-menu__item-link:hover,
.km-mega-menu__item--active .km-mega-menu__item-link {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

/* Custom link items: lighter style */
.km-mega-menu__item--link .km-mega-menu__item-link {
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75) !important;
    padding: 10px 14px;
    letter-spacing: 0;
}

.km-mega-menu__item--link .km-mega-menu__item-link:hover {
    color: #fff !important;
    background-color: transparent;
}

/* =============================================
   Menu Item - Icon
   ============================================= */

.km-mega-menu__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.km-mega-menu__item-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.km-mega-menu__item-prefix {
    font-size: 14px;
}

/* =============================================
   Menu Item - Chevron
   ============================================= */

.km-mega-menu__chevron {
    width: 10px;
    height: 10px;
    opacity: 0.5;
    transition: transform 0.2s;
}

.km-mega-menu__item--active .km-mega-menu__chevron {
    transform: rotate(180deg);
}

/* =============================================
   Dropdown Panel
   ============================================= */

.km-mega-menu__dropdown {
    position: absolute;
    left: 0;
    right: auto;
    z-index: 9999;
    padding-top: 4px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.km-mega-menu__item--active .km-mega-menu__dropdown {
    opacity: 1;
    visibility: visible;
}

.km-mega-menu__dropdown-inner {
    display: flex;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    width: 1200px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 160px);
    overflow: hidden;
    pointer-events: auto;
    transform: translateY(6px);
    transition: transform 0.25s ease;
}

.km-mega-menu__item--active .km-mega-menu__dropdown-inner {
    transform: translateY(0);
}

/* =============================================
   Taxonomies (left side)
   ============================================= */

.km-mega-menu__taxonomies {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}

.km-mega-menu__dropdown-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Arca Majora 3', Lato, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #BE9E67;
}

.km-mega-menu__dropdown-title-icon {
    display: flex;
    align-items: center;
}

.km-mega-menu__dropdown-title-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* =============================================
   Taxonomy Columns
   ============================================= */

.km-mega-menu__columns {
    display: flex;
    gap: 40px;
}

.km-mega-menu__column {
    flex: 1;
    min-width: 0;
}

.km-mega-menu__column-title {
    font-family: Lato, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #BE9E67;
    margin: 0 0 14px 0;
}

.km-mega-menu__column-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.km-mega-menu__column-list li {
    margin-bottom: 4px;
}

.km-mega-menu__column-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Lato, sans-serif;
    font-size: 15px;
    color: #555 !important;
    text-decoration: none !important;
    padding: 3px 0;
    transition: color 0.15s, gap 0.2s;
}

.km-mega-menu__column-list a::after {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15' fill='none'%3E%3Cpath d='M12.2889 10.0395C12.2611 10.5591 12.6591 10.9783 13.178 10.9758C13.6969 10.9734 14.14 10.5503 14.1677 10.0307L12.2889 10.0395ZM14.6536 0.936513C14.6814 0.416857 14.2833 -0.00236025 13.7645 0.000149679C13.2456 0.00257363 12.8025 0.425703 12.7748 0.945267L14.6536 0.936513ZM13.7098 1.8803C14.2294 1.85261 14.6525 1.40951 14.655 0.890587C14.6575 0.371755 14.2382 -0.0262956 13.7186 0.00148523L13.7098 1.8803ZM4.62439 0.487437C4.10485 0.515153 3.68171 0.958236 3.67924 1.47711C3.67677 1.99599 4.09601 2.39406 4.61564 2.36625L4.62439 0.487437ZM14.3598 1.58651C14.7377 1.20859 14.7551 0.613148 14.3985 0.256594C14.042 -0.0999595 13.4465 -0.0826419 13.0686 0.295272L14.3598 1.58651ZM0.295061 13.0688C-0.0828621 13.4467 -0.10017 14.0422 0.256383 14.3987C0.612937 14.7553 1.20837 14.738 1.5863 14.36L0.295061 13.0688ZM14.1677 10.0307L14.6536 0.936513L12.7748 0.945267L12.2889 10.0395L14.1677 10.0307ZM13.7186 0.00148523L4.62439 0.487437L4.61564 2.36625L13.7098 1.8803L13.7186 0.00148523ZM13.0686 0.295272L0.295061 13.0688L1.5863 14.36L14.3598 1.58651L13.0686 0.295272Z' fill='%23BE9E67'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s, transform 0.2s;
}

.km-mega-menu__column-list a:hover {
    color: #BE9E67 !important;
}

.km-mega-menu__column-list a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* =============================================
   Color Swatch
   ============================================= */

.km-mega-menu__color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* =============================================
   See All Link
   ============================================= */

.km-mega-menu__see-all {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: #555 !important;
    transition: color 0.2s;
}

.km-mega-menu__see-all:hover {
    color: #BE9E67 !important;
}

/* Miniatures empilées */
.km-mega-menu__see-all-thumbs {
    display: flex;
    flex-shrink: 0;
}

.km-mega-menu__see-all-thumb {
    width: 32px !important;
    height: 32px !important;
    border-radius: 100% !important;
    object-fit: cover !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin-left: -10px !important;
}

.km-mega-menu__see-all-thumb:first-child {
    margin-left: 0;
}

/* Label */
.km-mega-menu__see-all-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Lato, sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.km-mega-menu__see-all-arrow {
    opacity: 1;
}

/* =============================================
   Popular Products (right side)
   ============================================= */

.km-mega-menu__popular {
    width: 340px;
    flex-shrink: 0;
    padding: 24px 20px;
    background-color: #fafafa;
    border-left: 1px solid #f0f0f0;
}

.km-mega-menu__popular-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Lato, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
}

.km-mega-menu__popular-title svg {
    color: #BE9E67;
}

.km-mega-menu__popular-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* =============================================
   Product Card
   ============================================= */

.km-mega-menu__product-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s, transform 0.2s;
}

.km-mega-menu__product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.km-mega-menu__product-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none !important;
}

.km-mega-menu__product-image {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.km-mega-menu__product-image img {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.km-mega-menu__product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.km-mega-menu__product-name {
    font-family: Lato, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.km-mega-menu__product-price {
    font-family: Lato, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #BE9E67;
}


/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1200px) {
    .km-mega-menu__bar {
        padding: 0 24px;
    }

    .km-mega-menu__item-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .km-mega-menu__popular {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .km-mega-menu__bar {
        padding: 0 16px;
        overflow-x: auto;
    }

    .km-mega-menu__list {
        min-width: max-content;
    }

    .km-mega-menu__dropdown {
        position: fixed;
        top: auto !important;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 80vh;
        overflow-y: auto;
        padding-top: 0;
        transition: opacity 0.2s ease, visibility 0.2s;
    }

    .km-mega-menu__dropdown-inner {
        flex-direction: column;
        border-radius: 4px 4px 0 0;
    }

    .km-mega-menu__popular {
        width: 100%;
        border-left: none;
        border-top: 1px solid #f0f0f0;
    }

    .km-mega-menu__popular-grid {
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 4px;
    }

    .km-mega-menu__product-card {
        min-width: 200px;
        flex-shrink: 0;
    }

    .km-mega-menu__columns {
        flex-direction: column;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .km-mega-menu__list {
        height: auto;
        padding: 8px 0;
        gap: 2px;
    }

    .km-mega-menu__item-link {
        font-size: 13px;
        padding: 8px 10px;
        gap: 6px;
    }

    .km-mega-menu__taxonomies {
        padding: 24px 20px;
    }

    .km-mega-menu__popular {
        padding: 24px 20px;
    }
}