/* Mobile category bottom sheet */
@media (max-width: 991px) {
    body.mobile-category-open {
        overflow: hidden;
    }
}

.mobile-category-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    max-height: min(82dvh, 720px);
    background: hsl(var(--white));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px hsl(var(--black) / 0.18);
    visibility: hidden;
    opacity: 0;
    transform: translateY(105%);
    transition: transform 0.32s ease, opacity 0.25s ease, visibility 0.32s ease;
    pointer-events: none;
}

.mobile-category-panel.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-category-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 20px 20px 16px;
    border-bottom: 1px solid hsl(var(--border));
}

.mobile-category-panel__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: hsl(var(--base));
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mobile-category-panel__title {
    margin: 0;
    color: hsl(var(--dark));
    font-family: var(--heading-font, "Poppins", sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.mobile-category-panel__close {
    display: grid;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid hsl(var(--border));
    border-radius: 50%;
    background: hsl(var(--light-2));
    color: hsl(var(--dark) / 0.75);
    font-size: 1.25rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-category-panel__close:hover,
.mobile-category-panel__close:focus-visible {
    background: hsl(var(--base));
    color: hsl(var(--white));
}

.mobile-category-panel__body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
}

.mobile-category-tree,
.mobile-category-tree__children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-category-tree__item {
    border-bottom: 1px solid hsl(var(--border) / 0.7);
}

.mobile-category-tree__item:last-child {
    border-bottom: 0;
}

.mobile-category-tree__row {
    display: flex;
    align-items: center;
    min-height: 58px;
    gap: 8px;
}

.mobile-category-tree__link {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    gap: 11px;
    padding: 12px 0;
    color: hsl(var(--dark));
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
}

.mobile-category-tree__link:hover,
.mobile-category-tree__link:focus-visible {
    color: hsl(var(--base));
}

.mobile-category-tree__icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 7px;
    background: hsl(var(--light-2));
}

.mobile-category-tree__icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mobile-category-tree__toggle {
    display: grid;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 8px;
    color: hsl(var(--dark) / 0.6);
    font-size: 1.1rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.mobile-category-tree__toggle:hover,
.mobile-category-tree__toggle:focus-visible {
    background: hsl(var(--base) / 0.1);
    color: hsl(var(--base));
}

.mobile-category-tree__item.expanded > .mobile-category-tree__row .mobile-category-tree__toggle {
    color: hsl(var(--base));
}

.mobile-category-tree__children {
    display: none;
    margin: 0 0 10px 17px;
    padding-left: 14px;
    border-left: 2px solid hsl(var(--base) / 0.18);
}

.mobile-category-tree__children .mobile-category-tree__row {
    min-height: 46px;
}

.mobile-category-tree__children .mobile-category-tree__link {
    padding: 9px 0;
    color: hsl(var(--body-color));
    font-size: 0.875rem;
    font-weight: 400;
}

.mobile-category-tree__children .mobile-category-tree__children {
    margin-left: 10px;
    border-left-color: hsl(var(--border));
}

.mobile-category-tree__children .mobile-category-tree__children .mobile-category-tree__link {
    color: hsl(var(--body-color) / 0.82);
    font-size: 0.8125rem;
}

@media (min-width: 992px) {
    .mobile-category-panel {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .mobile-category-panel {
        max-height: min(86dvh, 720px);
    }

    .mobile-category-panel__header {
        padding-inline: 16px;
    }

    .mobile-category-panel__body {
        padding-inline: 16px;
    }
}
