/* Allo.ua Mega Menu Stylesheet - Flyout Overlay Mode (Option 2) */
body.overflow-hidden,
html.overflow-hidden {
    overflow: auto !important;
    overflow-y: auto !important;
}

/* Desktop Layout Styles (min-width: 992px) */
@media (min-width: 992px) {
    .allo-megamenu-wrapper {
        overflow: visible !important;
        z-index: 2147483647 !important;
        position: fixed !important;
        display: block !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        width: 320px !important;
        max-width: 320px !important;
        box-sizing: border-box !important;
    }

    .allo-megamenu-wrapper.has-dropdown-active,
    .allo-megamenu-wrapper.has-dropdown-active:hover {
        border-radius: 16px 0 0 16px !important;
    }

    body[data-page="home"] .allo-megamenu-wrapper {
        position: absolute !important;
        z-index: 9999 !important;
    }

    body[data-page="home"] .allo-megamenu-wrapper.has-dropdown-active,
    body[data-page="home"] .allo-megamenu-wrapper:hover {
        z-index: 2147483647 !important;
    }

    /* Fixed overlay anchored to catalog button (inner pages & scrolled Home page) */
    body:not([data-page="home"]) .allo-megamenu-wrapper,
    .allo-megamenu-wrapper.is-fixed-overlay {
        position: fixed !important;
        z-index: 2147483647 !important;
        display: none !important;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 16px !important;
        right: auto !important;
    }

    body:not([data-page="home"]) .allo-megamenu-wrapper.has-dropdown-active,
    .allo-megamenu-wrapper.is-fixed-overlay.has-dropdown-active {
        border-radius: 16px 0 0 16px !important;
    }

    body:not([data-page="home"]) .allo-megamenu-wrapper.is-open,
    body:not([data-page="home"]) .allo-megamenu-wrapper:hover,
    .allo-megamenu-wrapper.is-fixed-overlay.is-open,
    .allo-megamenu-wrapper.is-fixed-overlay:hover {
        display: block !important;
    }

    /* Height of main categories sidebar is dynamically calculated by JavaScript */
    .allo-sidebar-items,
    .pr-menu-catalog-items {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scroll-behavior: smooth;
    }

    .allo-sidebar-items::-webkit-scrollbar,
    .pr-menu-catalog-items::-webkit-scrollbar {
        width: 5px;
    }

    .allo-sidebar-items::-webkit-scrollbar-track,
    .pr-menu-catalog-items::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .allo-sidebar-items::-webkit-scrollbar-thumb,
    .pr-menu-catalog-items::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .allo-sidebar-items::-webkit-scrollbar-thumb:hover,
    .pr-menu-catalog-items::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

    /* Desktop Menu Backdrop Dimming Overlay */
    .allo-menu-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(0, 0, 0, 0.45) !important;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 9990 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.25s ease, visibility 0.25s ease !important;
    }

    .allo-menu-backdrop.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Highlight pulse effect for Home Page menu when Catalog button is clicked */
@keyframes alloMenuHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
        transform: scale(1.015);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(249, 115, 22, 0);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.allo-megamenu-wrapper.highlight-pulse {
    animation: alloMenuHighlight 1s ease-in-out 2;
    border: 2px solid #f97316 !important;
    transition: border 0.3s ease;
}

.allo-megamenu-inner,
.pr-menu-catalog-inner {
    position: relative !important;
    overflow: visible !important;
    overflow-y: visible !important;
    width: 100% !important;
    overscroll-behavior-y: contain !important;
}

.allo-sidebar-items,
.pr-menu-catalog-items {
    width: 100% !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
}

.allo-megamenu-wrapper.has-dropdown-active .allo-sidebar-items,
.allo-megamenu-wrapper.has-dropdown-active .pr-menu-catalog-items {
    border-radius: 16px 0 0 16px !important;
}

.allo-sidebar-item {
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 12px 12px !important;
}

.pr-menu-catalog-item-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

.pr-menu-catalog-item-title a {
    font-size: 15px !important;
    line-height: 1.25 !important;
}

.pr-menu-catalog-item-img {
    flex-shrink: 0;
}

.pr-menu-catalog-item-img img,
.pr-menu-catalog-item-img svg {
    max-width: 20px !important;
    max-height: 20px !important;
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
}

.allo-sidebar-item:first-child,
.allo-sidebar-item:first-child.active,
.allo-sidebar-item:first-child:hover,
.allo-sidebar-item:first-child:focus {
    border-top-left-radius: 16px !important;
}

.allo-sidebar-item:last-child,
.allo-sidebar-item:last-child.active,
.allo-sidebar-item:last-child:hover,
.allo-sidebar-item:last-child:focus {
    border-bottom-left-radius: 16px !important;
}

.allo-megamenu-wrapper:not(.has-dropdown-active) .allo-sidebar-item:first-child,
.allo-megamenu-wrapper:not(.has-dropdown-active) .allo-sidebar-item:first-child:hover {
    border-top-right-radius: 16px !important;
}

.allo-megamenu-wrapper:not(.has-dropdown-active) .allo-sidebar-item:last-child,
.allo-megamenu-wrapper:not(.has-dropdown-active) .allo-sidebar-item:last-child:hover {
    border-bottom-right-radius: 16px !important;
}

.allo-megamenu-wrapper.has-dropdown-active .allo-sidebar-item:first-child,
.allo-megamenu-wrapper.has-dropdown-active .allo-sidebar-item:first-child:hover {
    border-top-right-radius: 0 !important;
}

.allo-megamenu-wrapper.has-dropdown-active .allo-sidebar-item:last-child,
.allo-megamenu-wrapper.has-dropdown-active .allo-sidebar-item:last-child:hover {
    border-bottom-right-radius: 0 !important;
}

.allo-sidebar-item.active,
.allo-sidebar-item:hover {
    background-color: #f8f9fa;
}

.pr-menu-catalog-inner a:hover {
    text-decoration: none;
}

.allo-sidebar-item.active .pr-menu-catalog-item-title a,
.allo-sidebar-item:hover .pr-menu-catalog-item-title a {
    color: #f97316;
    font-weight: 600;
}

/* Right Content Area - Dropdown Flyout Overlay attached directly to right edge of wrapper (0px gap) */
.allo-dropdown-content {
    position: absolute !important;
    top: 0 !important;
    left: 100% !important;
    margin-left: 0 !important;
    width: 900px;
    max-width: none;
    height: 100% !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    padding: 20px !important;
    background: #f4f6f8 !important;
    border-radius: 0 16px 16px 0 !important;
    box-shadow: 14px 10px 35px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #e2e8f0 !important;
    border-left: none !important;
    z-index: 2147483647 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for mega menu internal scroll */
.allo-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.allo-dropdown-content::-webkit-scrollbar-track {
    background: #eef2f5;
    border-radius: 4px;
}

.allo-dropdown-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.allo-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Shown when sidebar item is hovered or has-active class is present */
.allo-dropdown-content.has-active,
.allo-megamenu-wrapper:hover .allo-dropdown-content.has-active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
}

.allo-dropdown-pane {
    display: none !important;
    height: auto;
}

.allo-dropdown-pane.active {
    display: block !important;
}

/* Allo Card Blocks */
.allo-card-block {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
    height: max-content !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.allo-card-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* Block Titles */
.allo-block-title {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: color 0.2s ease;
}

.allo-block-title.allo-has-sub,
.allo-block-title:has(+ .allo-category-chips),
.allo-block-title:has(+ .allo-links-list) {
    margin-bottom: 12px;
}

.allo-block-title:hover {
    color: #f97316;
}

.allo-block-title-arrow {
    font-size: 13px;
    color: #adb5bd;
}

/* Category Chips / Pills */
.allo-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.allo-chip {
    background: #f0f3f6;
    color: #2b3036;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.allo-chip:hover {
    background: #e2e7ec;
    color: #000000;
    text-decoration: none;
}

/* Text Links List */
.allo-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.allo-link-item {
    background: #f0f3f6;
    color: #2b3036;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.allo-link-item:hover {
    background: #e2e7ec;
    color: #000000;
    text-decoration: none;
}

/* Badges */
.allo-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    display: inline-block;
    line-height: 1.1;
}

.allo-badge-new {
    background: #ffe3e3;
    color: #e03131;
}

.allo-badge-sale {
    background: #fff3bf;
    color: #f59f00;
}

.allo-badge-ref {
    background: #e7f5ff;
    color: #1971c2;
}

/* Banner Image Block */
.allo-banner-card {
    text-decoration: none;
    display: block;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-top: 12px;
    margin-bottom: 24px;
    transition: transform 0.2s ease;
}

.allo-banner-card:hover {
    transform: translateY(-2px);
}

.allo-banner-img {
    width: 100%;
    height: 100%;
    /* max-width: 260px; */
    max-height: 260px;
    display: block;
    object-fit: cover;
    border-radius: 12px;
}

.allo-banner-text {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

/* All Link (Всі товари ->) */
.allo-all-link {
    color: #f97316 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    transition: color 0.15s ease;
}

.allo-all-link:hover {
    color: #ea580c !important;
    text-decoration: underline;
}

/* Multi-Section Flex Columns Layout for Desktop (supports 1..5 sections) */
@media (min-width: 992px) {
    .allo-sections-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .allo-section-col {
        flex: 1 1 0 !important;
        width: calc((100% - 48px) / 5) !important;
        /* max-width: calc((100% - 48px) / 5) !important; */
        min-width: 120px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .allo-section-col:only-child {
        flex: 0 0 300px !important;
        max-width: 300px !important;
        width: 300px !important;
    }
}

/* Mobile Responsive Body Lock & Theme Overlay Suppress */
body.allo-menu-open {
    overflow: hidden !important;
}

body.allo-menu-open #overlay,
body.allo-menu-open .pr-mobile-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Responsive Mobile Catalog Drawer (Allo.ua Style) */
@media (max-width: 991.98px) {
    .allo-megamenu-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #ffffff !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15) !important;
        z-index: 2147483647 !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    body[data-page="home"] .allo-megamenu-wrapper,
    body:not([data-page="home"]) .allo-megamenu-wrapper,
    .allo-megamenu-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #ffffff !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15) !important;
        z-index: 2147483647 !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .allo-megamenu-wrapper.is-open,
    body[data-page="home"] .allo-megamenu-wrapper.is-open,
    body:not([data-page="home"]) .allo-megamenu-wrapper.is-open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: translateX(0) !important;
        display: flex !important;
        z-index: 2147483647 !important;
    }

    /* Mobile Header */
    .allo-megamenu-wrapper .pr-menu-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 16px !important;
        height: 60px !important;
        flex: 0 0 60px !important;
        background: #ffffff !important;
        border-bottom: 1px solid #e9ecef !important;
        z-index: 20;
    }

    .allo-megamenu-wrapper .pr-menu-header-back {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .allo-megamenu-wrapper span.icon-menu-close i {
        color: #f97315;
    }

    .allo-megamenu-wrapper .pr-sidebar-catalog-close {
        width: 32px;
        height: 32px;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        border: none !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #1e293b !important;
        cursor: pointer;
        padding: 0 !important;
        font-size: 16px;
        transition: background-color 0.2s ease;
    }

    .allo-megamenu-wrapper .pr-sidebar-catalog-back {
        height: 34px !important;
        padding: 0 12px !important;
        border-radius: 20px !important;
        background: #fff7ed !important;
        border: 1px solid #ffedd5 !important;
        color: #ea580c !important;
        font-weight: 700 !important;
        font-size: 13px !important;
        cursor: pointer;
        display: none;
        align-items: center !important;
        gap: 4px !important;
        transition: background-color 0.2s ease;
    }

    .allo-megamenu-wrapper .pr-sidebar-catalog-back:active,
    .allo-megamenu-wrapper .pr-sidebar-catalog-close:active {
        background: #e2e8f0 !important;
    }

    .allo-mobile-back-to-main-btn {
        background: #ffffff !important;
        color: #1e293b !important;
        border: 1px solid #cbd5e1 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 10px !important;
        padding: 10px 14px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        text-align: left;
    }

    .allo-mobile-back-to-main-btn i {
        color: #f97316 !important;
        font-size: 14px;
    }

    .allo-mobile-back-to-main-btn:active {
        background: #f8fafc !important;
    }

    .allo-mobile-header-title {
        font-size: 17px;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 220px;
    }

    /* Mobile Body Scroll Area */
    .allo-megamenu-mobile-body {
        position: relative !important;
        flex: 1 1 auto !important;
        width: 100% !important;
        height: calc(100vh - 60px) !important;
        height: calc(100dvh - 60px) !important;
        overflow: hidden !important;
        background: #ffffff;
    }

    .allo-megamenu-inner {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .allo-sidebar-items {
        width: 100% !important;
        background: #ffffff;
    }

    .allo-sidebar-item {
        padding: 9px 14px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        cursor: pointer;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .allo-sidebar-item:active {
        background-color: #f8fafc !important;
    }

    .pr-menu-catalog-item-title {
        font-size: 13.5px !important;
        font-weight: 500 !important;
        color: #1e293b;
    }

    .pr-menu-catalog-item-title a {
        color: #1e293b !important;
        text-decoration: none !important;
        font-weight: 500 !important;
    }

    .pr-menu-catalog-item-arrow {
        color: #94a3b8 !important;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
    }

    /* Level 2 Subcategory Content Container */
    .allo-dropdown-content {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 30px 14px 80px 14px !important;
        background: #f8fafc !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
        z-index: 10 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    .allo-dropdown-content.mobile-level2-active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateX(0) !important;
        display: block !important;
    }

    /* All Products in Main Category Link Button */
    .allo-mobile-all-cat-btn {
        background: #f97316 !important;
        color: #ffffff !important;
        border: none !important;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none !important;
        border-radius: 12px;
        box-shadow: 0 3px 10px rgba(249, 115, 22, 0.25);
        transition: background 0.15s ease;
    }

    .allo-mobile-all-cat-btn:active {
        background: #ea580c !important;
        color: #ffffff !important;
    }

    .allo-sections-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .allo-section-col {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .allo-card-block {
        border-radius: 12px !important;
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }

    .allo-block-title {
        font-size: 14px !important;
    }

    .allo-chip,
    .allo-link-item {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }

    .allo-banner-card {
        margin-top: 4px !important;
        margin-bottom: 8px !important;
        max-width: 100% !important;
        aspect-ratio: auto !important;
        height: auto !important;
    }

    .allo-banner-img {
        width: 100% !important;
        height: auto !important;
        max-height: 140px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
    }
}