/* =======================================================
   AC PRODUCT MEGAMENU - DROPDOWN DIZAJN 
======================================================= */

/* --- Clear --- */

.widget_block { 
    margin-bottom: 0 !important;
}

.td-shop-sidebar section.widget.widget_block,
.sidebar-widget-area .widget,
#block-4.widget_block {
    padding: 0 !important;
    border: none !important;
}

#sidebarToggle {
    display: none !important;
}

/* SKRYTIE STARÉHO TLAČIDLA ZO ŠABLÓNY */
.widget_product_categories h5,
.widget_product_categories .widget-title,
.widget_product_categories ul.product-categories {
    display: none !important;
}

.widget p:empty,
.widget_block p:empty,
.ac-cat-wrapper p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* --- GLOBÁLNE PÍSMO PRE MEGAMENU --- */
.ac-cat-wrapper,
.ac-cat-mobile-btn,
.ac-mobile-fs-menu {
    font-family: 'Gilroy', sans-serif !important;
}

/* --- DESKTOP VS PHONE SKRÝVANIE --- */
.ac-mobile-cat-button-wrapper {
    display: none;
}
.ac-desktop-only {
    display: block;
}

/* --- SPOLOČNÉ A OVERLAY (Stmavenie pozadia na desktope) --- */
.ac-cat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9990;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ac-cat-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* --- DESKTOP: HLAVNÝ OBAL A NADPIS --- */
.ac-cat-wrapper {
    position: relative;
    width: 100%;
    background: none;
    z-index: 9991;
    margin: 0 !important;
}

.ac-cat-header {
    background: #0d69ba;
    width: 100% !important;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px 10px 0 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.ac-cat-header::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.2s;
}

.ac-cat-wrapper:hover .ac-cat-header::after {
    transform: rotate(180deg);
}

/* --- DESKTOP: ZOZNAM HLAVNÝCH KATEGÓRIÍ (1. ÚROVEŇ) --- */
.ac-cat-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s,
    visibility 0.2s;
    z-index: 9992;
}

.ac-cat-wrapper:hover .ac-cat-list {
    opacity: 1;
    visibility: visible;
}

.widget .ac-cat-list .ac-cat-item,
.widget-content .ac-cat-list .ac-cat-item,
.ac-cat-item { 
    position: static !important; 
    border-bottom: 1px solid #eee !important; 
    padding: 0 !important; 
    margin: 0 !important; 
}
.widget .ac-cat-list .ac-cat-item:last-child,
.widget-content .ac-cat-list .ac-cat-item:last-child,
.ac-cat-item:last-child { 
    border-bottom: none !important; 
}

.ac-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px !important;
    color: #444;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
    margin: 0 !important;
}

.ac-cat-link:hover {
    background: #EFF6FF;
    color: #0d69ba;
}

.ac-cat-arrow {
    font-size: 20px;
    color: #999;
    line-height: 1;
    transition: color 0.2s;
    font-weight: 500;
}

.ac-cat-link:hover .ac-cat-arrow {
    color: #0d69ba;
}

/* --- DESKTOP MEGAMENU (Výsuvný panel vpravo, 2. ÚROVEŇ) --- */
.ac-cat-megamenu { 
    position: absolute; 
    top: 0; 
    left: 100%; 
    width: 300%; 
    height: 100%; 
    min-height: auto; 
    background: #fff; 
    display: flex; 
    box-shadow: 5px 5px 20px rgba(0,0,0,0.08); 
    border-radius: 0 10px 10px 0; 
    z-index: 9993; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.2s ease, visibility 0.2s ease; 
}
.ac-cat-item:hover .ac-cat-megamenu {
    opacity: 1;
    visibility: visible;
}

.ac-mega-left {
    width: 50%;
    display: flex;
    padding: 0 14px;
    flex-direction: column;
    overflow-y: auto;
}

.ac-mega-right {
    width: 50%;
    padding: 0 !important;
    position: relative !important;
    background-color: #f4f4f4;
    border-radius: 0 10px 10px 0;
    overflow: hidden;
    display: block !important;
}

.ac-mega-dynamic-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center center;
    margin: 0;
    border-radius: 0 10px 10px 0;
}

.ac-mega-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.ac-mega-sublist-title {
    font-weight: 700;
    color: #0d69ba;
    font-size: 14px;
    border-bottom: 2px solid #EFF6FF;
    display: inline-block;
    text-decoration: none;
    padding: 8px 14px;
}

.ac-mega-subitem {
    border-bottom: 1px solid #eee !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ac-mega-subitem:last-child {
    border-bottom: none;
}

.ac-mega-subitem a {
    color: #444;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    padding: 8px 14px;
    display: block;
    transition: all 0.2s ease;
}

.ac-mega-subitem a:hover {
    color: #0d69ba;
    background: #EFF6FF;
}

/* =======================================================
   RESPONZIVITA PRE PHONE (Vysúvací panel)
======================================================= */
@media (max-width: 992px) {

    /* --- Vypnúť desktop ---*/
    .ac-desktop-only {
        display: none !important;
    }
    
    /* --- Samostatné tlačidlo Kategórie nad produktmi --- */
    .ac-mobile-cat-button-wrapper {
        display: block; 
        width: 100%;
        margin-top: 0; 
        margin-bottom: 15px;
    }
    .ac-cat-mobile-btn {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        background: #fff;
        border: 1px solid #0d69ba;
        padding: 12px 20px;
        border-radius: 8px;
        color: #0d69ba;
        font-weight: 700;
        font-size: 15px;
        text-transform: uppercase;
        cursor: pointer;
        transition: all 0.2s;
    }
    .ac-cat-mobile-btn:active {
        background: #EFF6FF;
    }

    /* OVERLAY PRE PHONE */
    .ac-cat-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.7);
        z-index: 99998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .ac-cat-mobile-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    /* FULLSCREEN MENU PANEL */
    .ac-mobile-fs-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        max-width: 85%;
        height: 100vh;
        background: #fff;
        z-index: 99999;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: 5px 0 25px rgba(0,0,0,0.1);
    }
    .ac-mobile-fs-menu.is-open {
        left: 0;
    }

    .ac-mobile-fs-header {
        background: #0d69ba;
        color: #fff;
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 65px;
    }
    .ac-mobile-fs-close { 
        background: transparent; 
        border: none; 
        color: #fff; 
        font-size: 35px; 
        cursor: pointer; 
        padding: 0; 
        line-height: 1; 
    }
    .ac-mobile-fs-back { 
        background: transparent; 
        border: none; 
        color: #fff; 
        font-weight: 700; 
        font-size: 14px; 
        display: none; 
        align-items: center; 
        gap: 5px; 
        cursor: pointer; 
        padding: 0; 
    }
    .ac-mobile-title-text {
        color: #fff;
    }
    
    .ac-mobile-fs-back-icon {
        font-size: 24px;
        line-height: 0.8;
        margin-bottom: 3px;
    }

    /* BODY A ZOZNAMY */
    .ac-mobile-fs-body {
        flex-grow: 1;
        overflow-y: auto;
        position: relative;
        background: #fff;
    }

    .ac-mobile-fs-list, .ac-mobile-fs-sublist {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        transition: transform 0.3s ease, opacity 0.3s ease; background: #fff;
    }

    .ac-mobile-fs-list.is-hidden {
        transform: translateX(-100%);
        opacity: 0; pointer-events: none;
    }
    
    .ac-mobile-fs-sublist {
        left: 100%;
        opacity: 0;
        pointer-events: none;
    }

    .ac-mobile-fs-sublist.is-active {
        transform: translateX(-100%);
        opacity: 1;
        pointer-events: auto;
    }

    /* RIADKY KATEGÓRIÍ */
    .ac-mobile-item-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 18px 20px;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
        text-decoration: none;
        font-size: 15px;
        font-weight: 600;
    }
    .ac-mobile-item-link.view-all {
        background: #EFF6FF;
        color: #0d69ba;
        border-bottom: 2px solid #0d69ba;
    }
    .ac-mobile-subitem-link {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        color: #555;
        text-decoration: none;
        font-size: 14px;
    }
    .ac-mobile-drilldown-arrow {
        color: #999;
        font-size: 20px;
        line-height: 1;
        font-weight: 500;
    }
}