:root {
    --spr-primary: #e8703a;
    --spr-nav-dark: #2e2a28;
    --spr-text-muted: rgba(46, 42, 40, 0.55);
    --spr-radius-lg: 14px;
    --spr-shadow-dropdown: 0 20px 48px rgba(20, 18, 17, 0.18), 0 6px 16px rgba(20, 18, 17, 0.08);
}

.spr-subnav {
    background: #fff;
    border-bottom: 1px solid rgba(34, 45, 50, 0.08);
    position: sticky;
    top: var(--eco-header-h, 56px);
    z-index: 1025;
    overflow: visible;
    box-shadow: 0 1px 0 rgba(34, 45, 50, 0.04);
}

.spr-subnav__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    overflow: visible;
    padding: 0.4rem 0;
}

.spr-subnav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.05rem;
    align-items: center;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.spr-subnav__list::-webkit-scrollbar {
    display: none;
}

.spr-subnav__item {
    position: relative;
    flex-shrink: 0;
}

.spr-subnav__add {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    background: var(--spr-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    text-decoration: none;
    white-space: nowrap;
}

.spr-subnav__add--ghost {
    background: rgba(232, 112, 58, 0.1);
    color: var(--spr-primary);
    border: 1px solid rgba(232, 112, 58, 0.22);
}

.spr-subnav__scroll {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.spr-subnav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.45rem 0.62rem;
    border: none;
    background: transparent;
    color: var(--spr-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-decoration: none;
    cursor: pointer;
    border-radius: 9px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.spr-subnav__chevron {
    font-size: 0.55rem;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.spr-subnav__item.has-dropdown.is-open .spr-subnav__chevron {
    transform: rotate(180deg);
    opacity: 0.85;
}

/* Dropdown: скрыт до открытия */
.spr-subnav__dropdown {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid rgba(46, 42, 40, 0.08);
    border-radius: var(--spr-radius-lg);
    box-shadow: var(--spr-shadow-dropdown);
    box-sizing: border-box;
}

.spr-subnav__dropdown--portal {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2px;
    animation: sprDropdownIn 160ms ease forwards;
    pointer-events: auto;
    max-width: min(94vw, 640px);
    min-width: 240px;
}

.spr-subnav__dropdown--portal.spr-subnav__dropdown--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: min(94vw, 520px);
}

body > .spr-subnav__dropdown:not(.spr-subnav__dropdown--portal) {
    display: none !important;
}

.spr-subnav__dropdown > li {
    margin: 0;
    min-width: 0;
}

.spr-subnav__dropdown .spr-subnav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--spr-nav-dark);
    padding: 0.48rem 0.55rem;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    min-height: 36px;
    line-height: 1.3;
}

.spr-subnav__dropdown .spr-subnav__dropdown-item span {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.spr-subnav__dropdown .spr-subnav__dropdown-item:hover,
.spr-subnav__dropdown .spr-subnav__dropdown-item.is-active {
    background: rgba(232, 112, 58, 0.1);
    color: var(--spr-primary);
}

.spr-subnav__dropdown-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(232, 112, 58, 0.1);
    color: var(--spr-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.1rem;
}

.spr-subnav__dropdown-item:hover .spr-subnav__dropdown-icon,
.spr-subnav__dropdown-item.is-active .spr-subnav__dropdown-icon {
    background: var(--spr-primary);
    color: #fff;
}

.spr-subnav__dropdown-divider {
    height: 1px;
    margin: 0.35rem 0.45rem;
    background: rgba(46, 42, 40, 0.1);
    list-style: none;
}

.spr-subnav__dropdown-item--heading {
    font-weight: 700;
    color: var(--spr-nav-dark);
}

.spr-subnav__dropdown-item--nested {
    padding-left: 1.35rem;
}

.spr-subnav__dropdown-item--nested .spr-subnav__dropdown-icon {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
}

@keyframes sprDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.spr-subnav__link:hover {
    color: var(--spr-nav-dark);
    background: rgba(46, 42, 40, 0.05);
}

.spr-subnav__item.is-active > .spr-subnav__link,
.spr-subnav__link.is-active {
    color: var(--spr-primary);
    font-weight: 700;
    background: rgba(232, 112, 58, 0.1);
}

body.eco-has-header .layout-main,
body.eco-has-header .layout-content,
body.eco-has-header .spr-subnav,
body.eco-has-header .spr-subnav__inner,
body.eco-has-header .spr-subnav__scroll {
    overflow: visible;
}

body.eco-has-header .header-area,
body.eco-has-header .header-modern,
body.eco-has-header .header-style-1 {
    display: none !important;
}

/* Планшет: чуть крупнее пункты */
@media (min-width: 768px) {
    .spr-subnav__link {
        font-size: 0.82rem;
        padding: 0.48rem 0.72rem;
    }

    .spr-subnav__dropdown--portal.spr-subnav__dropdown--cols-2 {
        min-width: 480px;
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

/* Десктоп: без горизонтального скролла, перенос строк */
@media (min-width: 1200px) {
    .spr-subnav__list {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .spr-subnav__dropdown--portal.spr-subnav__dropdown--cols-2 {
        min-width: 540px;
        max-width: 640px;
    }
}

/* Мобильный: одна колонка, на всю ширину экрана */
@media (max-width: 767px) {
    .spr-subnav__inner {
        flex-wrap: wrap;
    }

    .spr-subnav__add {
        font-size: 0.68rem;
        padding: 0.4rem 0.65rem;
    }

    .spr-subnav__link {
        font-size: 0.74rem;
        padding: 0.4rem 0.55rem;
    }

    .spr-subnav__dropdown--portal {
        min-width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        left: 12px !important;
        right: 12px;
        width: calc(100vw - 24px) !important;
    }

    .spr-subnav__dropdown--portal.spr-subnav__dropdown--cols-2 {
        grid-template-columns: 1fr;
        min-width: calc(100vw - 24px) !important;
    }

    .spr-subnav__dropdown .spr-subnav__dropdown-item {
        font-size: 0.88rem;
        padding: 0.55rem 0.65rem;
    }
}
