/**
 * Mega Menu Styles - Like Tokoo Theme
 * Complete mega menu system with category columns
 */

/* ==============================================
   MEGA MENU CONTAINER
   ============================================== */

/* Mega Menu Grid Layout */
.mega-menu-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100vw;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    background: white !important;
    padding: 30px 0 !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Mega Menu Container Inner */
.mega-menu-grid:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

/* Mega Menu Columns */
.mega-menu-column {
    flex: 1;
    min-width: 200px;
    padding: 0 20px;
    border-right: 1px solid #f3f4f6;
}

.mega-menu-column:last-child {
    border-right: none;
}

/* Column Widths */
.mega-col-3 { flex: 0 0 33.333%; max-width: 33.333%; }
.mega-col-4 { flex: 0 0 25%; max-width: 25%; }
.mega-col-5 { flex: 0 0 20%; max-width: 20%; }
.mega-col-6 { flex: 0 0 16.666%; max-width: 16.666%; }

/* ==============================================
   MEGA MENU PARENT ITEMS (Category Headers)
   ============================================== */

.mega-menu-parent > a {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #1a1a1a !important;
    padding-bottom: 12px !important;
    margin-bottom: 15px !important;
    display: inline-block !important;
    position: relative;
}

.mega-menu-parent > a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: #c49b63;
}

.mega-menu-parent > a:hover:after {
    width: 50px;
}

/* ==============================================
   SUBMENU ITEMS (Category Links)
   ============================================== */

.mega-menu-grid .sub-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    display: block !important;
}

.mega-menu-grid .sub-menu li {
    margin: 0 !important;
    padding: 0 !important;
}

.mega-menu-grid .sub-menu a {
    padding: 8px 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    display: block !important;
    transition: all 0.3s ease;
}

.mega-menu-grid .sub-menu a:hover {
    color: #c49b63 !important;
    padding-left: 10px !important;
}

/* ==============================================
   CATEGORY IMAGES IN MEGA MENU
   ============================================== */

.menu-category-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    vertical-align: middle;
}

.mega-menu-parent .menu-category-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* ==============================================
   PRODUCT COUNT BADGE
   ============================================== */

.product-count {
    display: inline-block;
    background: #f3f4f6;
    color: #666;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 8px;
}

/* ==============================================
   FEATURED PRODUCTS IN MEGA MENU
   ============================================== */

.mega-menu-featured {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.mega-menu-featured h4 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.mega-menu-featured-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.mega-menu-featured-product img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.mega-menu-featured-product .product-info {
    flex: 1;
}

.mega-menu-featured-product .product-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.mega-menu-featured-product .product-price {
    font-size: 12px;
    color: #c49b63;
}

/* ==============================================
   PROMOTIONAL BANNER IN MEGA MENU
   ============================================== */

.mega-menu-banner {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
}

.mega-menu-banner img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.mega-menu-banner:hover img {
    transform: scale(1.05);
}

/* ==============================================
   RESPONSIVE MEGA MENU
   ============================================== */

@media (max-width: 1024px) {
    .mega-menu-grid {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        flex-wrap: wrap;
    }
    
    .mega-col-3, .mega-col-4, .mega-col-5, .mega-col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .mega-menu-grid {
        flex-direction: column;
        padding: 15px !important;
    }
    
    .mega-col-3, .mega-col-4, .mega-col-5, .mega-col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .mega-menu-column {
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        padding: 15px 0;
    }
    
    .mega-menu-column:last-child {
        border-bottom: none;
    }
}

/* ==============================================
   ANIMATIONS
   ============================================== */

@keyframes megaMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-grid {
    animation: megaMenuFadeIn 0.3s ease;
}

/* ==============================================
   HOVER EFFECTS
   ============================================== */

.primary-menu > li.mega-menu-parent:hover > .mega-menu-grid {
    display: flex !important;
}

/* Arrow indicator for mega menu parent */
.mega-menu-parent > a:after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f107';
    margin-left: 5px;
    font-size: 12px;
}

/* ==============================================
   DARK MODE SUPPORT
   ============================================== */

@media (prefers-color-scheme: dark) {
    .mega-menu-grid {
        background: #1f2937 !important;
    }
    
    .mega-menu-grid .sub-menu a {
        color: #9ca3af !important;
    }
    
    .mega-menu-grid .sub-menu a:hover {
        color: #c49b63 !important;
    }
    
    .mega-menu-parent > a {
        color: #f9fafb !important;
    }
    
    .mega-menu-featured {
        background: #374151;
    }
}