@media (min-width: 769px) {
    .header_top .desktop-nav-row nav > ul {
        position: relative;
    }

    .header_top .desktop-nav-row nav > ul > li {
        position: relative;
    }

    .header_top .desktop-nav-row nav > ul > li > a {
        position: relative;
        padding: 0.35rem 0;
    }

    .header_top .desktop-nav-row nav > ul > li > a::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -4px;
        height: 2px;
        background: #b81637;
        border-radius: 999px;
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform 0.2s ease;
    }

    .header_top .desktop-nav-row nav > ul > li:hover > a::before,
    .header_top .desktop-nav-row nav > ul > li:focus-within > a::before,
    .header_top .desktop-nav-row nav > ul > li.active > a::before {
        transform: scaleX(1);
    }

    .header_top .desktop-nav-row .dropdown-menu,
    .header_top .desktop-nav-row .desktop-occasion-menu {
        position: absolute;
        z-index: 1000;
        display: none;
        min-width: 260px;
        margin: 0;
        padding: 14px;
        list-style: none;
        background: #fff;
        border: 1px solid #eceff5;
        border-radius: 18px;
        box-shadow: 0 18px 40px rgba(24, 39, 75, 0.12);
        text-align: left;
    }

    .header_top .desktop-nav-row .dropdown-submenu > .dropdown-menu {
        display: none;
        top: -14px !important;
        left: calc(100% + 4px) !important;
        min-width: 240px;
        width: 480px !important;
        max-width: min(480px, calc(100vw - 100px));
        padding: 18px !important;
        transform: none !important;
    }

    .header_top .desktop-nav-row .dropdown-submenu:hover > .dropdown-menu,
    .header_top .desktop-nav-row .dropdown-submenu:focus-within > .dropdown-menu {
        display: block;
    }

    .header_top .desktop-nav-row .dropdown-menu li,
    .header_top .desktop-nav-row .desktop-occasion-menu li {
        position: relative;
    }

    .header_top .desktop-nav-row .dropdown-menu a,
    .header_top .desktop-nav-row .desktop-occasion-menu a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.8rem;
        padding: 0.7rem 0.9rem;
        border-radius: 12px;
        font-size: 14px;
        line-height: 20px;
        color: #2f3850;
        text-transform: none;
        text-decoration: none;
        transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .header_top .desktop-nav-row .dropdown-menu a:hover,
    .header_top .desktop-nav-row .dropdown-menu a:focus,
    .header_top .desktop-nav-row .desktop-occasion-menu a:hover,
    .header_top .desktop-nav-row .desktop-occasion-menu a:focus {
        background: #f5f7fc;
        color: #b81637;
        transform: translateX(2px);
    }

    .header_top .desktop-nav-row .dropdown-submenu > a.dropdown-toggle::after {
        content: "\f105";
        font-family: FontAwesome;
        font-size: 13px;
        color: #98a0b3;
        margin-left: auto;
    }

    .header_top .desktop-nav-row .desktop-simple-menu {
        top: calc(100% + 6px);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        min-width: 260px;
        padding: 10px;
        border: 1px solid #ebe6e6;
        border-radius: 20px;
        box-shadow: 0 18px 40px rgba(20, 18, 22, 0.12);
    }

    .header_top .desktop-nav-row .desktop-simple-menu li + li {
        margin-top: 4px;
    }

    .header_top .desktop-nav-row .desktop-simple-menu a {
        justify-content: flex-start;
        padding: 10px 14px;
        border-radius: 12px;
        line-height: 1.3;
    }

    .header_top .desktop-nav-row .shopbycategory {
        position: static;
    }

    .header_top .desktop-nav-row #desktop-nav-category {
        left: 0 !important;
        right: auto !important;
        top: calc(100% + 6px) !important;
        width: min(1080px, calc(100vw - 48px));
        min-width: 0;
        max-width: 100%;
        height: min(72vh, 640px);
        max-height: min(72vh, 640px);
        display: none;
        grid-template-columns: 270px minmax(0, 1fr);
        gap: 0;
        padding: 0;
        overflow: hidden;
        scrollbar-width: thin;
        border: 1px solid #ebe6e6;
        border-radius: 24px;
        box-shadow: 0 22px 54px rgba(20, 18, 22, 0.12);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
    }

    .header_top .desktop-nav-row .shopbycategory:hover > #desktop-nav-category,
    .header_top .desktop-nav-row .shopbycategory:focus-within > #desktop-nav-category {
        display: grid;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-rail {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-height: 0;
        padding: 18px 16px;
        background: #fffdfd;
        border-right: 1px solid #f1ecec;
        overflow-y: auto;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 14px 18px;
        border: 0;
        border-radius: 16px;
        background: transparent;
        color: #36415f;
        font-size: 15px;
        line-height: 1.3;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        transition: background-color 0.18s ease, color 0.18s ease;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger i {
        font-size: 18px;
        color: #a4acbc;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger:hover,
    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger:focus,
    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger.is-active {
        background: #f8f4f4;
        color: #b81637;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger:hover i,
    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger:focus i,
    .header_top .desktop-nav-row #desktop-nav-category .mega-category-trigger.is-active i {
        color: #b81637;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-content {
        position: relative;
        min-height: 0;
        height: 100%;
        padding: 22px 26px;
        background: linear-gradient(180deg, #fffefe 0%, #ffffff 100%);
        overflow: hidden;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-panel {
        display: none;
        height: 100%;
        min-height: 0;
        position: relative;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-panel.is-active {
        display: flex !important;
        flex-direction: column;
        gap: 18px;
        overflow-y: auto;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-panel-header h3 {
        margin: 0 0 6px;
        font-size: 22px;
        line-height: 1.2;
        font-weight: 700;
        color: #2f3850;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-panel-header p {
        margin: 0;
        font-size: 13px;
        line-height: 1.5;
        color: #7a7480;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-links {
        margin: 0;
        padding: 0;
        list-style: none;
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-links-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 24px;
        align-content: start;
        min-height: 0;
        position: static !important;
        inset: auto !important;
        overflow: visible !important;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-links li + li {
        margin-top: 4px;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-links-grid li + li {
        margin-top: 0;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-link {
        display: block;
        width: 100%;
        padding: 7px 8px;
        border-radius: 10px;
        font-size: 14px;
        line-height: 1.4;
        color: #2f3850;
        text-decoration: none;
        white-space: normal;
        transition: background-color 0.18s ease, color 0.18s ease;
        justify-content: flex-start !important;
        transform: none !important;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-link:hover,
    .header_top .desktop-nav-row #desktop-nav-category .mega-category-link:focus {
        background: #f8f4f4;
        color: #b81637;
    }

    .header_top .desktop-nav-row #desktop-nav-category .mega-category-empty {
        margin: 0;
        font-size: 14px;
        line-height: 1.5;
        color: #7a7480;
    }

    .header_top .desktop-nav-row #desktop-nav-category::-webkit-scrollbar {
        width: 10px;
    }

    .header_top .desktop-nav-row #desktop-nav-category::-webkit-scrollbar-thumb {
        background: #d9deea;
        border-radius: 999px;
        border: 2px solid #fff;
    }

    .header_top .desktop-nav-row #desktop-nav-category::-webkit-scrollbar-track {
        background: transparent;
    }

    @media (max-width: 1200px) {
        .header_top .desktop-nav-row #desktop-nav-category {
            width: min(960px, calc(100vw - 48px));
            grid-template-columns: 240px minmax(0, 1fr);
        }
    }

    @media (max-width: 960px) {
        .header_top .desktop-nav-row #desktop-nav-category {
            width: min(840px, calc(100vw - 32px));
            grid-template-columns: 220px minmax(0, 1fr);
        }

        .header_top .desktop-nav-row #desktop-nav-category .mega-category-links-grid {
            grid-template-columns: minmax(0, 1fr);
        }
    }

    .header_top .desktop-nav-row .desktop-occasion-menu {
        left: 50%;
        right: auto;
        top: calc(100% + 6px);
        transform: translateX(-50%);
        width: 720px;
        max-width: min(720px, calc(100vw - 64px));
        padding: 20px 22px;
    }

    .desktop-occasion-menu ul {
        list-style: none;
        margin: 0;
        padding-left: 0;
    }

    .desktop-occasion-menu > li,
    .desktop-occasion-menu .desktop-occasion-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 18px;
        width: 100%;
        margin: 0;
    }

    .desktop-occasion-menu > li > ul,
    .desktop-occasion-menu .desktop-occasion-column {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .desktop-occasion-menu > li > ul li,
    .desktop-occasion-menu .desktop-occasion-column li {
        display: block !important;
        margin: 0 0 6px !important;
    }

    .desktop-occasion-menu > li > ul li a,
    .desktop-occasion-menu .desktop-occasion-column li a {
        display: block;
        justify-content: flex-start;
        padding: 8px 10px;
        border-radius: 10px;
        line-height: 1.35;
    }
}

@media (max-width: 768px) {
    #occasion-dropdown {
        display: none;
    }

    #occasion-dropdown.open {
        display: block;
    }

    .shopbycategory .dropdown-menu {
        display: block !important;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: transparent;
    }

    .dropdown-menu {
        position: static;
        z-index: 1000;
        display: none;
        min-width: 20rem;
        padding: .5rem 0;
        margin: 0;
        font-size: 1rem;
        color: #212529;
        text-align: left;
        list-style: none;
        background-color: transparent;
        background-clip: padding-box;
        border: none;
        border-radius: .25rem;
    }

    #mobile-nav-category,
    .submenu {
        display: none;
    }

    #mobile-nav-category.open,
    .submenu.open {
        display: block;
    }

    .dropdown-submenu > a {
        cursor: pointer;
    }
}
