/* ==============================================
   Кнопка "Каталог" в навбаре
   ============================================== */

.nav-item--catalog {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    transition: color 0.2s;
}

.nav-item--catalog:hover,
.nav-item--catalog.nav-item--catalog-open {
    color: #2E9B5E;
}


/* ==============================================
   Десктоп
   ============================================== */

.catalog-overlay-desktop {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

/* Белый блок — перекрывает хедер сверху вниз */
.catalog-header-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    /* совпадает с высотой вашего хедера */
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    z-index: 502;
    pointer-events: all;

    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.42s cubic-bezier(0.22, 0.8, 0.36, 1);
}

/* Анимация запускается сразу при mount —
   компонент появляется в DOM уже с open-классом не нужен,
   используем animation */
.catalog-overlay-desktop .catalog-header-panel {
    clip-path: inset(0 0 0% 0);
}

.catalog-header-panel__inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding: 0 24px;

    opacity: 0;
    animation: fadeSlideIn 0.25s ease 0.25s forwards;
}

.catalog-header-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.catalog-header-panel__close:hover {
    background: #eaeaea;
    color: #333;
}

/* Панель с категориями — под навбаром */
.catalog-dropdown {
    position: fixed;
    /* top: 96px; */
    top: 56px;
    /* высота хедера + навбара, подберите под ваш сайт */
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 501;
    pointer-events: all;
    overflow: hidden;

    max-height: 0;
    opacity: 0;
    animation: expandDown 0.42s cubic-bezier(0.22, 0.8, 0.36, 1) 0.08s forwards;
}

/* Затемнение */
.catalog-overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0);
    pointer-events: all;
    cursor: default;
    animation: fadeBackdrop 0.35s ease 0.1s forwards;
}


/* ==============================================
   Мобильный bottom sheet
   ============================================== */

.catalog-overlay-mobile {
    position: fixed;
    inset: 0;
    z-index: 500;
}

.catalog-overlay-backdrop--mobile {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease;
    cursor: default;
}

.catalog-overlay-backdrop--dark {
    background: rgba(0, 0, 0, 0.35);
}

.catalog-bs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px 14px 0 0;
    border-top: 0.5px solid #e8e8e8;
    z-index: 501;
    display: flex;
    flex-direction: column;
    transition: height 0.38s cubic-bezier(0.22, 0.8, 0.36, 1);

    /* анимация появления снизу */
    animation: slideUp 0.38s cubic-bezier(0.22, 0.8, 0.36, 1) forwards;
}

/* Полуоткрыт — ~55% экрана */
.catalog-bs--half {
    height: 55vh;
}

/* Полностью открыт — почти весь экран */
.catalog-bs--full {
    height: calc(100vh - 60px);
}

/* Хэндл */
.catalog-bs__handle-area {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: ns-resize;
    user-select: none;
    touch-action: none;
}

.catalog-bs__handle {
    width: 36px;
    height: 4px;
    background: #d8d8d8;
    border-radius: 2px;
}

/* Шапка */
.catalog-bs__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
    border-bottom: 0.5px solid #f0f0f0;
}

.catalog-bs__title {
    font-size: 15px;
    font-weight: 500;
    color: #222;
}

.catalog-bs__close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 0.5px solid #e0e0e0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.catalog-bs__close:hover {
    background: #eaeaea;
}

/* Тело — CategoriesBlock занимает оставшееся место и скроллится */
.catalog-bs__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}


/* ==============================================
   Keyframes
   ============================================== */

@keyframes fadeSlideIn {
    to {
        opacity: 1;
    }
}

@keyframes expandDown {
    to {
        max-height: 480px;
        /* подберите под реальную высоту CategoriesBlock */
        opacity: 1;
    }
}

@keyframes fadeBackdrop {
    to {
        background: rgba(0, 0, 0, 0.18);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}