/* Header PRODUCTS — main category list + hover flyout submenus */

.header,
.header-main,
.main-nav {
    overflow: visible;
}

.nav-products-dropdown {
    position: relative;
    list-style: none;
}

.main-nav-products-trigger {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    color: #000;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
    font-family: 'Gelion', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.main-nav-products-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    flex-shrink: 0;
    transform-origin: 50% 35%;
    transition: transform 0.2s ease;
}

.main-nav-products-trigger:hover {
    opacity: 0.7;
}

.main-nav-products-trigger[aria-expanded="true"] {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.main-nav-products-trigger[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.header-products-panel {
    position: absolute;
    z-index: 2000;
    top: calc(100% + 10px);
    right: 0;
    width: min(100vw - 32px, 280px);
    min-width: 220px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e4e6ed;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.06),
        0 16px 40px rgba(15, 23, 42, 0.12);
    overflow: visible;
}



.header-products-panel-inner {
    overflow: visible;
    padding: 8px 8px 8px 14px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.header-products-nav {
    display: block;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* Main category list */
.header-products-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.main-nav ul.header-products-menu {
    display: block;
    flex-direction: unset;
    flex-wrap: unset;
    align-items: stretch;
    justify-content: unset;
    gap: 0;
    width: 100%;
    padding: 0;
}

.header-products-menu-item {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.header-products-menu-item:last-child {
    border-bottom: none;
}

.main-nav ul.header-products-menu > .header-products-menu-item {
    display: block;
    width: 100%;
    flex: none;
    min-width: 0;
}

.header-products-menu-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
    font-family: 'Gelion', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f172a;
    line-height: 1.25;
    cursor: default;
    user-select: none;
}

.header-products-menu-label::after {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
}

.header-products-menu-item:hover > .header-products-menu-label,
.header-products-menu-item:focus-within > .header-products-menu-label {
    background-color: rgba(255, 241, 0, 0.45);
}

/* Flyout submenu (desktop) */
.header-products-submenu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    left: calc(100% - 4px);
    top: 0;
    min-width: min(100vw - 48px, 280px);
    max-width: 320px;
    background: #fff100;
    border: 1px solid #e4e6ed;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.06),
        0 16px 40px rgba(15, 23, 42, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(6px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
    z-index: 2010;
}

.main-nav ul.header-products-submenu {
    display: block;
    flex-direction: unset;
    flex-wrap: unset;
    gap: 0;
    padding: 6px 0;
}

.header-products-menu-item:hover > .header-products-submenu,
.header-products-menu-item:focus-within > .header-products-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.header-products-submenu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-products-submenu li:last-child {
    border-bottom: none;
}

.main-nav ul.header-products-submenu > li {
    display: block;
    width: 100%;
    flex: none;
}

.header-products-submenu a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    font-family: 'Gelion', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
    line-height: 1.35;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header-products-submenu a:hover,
.header-products-submenu a:focus-visible {
    background-color: rgba(255, 241, 0, 0.45);
    color: #000;
    outline: none;
}

/* Legacy flat list (if present elsewhere) */
.header-products-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

.main-nav ul.header-products-list {
    display: block;
    flex-direction: unset;
    flex-wrap: unset;
    align-items: stretch;
    justify-content: unset;
    gap: 0;
    width: 100%;
    padding: 0;
}

.header-products-list li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-products-list a {
    display: block;
    padding: 10px 8px;
    font-family: 'Gelion', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    text-decoration: none;
}

@media (max-width: 992px) {
    .main-nav.active ul.header-products-menu {
        display: block;
        flex-direction: unset;
        align-items: stretch;
        gap: 0;
        padding: 0;
    }

    .main-nav.active .nav-products-dropdown {
        width: 100%;
    }

    .main-nav.active .header-products-panel {
        position: static;
        top: auto;
        right: auto;
        min-width: 0;
        max-width: none;
        width: 100%;
        margin-top: 10px;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.12);
    }

    .main-nav.active .header-products-panel-inner {
        overflow: visible;
    }

    .header-products-menu-label {
        cursor: pointer;
    }

    .header-products-submenu {
        position: static;
        left: auto;
        top: auto;
        min-width: 0;
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        display: none;
        background: rgba(255, 255, 255, 0.35);
    }

    .header-products-menu-item.is-open > .header-products-submenu {
        display: block;
    }

    .header-products-menu-item.is-open > .header-products-menu-label::after {
        transform: rotate(90deg);
    }
}
