/* ══════════════════════════════════════════════════════════════
   MEGA MENU STYLES - GlobeSwift Expo
   Dynamic product navigation with category tabs
   ══════════════════════════════════════════════════════════════ */

/* Apply Calibri font to mega menu DROPDOWN ONLY (not the button) */
.mega-dropdown,
.mega-dropdown * {
    font-family: 'Calibri', 'Arial', sans-serif !important;
}

/* Products navigation item with dropdown */
.modern-nav-links .nav-item-products {
    position: relative;
    display: inline-block;
}

.modern-nav-links .nav-trigger-products {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    color: #1a6b4a !important;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.modern-nav-links .nav-trigger-products:hover {
    color: #1a6b4a;
}

.modern-nav-links .nav-trigger-products svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item-products:hover .nav-trigger-products svg.chevron-icon {
    transform: rotate(180deg);
}

/* Mega dropdown container */
.mega-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: 95vw;
    background: #ffffff;
    border: 1px solid #dde8e2;
    border-radius: 0 16px 16px 16px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.nav-item-products:hover .mega-dropdown {
    display: flex;
    flex-direction: column;
    animation: megaDropdownSlide 0.3s ease;
}

@keyframes megaDropdownSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Category tabs strip */
.category-tabs-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    border-bottom: 1px solid #dde8e2;
    background: #f7faf8;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-right: 1px solid #dde8e2;
    position: relative;
}

.category-tab:last-child {
    border-right: none;
}

.category-tab:hover {
    background: #ffffff;
}

.category-tab.active {
    background: #e8f5f0;
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1a6b4a;
}

/* Category icon */
.category-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #e8f5f0;
    color: #1a6b4a;
    transition: all 0.3s ease;
}

.category-tab.active .category-icon {
    background: rgba(26, 107, 74, 0.2);
    transform: scale(1.05);
}

.category-icon svg,
.category-icon i {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.category-icon i {
    font-size: 22px;
}

/* Category info */
.category-info {}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: #111a14;
    line-height: 1.3;
}

.category-count {
    font-size: 11px;
    color: #6b7a70;
    margin-top: 3px;
}

/* Products panel */
.products-panel {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 20px 24px 24px;
    background: #ffffff;
}

.products-panel.visible {
    display: grid;
}

/* Product column */
.product-column {
    padding: 0 16px;
    border-right: 1px solid #dde8e2;
}

.product-column:first-child {
    padding-left: 0;
}

.product-column:last-child {
    border-right: none;
    padding-right: 0;
}

/* Subcategory heading */
.subcategory-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a6b4a;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dde8e2;
}

.subcategory-heading svg,
.subcategory-heading i {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.subcategory-heading i {
    font-size: 15px;
}

/* Product item */
.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7a70;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-bottom: 2px;
}

.product-item:hover {
    background: #f7faf8;
    color: #111a14;
    transform: translateX(3px);
}

.product-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.product-item-left svg,
.product-item-left i {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    color: #1a6b4a;
}

.product-item-left i {
    font-size: 15px;
}

.product-item-name {
    line-height: 1.3;
}

.product-item-meta {
    font-size: 10px;
    color: #c8932a;
    white-space: nowrap;
    background: #fdf3dc;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Featured product */
.product-item.featured {
    border-left: 3px solid #c8932a;
    background: #fdf3dc;
}

.product-item.featured:hover {
    background: #fce9c4;
}

/* Dropdown footer */
.mega-dropdown-footer {
    border-top: 1px solid #dde8e2;
    padding: 12px 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    background: #f7faf8;
}

.dropdown-footer-link {
    font-size: 12px;
    color: #6b7a70;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.dropdown-footer-link:hover {
    color: #1a6b4a;
}

.dropdown-footer-link svg,
.dropdown-footer-link i {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.dropdown-footer-link i {
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 991px) {
    /* Hide mega menu on mobile, use regular link */
    .nav-item-products .mega-dropdown {
        display: none !important;
    }

    .nav-trigger-products {
        pointer-events: auto;
    }

    /* Make it a regular link on mobile */
    .nav-trigger-products svg {
        display: none;
    }
}

@media (max-width: 768px) {
    .mega-dropdown {
        width: 100vw;
        left: 0;
        transform: translateX(0);
        border-radius: 0;
    }

    .category-tabs-strip {
        grid-template-columns: 1fr;
    }

    .category-tab {
        border-right: none;
        border-bottom: 1px solid #dde8e2;
    }

    .category-tab:last-child {
        border-bottom: none;
    }

    .products-panel {
        grid-template-columns: 1fr;
        padding: 16px 20px;
    }

    .product-column {
        border-right: none;
        border-bottom: 1px solid #dde8e2;
        padding: 12px 0;
    }

    .product-column:last-child {
        border-bottom: none;
    }

    .mega-dropdown-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Loading state */
.mega-menu-loading {
    padding: 40px;
    text-align: center;
    color: #6b7a70;
}

/* Empty state */
.mega-menu-empty {
    padding: 40px;
    text-align: center;
    color: #6b7a70;
}

.mega-menu-empty svg,
.mega-menu-empty i {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* Smooth transitions */
.category-tab,
.product-item,
.dropdown-footer-link {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility */
.mega-dropdown:focus-within {
    outline: 2px solid #1a6b4a;
    outline-offset: 2px;
}

.product-item:focus,
.category-tab:focus,
.dropdown-footer-link:focus {
    outline: 2px solid #1a6b4a;
    outline-offset: -2px;
}

/* Print styles */
@media print {
    .mega-dropdown {
        display: none !important;
    }
}
