/* ====== CATALOG BUTTON ======== */
.header-catalog-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 14px;
    border: 1px solid #fff;
    border-radius: 6px;
    background: transparent;
    font-weight: 500;
    color: var(--secondary-text-color);
    cursor: pointer;
}



.header-catalog-burger {
    width: 22px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}

.header-catalog-text {
    line-height: 0;
}

.header-catalog-burger::before,
.header-catalog-burger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
}

.header-catalog-burger::before {
    top: -6px;
}

.header-catalog-burger::after {
    top: 6px;
}

/* ======= OVERLAY ======== */
.header-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 90;
}

.header-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== SIDEBAR ====== */
.header-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 460px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    will-change: transform;
    touch-action: pan-y;
}

.header-sidebar.active {
    transform: translateX(0);
}

/* ====== SIDEBAR HEADER ======== */
.header-sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    background-color: #232f3e;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    box-sizing: border-box;
}

.header-sidebar-logo {
    width: 36px;
    height: auto;
}

.header-sidebar-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-sidebar-root-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 16px;
}

.header-sidebar-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
}

/* ===== MENU CONTAINERS ======= */
.header-sidebar-main-container,
.header-sidebar-sub-container {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: #fff;
    transition: transform .3s ease;
    -webkit-overflow-scrolling: touch;
}

/* MAIN */
.header-sidebar-main-container {
    transform: translateX(0);
}

.header-sidebar-main-container.enter-from-left {
    transform: translateX(-100%);
}

/* SUB */
.header-sidebar-sub-container {
    transform: translateX(100%);
}

.header-sidebar-sub-container.active {
    transform: translateX(0);
}

/* ====== ROOT MENU ======== */
.header-sidebar-root {
    list-style: none;
    padding: 0;
    margin: 0;
}

.root-item {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background .2s ease;
}

.root-item:hover {
    background: #f5f5f5;
}

.root-item::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    width: 28px;
    height: 28px;
    opacity: 0.4;
    transform: translateY(-50%);
    background: url('/assets/images/icons/arrow-right.svg') center / contain no-repeat;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.root-item:hover::after {
    opacity: 0.8;
}

.header-sidebar-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 18px 16px 16px 8px;
    color: #0073e6;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.header-sidebar-back-btn::before {
    content: '';
    width: 28px;
    height: 28px;
    opacity: 0.6;
    background: url('/assets/images/icons/arrow-left.svg') center / contain no-repeat;
    transition: filter 0.4s ease;
}

.header-sidebar-back-btn:hover::before {
    filter: brightness(0);
    opacity: 0.8;
}

.submenu-group {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.submenu-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #222;
}

.submenu-list {
    list-style: none;
    padding-left: 42px;
    margin: 0;
}

.submenu-list li {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: color .2s ease;
}

.submenu-list li:hover {
    color: #000;
    text-decoration: underline;
}

/* ==== SCROLLBAR ===== */
.header-sidebar-main-container::-webkit-scrollbar,
.header-sidebar-sub-container::-webkit-scrollbar {
    width: 8px;
}

.header-sidebar-main-container::-webkit-scrollbar-track,
.header-sidebar-sub-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.header-sidebar-main-container::-webkit-scrollbar-thumb,
.header-sidebar-sub-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.header-sidebar-main-container::-webkit-scrollbar-thumb:hover,
.header-sidebar-sub-container::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

/* ! Дополнение ==================================================== */
/* Главные категории */
.root-item {
    position: relative;
    padding-left: 56px;
    /* место под иконку */
}

.root-item::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Иконки по категориям */
.root-item[data-root="rent"]::before {
    background-image: url('/assets/images/icons/uslugi/excavator-dig.webp');
}

.root-item[data-root="services"]::before {
    background-image: url('/assets/images/icons/uslugi/landscape.png');
}

.root-item[data-root="materials"]::before {
    background-image: url('/assets/images/icons/materials/sand.png');
}

.root-item[data-root="attachments"]::before {
    background-image: url('/assets/images/icons/tech/excavator-5.png');
}

/* Подкатегории */
.submenu-title {
    position: relative;
    padding-left: 42px;
}

.submenu-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Block scroll */
body.no-scroll {
    overflow: hidden;
    height: 100vh;
    touch-action: none;
}

/* Иконки по data-sub */
.submenu-title[data-sub="earth"]::before {
    background-image: url('/assets/images/icons/uslugi/excavator-dig.webp');
}

.submenu-title[data-sub="loaders"]::before {
    background-image: url('/assets/images/icons/tech/loader-2.png');
}

.submenu-title[data-sub="cleaning"]::before {
    background-image: url('/assets/images/icons/tech/snow-clean.webp');
}

.submenu-title[data-sub="lifting"]::before {
    background-image: url('/assets/images/icons/tech/crane-2.png');
}

.submenu-title[data-sub="road"]::before {
    background-image: url('/assets/images/icons/tech/dump-truck.png');
}

.submenu-title[data-sub="attach"]::before {
    background-image: url('/assets/images/icons/tech/attach-2.png');
}

.submenu-title[data-sub="cleaning-service"]::before {
    background-image: url('/assets/images/icons/tech/snow-clean.webp');
}

.submenu-title[data-sub="destruction-service"]::before {
    background-image: url('/assets/images/icons/uslugi/destruction.png');
}

.submenu-title[data-sub="loader-service"]::before {
    background-image: url('/assets/images/icons/tech/loader-2.png');
}

.submenu-title[data-sub="tech-service"]::before {
    background-image: url('/assets/images/icons/tech/excavator-5.png');
}

.submenu-title[data-sub="landscape-service"]::before {
    background-image: url('/assets/images/icons/uslugi/landscape.png');
}

.submenu-title[data-sub="installation-service"]::before {
    background-image: url('/assets/images/icons/uslugi/drain.png');
}

.submenu-title[data-sub="materials-non-metallic"]::before {
    background-image: url('/assets/images/icons/materials/sand.png');
}

.submenu-title[data-sub="materials-eath"]::before {
    background-image: url('/assets/images/icons/uslugi/landscape.png');
}

.submenu-title[data-sub="materials-secondary"]::before {
    background-image: url('/assets/images/icons/materials/brickwall.png');
}
