/* Fastkart-style All Categories mega menu */

header .header-nav .header-nav-left {
    position: relative;
}

header .header-nav .header-nav-left .dropdown-category {
    min-width: 200px;
    border-radius: 5px;
    gap: 8px;
    font-weight: 600;
}

/* Left category rail */
header .header-nav .header-nav-left .category-dropdown {
    top: calc(100% + 1px) !important;
    left: 0 !important;
    width: 300px !important;
    min-width: 300px;
    padding: 12px 0;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 0 8px rgba(34, 34, 34, 0.1);
    overflow: visible;
    border: none;
}

header .header-nav .header-nav-left:hover .category-dropdown,
header .header-nav .header-nav-left .category-dropdown:hover {
    top: calc(100% + 1px) !important;
}

header .header-nav .header-nav-left .category-dropdown .category-list {
    padding: 0;
    margin: 0;
    display: block;
}

header .header-nav .header-nav-left .category-dropdown .category-list > li {
    position: relative;
    width: 100%;
    display: block;
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 22px;
    border-radius: 0;
    background: transparent !important;
    transition: none;
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name .category-name-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name .category-rail-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    flex-shrink: 0;
    filter: grayscale(1) contrast(1.05);
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name .category-rail-icon--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
    font-size: 14px;
    filter: none;
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name h6 {
    position: relative;
    display: inline-block;
    font-size: 15px;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
    transition: color 0.25s ease;
}

/* Teal underline like Fastkart reference */
header .header-nav .header-nav-left .category-dropdown .category-list li .category-name h6::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--theme-secondary, #144772);
    opacity: 1;
    transition: width 0.25s ease;
}

header .header-nav .header-nav-left .category-dropdown .category-list li .category-name > i {
    font-size: 12px;
    color: #222;
    margin-left: 0 !important;
    flex-shrink: 0;
}

header .header-nav .header-nav-left .category-dropdown .category-list li:hover > .category-name,
header .header-nav .header-nav-left .category-dropdown .category-list li.onhover-category-list:hover > .category-name {
    background: transparent !important;
}

header .header-nav .header-nav-left .category-dropdown .category-list li:hover > .category-name h6,
header .header-nav .header-nav-left .category-dropdown .category-list li.onhover-category-list:hover > .category-name h6 {
    color: #222;
    letter-spacing: normal;
}

header .header-nav .header-nav-left .category-dropdown .category-list li:hover > .category-name h6::before,
header .header-nav .header-nav-left .category-dropdown .category-list li.onhover-category-list:hover > .category-name h6::before {
    width: 100%;
}

header .header-nav .header-nav-left .category-dropdown .category-list li:hover > .category-name > i {
    color: var(--theme-secondary, #144772);
}

/* Right flyout panel — flush to rail, content-sized */
header .onhover-category-list .onhover-category-box.mega-menu-panel,
header .onhover-category-list .onhover-category-box {
    top: 0 !important;
    left: 100% !important;
    width: max-content !important;
    min-width: 480px;
    max-width: min(720px, 72vw);
    height: auto !important;
    min-height: 0 !important;
    max-height: min(460px, 72vh);
    margin: 0 !important;
    padding: 0;
    border-radius: 5px;
    border: none;
    box-shadow: 0 0 8px rgba(34, 34, 34, 0.1);
    background: #fff;
    overflow: auto;
    display: block !important;
    opacity: 0;
    visibility: hidden;
}

header .onhover-category-list:hover .onhover-category-box.mega-menu-panel,
header .onhover-category-list:hover .onhover-category-box {
    opacity: 1;
    visibility: visible;
    margin-left: 0 !important;
}

header .onhover-category-list .mega-menu-panel-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px 36px;
    padding: 22px 28px;
    align-content: start;
    width: max(480px, 100%);
    box-sizing: border-box;
}

header .onhover-category-list .onhover-category-box .mega-menu-column,
header .onhover-category-list .onhover-category-box .list-1 {
    margin: 0;
    min-width: 0;
}

header .onhover-category-list .onhover-category-box .category-title-box {
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: 0;
}

header .onhover-category-list .onhover-category-box .category-title-box h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

header .onhover-category-list .onhover-category-box .category-title-box h5 a {
    color: #222;
    text-decoration: none;
}

header .onhover-category-list .onhover-category-box .category-title-box h5 a:hover {
    color: var(--theme-secondary, #144772);
}

/* Sub links with grey dots like reference */
header .onhover-category-list .onhover-category-box ul,
header .onhover-category-list .onhover-category-box .mega-menu-links {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

header .onhover-category-list .onhover-category-box ul li,
header .onhover-category-list .onhover-category-box .mega-menu-links li {
    position: relative;
    list-style: none;
    padding-left: 14px;
}

header .onhover-category-list .onhover-category-box ul li::after,
header .onhover-category-list .onhover-category-box .mega-menu-links li::after {
    content: "" !important;
    display: block !important;
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    margin: 0;
    border-radius: 100%;
    background-color: #4a5568;
    opacity: 0.55;
    transform: translateY(-50%);
}

header .onhover-category-list .onhover-category-box ul li a,
header .onhover-category-list .onhover-category-box .mega-menu-links li a {
    margin: 0 !important;
    display: block;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    color: #4a5568;
    text-decoration: none;
    padding: 2px 0;
    border-radius: 0;
    background: transparent;
    transition: color 0.2s ease;
}

header .onhover-category-list .onhover-category-box ul li a:hover,
header .onhover-category-list .onhover-category-box .mega-menu-links li a:hover {
    color: var(--theme-secondary, #144772);
    background: transparent;
}

header .onhover-category-list .onhover-category-box .mega-menu-links .mega-menu-links {
    margin-top: 2px;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

@media (max-width: 1199px) {
    header .onhover-category-list .onhover-category-box.mega-menu-panel,
    header .onhover-category-list .onhover-category-box {
        min-width: 420px;
    }

    header .onhover-category-list .mega-menu-panel-inner {
        width: max(420px, 100%);
    }
}

@media (max-width: 991px) {
    header .onhover-category-list .onhover-category-box.mega-menu-panel,
    header .onhover-category-list .onhover-category-box {
        left: 0 !important;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        position: relative !important;
        box-shadow: none;
        max-height: none;
        margin-top: 0 !important;
    }

    header .onhover-category-list .mega-menu-panel-inner {
        grid-template-columns: 1fr;
        padding: 8px 22px 14px;
        gap: 14px;
    }
}

@media (max-width: 767px) {
    header .header-nav .header-nav-left .category-dropdown {
        border-radius: 0;
        box-shadow: none;
        width: calc(300px + 20 * (100vw - 320px) / 1600) !important;
    }

    header .header-nav .header-nav-left .category-dropdown .category-list li .category-name .category-rail-icon {
        filter: none;
    }
}
