/**
 * Category Mega Menu Styles
 * Dropdown showing products on category hover (desktop only)
 */

/* Wrapper for positioning - THIS is the hover zone */
.nav-cat-link-wrapper {
    position: relative;
    display: inline-block;
    height: 48px;
}

/* Mega menu dropdown container */
.category-megamenu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 600px;
    max-width: 800px;
    z-index: 9999;
    display: none;
    margin-top: 0;
    pointer-events: auto;
}

/* Products grid */
.megamenu-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

/* Individual product item */
.megamenu-product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    background: #f8f9fa;
}

.megamenu-product-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Product image */
.megamenu-product-image {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: 6px;
}

.megamenu-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Product name */
.megamenu-product-name {
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.3;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mega menu footer */
.megamenu-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    text-align: center;
}

.megamenu-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.megamenu-view-all:hover {
    background: rgba(231, 76, 60, 0.1);
}

.megamenu-view-all i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.megamenu-view-all:hover i {
    transform: translateX(3px);
}

/* Responsive - Hide on mobile/tablet */
@media (max-width: 1024px) {
    .category-megamenu-dropdown {
        display: none !important;
    }
}

/* Adjust for smaller desktop screens */
@media (max-width: 1200px) {
    .megamenu-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-megamenu-dropdown {
        min-width: 500px;
        max-width: 600px;
    }
}
