/* =========================
   MAIN NAV
========================= */
.custom-main-nav {
    position: relative;
    z-index: 500;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9;
}
.custom-main-nav__mobile-bar,.custom-main-nav.custom-main-nav--mobile {
    display: none;
}
 
.custom-main-nav__inner--desktop {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content:center;
    position: relative;
    background-color:var(--second-color);
    border-radius:8px;
}

.custom-main-nav__item {
    position: static;
    display: flex;
    align-items: stretch;
}

.custom-main-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.custom-main-nav__link:hover,
.custom-main-nav__link:focus {
    color: #fff;
}

.custom-main-nav__item--mega > .custom-main-nav__link--mega::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 1.5px solid;
    border-bottom: 1.5px solid;
    transform: rotate(45deg) translateY(-1px);
}

/* =========================
   DESKTOP MEGA PANEL
========================= */
.custom-main-nav__mega {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: min(1180px, 95vw);
    max-height: 78vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 10px 10px;
    z-index: 999;
}

.custom-main-nav__item--mega:hover > .custom-main-nav__mega,
.custom-main-nav__item--mega:focus-within > .custom-main-nav__mega {
    display: block;
}

.custom-main-nav__mega::-webkit-scrollbar {
    width: 8px;
}

.custom-main-nav__mega::-webkit-scrollbar-thumb {
    background: #d7d7d7;
    border-radius: 10px;
}

.custom-main-nav__mega::-webkit-scrollbar-track {
    background: #f7f7f7;
}

/* =========================
   MOBILE BURGER BAR
========================= */
.custom-main-nav__mobile-toggle {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    background: var(--second-color);
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    float:left;
}

.custom-main-nav__mobile-toggle-lines {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
}

.custom-main-nav__mobile-toggle-lines::before,
.custom-main-nav__mobile-toggle-lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #fff;
    transition: all 0.2s ease;
}

.custom-main-nav__mobile-toggle-lines::before {
    top: -6px;
}

.custom-main-nav__mobile-toggle-lines::after {
    top: 6px;
}

.custom-main-nav__mobile-toggle.is-active .custom-main-nav__mobile-toggle-lines {
    background: transparent;
}

.custom-main-nav__mobile-toggle.is-active .custom-main-nav__mobile-toggle-lines::before {
    top: 0;
    transform: rotate(45deg);
}

.custom-main-nav__mobile-toggle.is-active .custom-main-nav__mobile-toggle-lines::after {
    top: 0;
    transform: rotate(-45deg);
}

.custom-main-nav__mobile-title {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    display:none;
}

/* =========================
   MOBILE PANEL
========================= */
.custom-main-nav__mobile-panel {
    display: none;
    background: #fff;
    border-top: 1px solid #efefef;
}

.custom-main-nav.is-mobile-open .custom-main-nav__mobile-panel {
    display: block;
}

.custom-main-nav__mobile-tabs {
    display: none;
}

.custom-main-nav__mobile-content {
    display: block;
}

.custom-main-nav__mobile-section {
    display: block;
}

.custom-main-nav__mobile-item {
    border-bottom: 1px solid #efefef;
}

.custom-main-nav__mobile-link {
    display: block;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.2s ease, background 0.2s ease;
}

.custom-main-nav__mobile-link:hover,
.custom-main-nav__mobile-link:focus {
    color: var(--second-color);
}

.custom-main-nav__mobile-products-link-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #efefef;
    background: #ffffff;
}

.custom-main-nav__mobile-products-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--second-color);
    text-decoration: none;
}

.custom-main-nav__mobile-products-link:hover,
.custom-main-nav__mobile-products-link:focus {
    text-decoration: underline;
}

/* =========================
   MEGA MENU WRAPPER
========================= */
.custom-mega-menu {
    width: 100%;
}

.custom-mega-menu__inner {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
}

/* =========================
   LEVEL 1 ACCORDION
========================= */
.custom-mega-acc {
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.custom-mega-acc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #fafafa;
    border-bottom: 1px solid #ececec;
}

.custom-mega-acc__top-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-mega-acc__top-link:hover,
.custom-mega-acc__top-link:focus {
    color: var(--second-color);
    text-decoration: underline;
}

.custom-mega-acc__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    cursor: pointer;
    padding: 0 10px;
    min-height: 34px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--second-color);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.custom-mega-acc__toggle:hover,
.custom-mega-acc__toggle:focus {
    background: #fafafa;
    border-color: var(--second-color);
}

.custom-mega-acc__toggle-text {
    display: inline-block;
}

.custom-mega-acc__icon {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
}

.custom-mega-acc__icon::before,
.custom-mega-acc__icon::after {
    content: "";
    position: absolute;
    background: var(--second-color);
    transition: all 0.2s ease;
}

.custom-mega-acc__icon::before {
    width: 10px;
    height: 2px;
    left: 0;
    top: 4px;
}

.custom-mega-acc__icon::after {
    width: 2px;
    height: 10px;
    left: 4px;
    top: 0;
}

.custom-mega-acc.is-open .custom-mega-acc__icon::after {
    opacity: 0;
}

.custom-mega-acc__panel {
    display: none;
    padding: 14px;
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
}

.custom-mega-acc.is-open .custom-mega-acc__panel {
    display: block;
}

.custom-mega-acc__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px 16px;
}

/* =========================
   LEVEL 2 ACCORDION
========================= */
.custom-mega-subacc {
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.custom-mega-subacc__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #ffffff;
}

.custom-mega-subacc__title {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-mega-subacc__title:hover,
.custom-mega-subacc__title:focus {
    color: var(--second-color);
    text-decoration: underline;
}

.custom-mega-subacc__toggle {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid #e8e8e8;
    background: #fff;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.custom-mega-subacc__toggle:hover,
.custom-mega-subacc__toggle:focus {
    border-color: var(--second-color);
    background: #fafafa;
}

.custom-mega-subacc__icon {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
}

.custom-mega-subacc__icon::before,
.custom-mega-subacc__icon::after {
    content: "";
    position: absolute;
    background: var(--second-color);
    transition: all 0.2s ease;
}

.custom-mega-subacc__icon::before {
    width: 10px;
    height: 2px;
    left: 0;
    top: 4px;
}

.custom-mega-subacc__icon::after {
    width: 2px;
    height: 10px;
    left: 4px;
    top: 0;
}

.custom-mega-subacc.is-open .custom-mega-subacc__icon::after {
    opacity: 0;
}

.custom-mega-subacc__panel {
    display: none;
    padding: 0 12px 12px 18px;
    background: #fafafa;
    border-top: 1px dashed #ececec;
}

.custom-mega-subacc.is-open .custom-mega-subacc__panel {
    display: block;
}

/* =========================
   LEVEL 3 LIST
========================= */
.custom-mega-subacc__list {
    margin: 0;
    padding: 10px 0 0 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid var(--second-color);
}

.custom-mega-subacc__item {
    display: block;
}

.custom-mega-subacc__link {
    display: inline-block;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.custom-mega-subacc__link:hover,
.custom-mega-subacc__link:focus {
    color: var(--second-color);
    text-decoration: underline;
}

/* =========================
   ACCESSIBILITY
========================= */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 991px) {
    .custom-main-nav {
        border-top: 1px solid #ececec;
        border-bottom: 1px solid #ececec;
    }
    .menu-icons-left{
        display: inline-flex;
        align-items: center; 
        margin-left:8px;
    }
    .custom-main-nav__mobile-toggle{
        display:inline-flex;
        margin-right:8px;
    }

    .custom-main-nav__mobile-bar {
        display: flex;
        width:fit-content;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 0 12px;
    }
    .custom-main-nav.custom-main-nav--mobile{
        position:absolute;
        top:100%;
    }
    .custom-main-nav.custom-main-nav--mobile.is-mobile-open{
        display:block;
    }

    .custom-main-nav__inner--desktop {
        display: none;
    }

    .custom-main-nav__mobile-tabs {
        display: flex;
        padding: 8px 12px;
        gap: 8px;
        border-bottom: 1px solid #efefef;
        background: #fafafa;
    }

    .custom-main-nav__mobile-tab {
        flex: 1 1 0;
        min-height: 40px;
        border: 1px solid #dddddd;
        background: #ffffff;
        color: #222;
        font-size: 13px;
        font-weight: 700;
        border-radius: 8px;
        cursor: pointer;
        padding: 0 10px;
        transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }

    .custom-main-nav__mobile-tab.is-active {
        background: var(--second-color);
        color: #fff;
        border-color: var(--second-color);
    }

    .custom-main-nav__mobile-section {
        display: none;
        max-height:60vh;
        overflow-y:auto;
    }

    .custom-main-nav__mobile-section.is-active {
        display: block;
    }

    .custom-main-nav__mobile-products-wrap {
        padding: 8px 12px 14px;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-menu__inner {
        padding: 0;
        gap: 10px;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-acc {
        border: 1px solid #ececec;
        border-radius: 10px;
        background: #fff;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-acc__head {
        min-height: 44px;
        padding: 12px;
        gap: 10px;
        background: #fafafa;
        border-bottom: 1px solid #efefef;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-acc__panel {
        padding: 10px 12px 12px;
        background: #fcfcfc;
        border-top: 0;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-acc__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc {
        border: 1px solid #ececec;
        border-radius: 8px;
        background: #fff;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc__head {
        min-height: 44px;
        padding: 10px 12px;
        gap: 10px;
        background: #fff;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc__panel {
        padding: 0 12px 12px 16px;
        background: #fafafa;
        border-top: 1px dashed #ececec;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc__list {
        padding-top: 10px;
        padding-left: 12px;
        border-left: 3px solid var(--second-color);
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc__title {
        font-size: 13px;
    }

    .custom-main-nav__mobile-products-wrap .custom-mega-subacc__link {
        font-size: 12px;
        padding: 2px 0;
    }

    .custom-mega-acc__toggle-text {
        display: none;
    }

    /* toggle produse mobil */
    .custom-main-nav__toggle {
        display: inline-flex;
        position: absolute;
        top: 0;
        right: 0;
        width: 46px;
        min-width: 46px;
        height: 46px;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #efefef;
        background: #fff;
        cursor: pointer;
        z-index: 2;
    }

    .custom-main-nav__toggle-icon {
        position: relative;
        display: block;
        width: 16px;
        height: 2px;
        background: var(--second-color);
    }

    .custom-main-nav__toggle-icon::before,
    .custom-main-nav__toggle-icon::after {
        content: "";
        position: absolute;
        left: 0;
        width: 16px;
        height: 2px;
        background: var(--second-color);
        transition: all 0.2s ease;
    }

    .custom-main-nav__toggle-icon::before {
        top: -6px;
    }

    .custom-main-nav__toggle-icon::after {
        top: 6px;
    }

    .custom-main-nav__item--mega.is-open .custom-main-nav__toggle-icon {
        background: transparent;
    }

    .custom-main-nav__item--mega.is-open .custom-main-nav__toggle-icon::before {
        top: 0;
        transform: rotate(45deg);
    }

    .custom-main-nav__item--mega.is-open .custom-main-nav__toggle-icon::after {
        top: 0;
        transform: rotate(-45deg);
    }

    .custom-main-nav__item--mega .custom-main-nav__link {
        width: calc(100% - 46px);
        min-height: 46px;
        padding: 12px 14px;
    }

    /* toggle nivel 1 mai mare */
    .custom-mega-acc__toggle {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0;
        border-radius: 8px;
    }

    .custom-mega-acc__icon {
        width: 14px;
        height: 14px;
    }

    .custom-mega-acc__icon::before {
        width: 14px;
        height: 2px;
        top: 6px;
    }

    .custom-mega-acc__icon::after {
        width: 2px;
        height: 14px;
        left: 6px;
    }

    .custom-mega-acc__top-link {
        width: calc(100% - 54px);
        font-size: 14px;
        line-height: 1.3;
    }

    /* toggle nivel 2 mai mare */
    .custom-mega-subacc__toggle {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        flex: 0 0 40px;
        border-radius: 8px;
    }

    .custom-mega-subacc__icon {
        width: 14px;
        height: 14px;
    }

    .custom-mega-subacc__icon::before {
        width: 14px;
        height: 2px;
        top: 6px;
    }

    .custom-mega-subacc__icon::after {
        width: 2px;
        height: 14px;
        left: 6px;
    }

    .custom-mega-subacc__title {
        width: calc(100% - 50px);
        font-size: 13px;
        line-height: 1.3;
    }

    .custom-main-nav__toggle:active,
    .custom-mega-acc__toggle:active,
    .custom-mega-subacc__toggle:active {
        transform: scale(0.98);
    }
}