/* Mega Menu Styles */
.has-megamenu {
    position: static;
    /* Changed from relative */
}

.megamenu {
    position: fixed;
    /* Changed from absolute */
    top: var(--header-height, 80px);
    /* Adjust based on your header height */
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    margin-top: 10px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.megamenu.active {
    opacity: 1;
    visibility: visible;
}

.megamenu-inner {
    width: 100%;
}

/* Mega Menu Header */
.megamenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecebec;
}

.megamenu-header h3 {
    font-family: "Inter", sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 28px;
    letter-spacing: -1px;
    color: #000000;
    margin: 0;
}

.view-all-link {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.view-all-link:hover {
    color: #666;
    transform: translateX(5px);
}

/* Mega Menu Products Grid */
.megamenu-products {
    display: grid;
    gap: 20px;
}

/* Product Card in Mega Menu */
.megamenu-product-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.megamenu-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.product-image-link {
    display: block;
    width: 100%;
    /* aspect-ratio: 4/3;  Removed aspect ratio to allow fixed height */
    overflow: hidden;
    background: #ffffff;
}

.product-image {
    width: 100% !important;
    height: 250px !important;
    /* Force fixed height */
    object-fit: contain;
    /* Ensure image isn't cut off */
    transition: transform 0.3s ease;
}

.megamenu-product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-info h4 {
    font-family: "Inter";
    font-weight: 900;
    color: #000;
    font-style: italic;
    font-size: 18px;
    line-height: 1.3;
    margin: 0;
}

.product-info h4 a {
    color: #000000;
    text-decoration: none;
    padding: 0;
    transition: color 0.3s ease;
}

.product-info h4 a:hover {
    color: #666;
}

.product-info h5 {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #666;
    margin: 0;
}

.product-features {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 5px 0;
}

.product-features .feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 400;
    font-family: var(--font-body);
}

.product-features .check-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.product-discover-btn {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 20px 30px;
    font-size: 16px !important;
    font-family: var(--heading-font);
    font-weight: 400 !important;
    border-radius: 0px !important;
    text-decoration: none;
    color: #fff !important;
    text-align: center;
    line-height: 23px;
    width: 100%;
    max-width: max-content;
    transition: all 0.3s ease;
}

.product-discover-btn:hover {
    background: #333333;
    transform: scale(1.05);
}

/* Loading & Empty States */
.megamenu-loading,
.megamenu-empty,
.megamenu-error {
    text-align: center;
    padding: 40px 20px;
    font-family: "Inter", sans-serif;
    color: #666;
}

.megamenu-error {
    color: #dc3545;
}

/* Scrollbar styling for megamenu */
.megamenu::-webkit-scrollbar {
    width: 8px;
}

.megamenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.megamenu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.megamenu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hide megamenu on screens smaller than 992px */
@media (max-width: 991px) {

    .megamenu,
    .has-megamenu .megamenu {
        display: none !important;
    }
}