/* ============================================================================
   AKMART - MEGA MENU (Myntra-Style Layout with AKMART Theme)
   Clean, Multi-Column Category Navigation - Full Width
   ============================================================================ */

/* Mega Menu Container - FULL WIDTH Layout */
.menu-category.mega-menu {
    position: relative;
}

.menu-category.mega-menu>.dropdown-panel {
    position: absolute;
    top: 100%;
    /* Position directly below the menu item */
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 1200px;
    padding: 30px 40px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    border-top: 3px solid var(--salmon-pink, #ff6b6b);

    /* Multi-column grid - auto-fit based on categories */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 200px));
    justify-content: center;
    gap: 25px 50px;

    /* Visibility */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 9999;
}

/* Ensure menu item stays fully visible on hover */
.menu-category.mega-menu>.menu-title-link,
.menu-category.mega-menu>.menu-title {
    position: relative;
    z-index: 10000;
    /* Above dropdown */
}

/* Dynamic width based on category count */
.menu-category.mega-menu>.dropdown-panel[data-category-count="1"] {
    grid-template-columns: minmax(200px, 280px);
    width: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 25px 40px;
}

.menu-category.mega-menu>.dropdown-panel[data-category-count="2"] {
    grid-template-columns: repeat(2, minmax(180px, 220px));
    width: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 25px 50px;
}

.menu-category.mega-menu>.dropdown-panel[data-category-count="3"] {
    grid-template-columns: repeat(3, minmax(170px, 200px));
    width: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 25px 50px;
}

/* 4+ categories - use full width */
.menu-category.mega-menu>.dropdown-panel[data-category-count="4"],
.menu-category.mega-menu>.dropdown-panel[data-category-count="5"],
.menu-category.mega-menu>.dropdown-panel[data-category-count="6"] {
    width: 100vw;
    left: 0;
    right: 0;
    transform: none;
}

/* Show on hover */
.menu-category.mega-menu:hover>.dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Category Column */
.dropdown-panel .dropdown-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-width: 140px;
    max-width: 200px;
}

/* Remove hover effects from old styling */
.dropdown-panel .dropdown-panel-list:hover {
    box-shadow: none;
    transform: none;
    border-color: transparent;
}

/* Category Title - Using Site Theme Colors */
.dropdown-panel-list>.menu-title,
.dropdown-panel-list li.menu-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--salmon-pink, #ff6b6b) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 0 10px 0 !important;
    margin-bottom: 12px !important;
    border-bottom: none !important;
    display: block;
    position: relative;
}

.dropdown-panel-list>.menu-title a,
.dropdown-panel-list li.menu-title a {
    color: var(--salmon-pink, #ff6b6b) !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.dropdown-panel-list>.menu-title a:hover,
.dropdown-panel-list li.menu-title a:hover {
    color: var(--eerie-black, #333) !important;
    text-decoration: underline;
}

/* Remove old arrow styling */
.dropdown-panel-list .menu-title::after {
    display: none !important;
}

/* Subcategory Links - Clean Gray Text */
.dropdown-panel-list .panel-list-item {
    margin: 0;
    padding: 0;
}

.dropdown-panel-list .panel-list-item a {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 400;
    color: #282c3f;
    text-decoration: none;
    background: transparent !important;
    border-radius: 0;
    transition: color 0.15s ease;
    line-height: 1.5;
}

/* Remove old underline animation */
.dropdown-panel-list .panel-list-item a::before {
    display: none !important;
}

.dropdown-panel-list .panel-list-item a:hover {
    color: var(--salmon-pink, #ff6b6b);
    background: transparent !important;
    padding-left: 0 !important;
    font-weight: 500;
}

/* Description styling */
.dropdown-panel-list .panel-description {
    font-size: 12px;
    color: #94969f;
    margin-bottom: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-left: none;
}

/* Collapsible Groups - Myntra style */
.dropdown-panel-list .collapsible-group {
    margin-bottom: 0;
}

.dropdown-panel-list .group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #282c3f;
    text-align: left;
    transition: color 0.15s;
}

.dropdown-panel-list .group-toggle:hover {
    color: var(--salmon-pink, #ff6b6b);
}

.dropdown-panel-list .group-toggle .toggle-icon {
    font-size: 14px;
    color: #94969f;
    transition: transform 0.2s ease;
}

.dropdown-panel-list .group-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.dropdown-panel-list .sub-group-list {
    list-style: none;
    padding: 0 0 0 12px;
    margin: 0;
    border-left: 2px solid #eaeaec;
}

.dropdown-panel-list .sub-group-list li {
    padding: 5px 0;
}

.dropdown-panel-list .sub-group-list li a {
    font-size: 13px;
    color: #535766;
    padding: 0;
}

.dropdown-panel-list .sub-group-list li a:hover {
    color: var(--salmon-pink, #ff6b6b);
}

/* Remove special category colors - use consistent theme */
.dropdown-panel-list[data-category="gadgets"]>.menu-title a,
.dropdown-panel-list[data-category="kids"]>.menu-title a {
    color: var(--salmon-pink, #ff6b6b) !important;
}

/* Hierarchical Categories Layout */
.dropdown-panel-list.hierarchical-list {
    min-width: 180px;
}

/* Empty Panel Styling */
.dropdown-panel.empty {
    min-width: 350px;
    grid-template-columns: 1fr;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .menu-category.mega-menu>.dropdown-panel {
        left: 0;
        transform: none;
        max-width: 95vw;
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .menu-category.mega-menu>.dropdown-panel {
        display: none !important;
    }
}

/* Override header-enhanced.css styles */
.menu-category.mega-menu>.dropdown-panel .dropdown-panel-list {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* ============================================================================
   IMAGE QUALITY ENHANCEMENTS
   Better rendering for product images
   ============================================================================ */

/* High Quality Image Rendering for all product images */
.product-image,
.product-image-wrapper img,
.category-showcase__card img,
.hero-tile__image,
.collection-grid img,
img[loading="lazy"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

/* Ensure crisp images on high-DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .product-image,
    .product-image-wrapper img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Product detail page larger image quality */
.product-main-image,
.product-thumbnail,
.lightbox-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;
}