/* =======================================================
   AC PRODUCT MEGAMENU - DROPDOWN DIZAJN 
======================================================= */

.widget_block { 
    margin-bottom: 0 !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;
}

/* --- SPOLOČNÉ A OVERLAY (Stmavenie pozadia) --- */
.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; }

/* --- GLOBÁLNE PÍSMO PRE MEGAMENU --- */
.ac-cat-wrapper,
.ac-cat-mobile-btn,
.ac-mobile-fs-menu {
    font-family: 'Gilroy', sans-serif !important;
}

/* --- DESKTOP: HLAVNÝ OBAL A NADPIS (TLAČIDLO) --- */
.ac-cat-wrapper { position: relative; width: 100%; background: none; z-index: 9991; }

.ac-cat-header { background: #0d69ba; 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; }

/* Po prejdení myšou zmeníme rohy hlavičky a otočíme šípku */
.ac-cat-wrapper:hover .ac-cat-header::after { transform: rotate(180deg); }

/* --- DESKTOP: ZOZNAM HLAVNÝCH KATEGÓRIÍ (1. ÚROVEŇ) --- */
/* Zoznam je predvolene skrytý, vyskočí až na hover */
.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; }

/* Zrušenie vynútených medzier zo šablóny na .widget ul li */
.widget .ac-cat-list .ac-cat-item,
.widget-content .ac-cat-list .ac-cat-item,
.ac-cat-item { 
    position: relative; 
    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: 1000px; min-height: 100%; background: #fff; opacity: 0; visibility: hidden; transition: opacity 0.2s, transform 0.2s; transform: translateX(10px); z-index: 9993; padding: 15px 20px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 20px; }
.ac-cat-item:hover .ac-cat-megamenu { opacity: 1; visibility: visible; transform: translateX(0); }

/* Podkategórie v megamenu */
.ac-mega-sublist { list-style: none; padding: 0; margin: 0; width: 220px; }
.ac-mega-sublist-title { font-weight: 700; color: #0d69ba; font-size: 16px; margin-bottom: 10px; border-bottom: 2px solid #EFF6FF; display: block; text-decoration: none; }
.ac-mega-subitem a { color: #444; text-decoration: none; font-weight: 500; font-size: 14px; display: block; transition: all 0.2s ease; }
.ac-mega-subitem a:hover { color: #0d69ba; padding-left: 5px;}

/* --- MOBILNÝ GOMBÍK --- */
.ac-cat-mobile-btn { display: none; width: 100%; padding: 15px; background: #0d69ba; color: #fff; text-align: center; border: none; font-size: 16px; font-weight: 700; cursor: pointer; margin-bottom: 15px; text-transform: uppercase; }

/* --- MOBILNÉ FULLSCREEN MENU --- */
.ac-mobile-fs-menu { position: fixed; top: 0; left: -100%; width: 100%; height: 100vh; background: #fff; z-index: 999999; transition: left 0.3s ease; display: flex; flex-direction: column; }
.ac-mobile-fs-menu.is-open { left: 0; }
.ac-mobile-fs-header { display: flex; justify-content: space-between; align-items: center; background: #0d69ba; color: #fff; padding: 15px 20px; font-size: 16px; font-weight: 700; height: 65px; box-sizing: border-box; }
.ac-mobile-fs-back { background: none; border: none; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; display: none; padding: 0; align-items: center; gap: 5px; width: 80px; text-align: left; }
.ac-mobile-title-text { flex-grow: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.ac-mobile-fs-close { background: none; border: none; color: #fff; font-size: 32px; cursor: pointer; line-height: 1; padding: 0; width: 80px; text-align: right; }

.ac-mobile-fs-body { flex-grow: 1; overflow-y: auto; position: relative; background: #fafafa; }

/* Prepínanie zoznamov na mobile */
.ac-mobile-fs-list { 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 { list-style: none; padding: 0; margin: 0; width: 100%; position: absolute; top: 0; left: 100%; transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0; pointer-events: none; background: #fff; }
.ac-mobile-fs-sublist.is-active { transform: translateX(-100%); opacity: 1; pointer-events: auto; }

.ac-mobile-item-link { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid #eee; color: #333; text-decoration: none; font-size: 16px; font-weight: 700; background: #fff; }
.ac-mobile-item-link.view-all { background: #EFF6FF; color: #0d69ba; }
.ac-mobile-subitem-link { display: block; padding: 15px 20px; border-bottom: 1px solid #eee; color: #555; text-decoration: none; font-weight: 500; font-size: 14px; background: #fff; }

/* --- RESPONZIVITA --- */
@media (max-width: 992px) {
    .ac-cat-wrapper { display: none; }
    .ac-cat-mobile-btn { display: block; }
}