.category{
    background-color: var(--bg-secondary);
}

/* Positioning lives in categories-menu.css (push ≥768 / drawer <768) */
.categories__category-menu{
    position: fixed !important;
}

.category__main{
    width: var(--theme-main-width);
    margin-left: var(--theme-main-offset);
    display: flex;
    flex-direction: column;
}

@media (max-width: 767px) {
    .category__main{
        width: 100%;
        margin-left: 0;
    }
}

/* Header */
.category__header{
    position: relative;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 16rem;
    min-height: 9.375rem;
    overflow: hidden;
}
.category__header__container{
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}


/* Header - Label */
.category__header__label{
    display: flex;
    padding: 18px 40px 18px 54px;
    justify-content: space-between;
}
@media (max-width: 768px) {
    .category__header__label{
        padding: 18px 16px;
    }
}


/* Header - Label - Logo  */
.category__header-logo{
    z-index: 2;
    max-width: 288px;
    max-height: 44px;
}
@media (max-width: 768px) {
    .category__header-logo{
        display: none;
    }
}


/* Header - Content */
.category__header-content{
    z-index: 2;
    box-sizing: border-box;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 1.125rem 2.5rem 1.125rem 3.375rem;
    display: flex;
    gap: 1.125rem;
    align-items: center;
}

.category__header-content-image-wrap{
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

/* Header - Content - Image */
.category__header-content-image{
    width: auto;
    height: 100%;
    max-width: 9.375rem;
    object-fit: contain;
}

.category__header-content-marker{
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    /* Offset matches content padding-bottom — tip sits on hero edge */
    transform: translate(-50%, 1.125rem);
}

.category__header-content-marker .category__separator-svg{
    display: block;
}

/* Header - filter tags (attribute options, not subcategories) */
.category__header-tags{
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    align-content: center;
    min-width: 0;
}

.category__header-tag,
.category__header-tag-clear{
    padding-inline: 0.5rem !important;
    border-radius: 0.875rem !important;
    text-decoration: none;
}

.category__header-tag-clear{
    flex-shrink: 0;
}

.category__header-tag span{
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0.009375rem;
    color: var(--fg-secondary);
    opacity: 0.8;
}

/* Header - Background */
.category__header-background{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    filter: blur(3px);
    opacity: 0.7;
}

/* Content */
.category__content{
    padding-top: 1.75rem;
    border-top: 2px solid var(--border-secondary);
    display: flex;
    flex-direction: column;
}

.category__content-shell{
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category__body{
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-width: 0;
}

.category__content__main{
    flex: 1 1 auto;
    min-width: 0;
}

/* Content - Label */
.category__main__content__label{
    padding: 0 40px 16px 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
/* Content - Label - Title */
.category__main__content__label-title{
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-text);
    font-size: var(--text-xl);
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0.19px;
    opacity: 0.58;
    color: var(--fg-secondary);
}

.category__main__content__label-count{
    margin-left: 0.375rem;
    font-weight: 500;
    white-space: nowrap;
}
/* Content - Label - Buttons - Filter */
.category__main__content__label-btn{
    color: var(--fg-secondary);
    opacity: 0.8;
    font-family: var(--font-display);
    font-weight: 600;
}
@media (max-width: 768px) {
    .category__main__content__label{
        padding: 0 16px 16px 16px;
    }
    .category__main__content__label-title{
        line-height: 19px;
    }
}


/* Content - Products */
.category__content-products{
    display: grid;
    padding: 28px 40px 28px 54px;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap:20px;
    justify-items: stretch;
}

.category__content-load-sentinel{
    width: 100%;
    height: 1px;
    pointer-events: none;
}

.category__content-load-more{
    padding: 0 2.5rem 2rem 3.375rem;
}

.category__content-load-more-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 20px;
    justify-items: stretch;
}

/* End description — CMS prose (content-page.css) + category grid alignment */
.category__description.content-page{
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.75rem 2.5rem 2.5rem 3.375rem;
}

.category__description.content-page .content-page__body{
    max-width: 44rem;
    margin-inline: auto;
}

/* Bare TinyMCE headings when admin did not wrap content-page__section blocks */
.category__description .content-page__body > h2,
.category__description .content-page__body > h3{
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 0.125rem solid var(--border-secondary);
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-weight: 600;
    line-height: 1.375rem;
    letter-spacing: 0.01em;
}

.category__description .content-page__body > h2{
    margin-bottom: 0.75rem;
    font-size: var(--text-lg);
}

.category__description .content-page__body > h3{
    margin-bottom: 0.75rem;
    font-size: var(--text-base);
}

.category__description .content-page__body > :first-child{
    /* margin-top: 0; */
    /* padding-top: 0; */
    /* border-top: none; */
}

body.category-filters-lock{
    overflow: hidden;
}

/* Filter backdrop (tablet / mobile sheet) */
.category__filters-backdrop{
    display: none;
}

/* Content - Filters */
.category__filters{
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 0;
    background-color: var(--bg-secondary);
    border: 0.125rem solid var(--border-secondary);
    border-radius: 1rem;
    transition: transform 0.28s ease, opacity 0.2s ease;
}

.category__filters-handle{
    display: none;
}

.category__filters-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-bottom: 0.5rem;
}

.category__filters-header-actions{
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.category__filters-header > span{
    color: var(--fg-secondary);
    text-overflow: ellipsis;
    font-family: var(--font-text);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.17px;
    opacity: 0.8;
    min-width: 0;
}

.category__filters-clear{
    opacity: 0.8;
    white-space: nowrap;
}

.category__filters-header-close{
    color: var(--fg-primary);
    flex-shrink: 0;
}

.category__filters-empty{
    margin: 0;
    padding: 0.5rem 0 1rem;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.25rem;
}

/* Scrollable filter body only */
.category__filters-content{
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--fg-tertiary) transparent;
}

.category__filters-content::-webkit-scrollbar {
    width: 6px;
}
.category__filters-content::-webkit-scrollbar-track {
    background: transparent;
}
.category__filters-content::-webkit-scrollbar-thumb {
    background-color: var(--fg-tertiary);
    border-radius: 3px;
}
.category__filters-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--fg-secondary);
}
.category__filters-content::-webkit-scrollbar-button,
.category__filters-content::-webkit-scrollbar-button:start:decrement,
.category__filters-content::-webkit-scrollbar-button:end:increment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.category__filters-footer{
    flex-shrink: 0;
    display: flex;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
    background-color: var(--bg-secondary);
}

.category__filters-confirm{
    width: 100%;
}

/* Content - Filters - Content - Item */
.category__filters-content-item{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.category__filters-content-item:not(:last-child){
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-secondary);
}
.category__filters-content-item-header{
    display: flex;
    gap:4px;
    align-items: center;
    width: 100%;
    cursor: pointer;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
}
.category__filters-content-item-header span:last-child{
    overflow: hidden;
    color: var(--fg-secondary);
    text-overflow: ellipsis;
    opacity: 0.8;
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 14px;
    letter-spacing: 0.11px;
}

.category__filters-content-item-header-icon-wrap{
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--fg-secondary);
    opacity: 0.8;
}

.category__filters-content-item-header-icon-wrap .category__filters-content-item-header-icon{
    transition: transform 0.2s ease;
    transform: rotate(180deg);
}

.category__filters-content-item-header-icon-wrap--open .category__filters-content-item-header-icon{
    transform: rotate(0deg);
}

.category__filters-content-item-body{
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0.25rem 0;
    transition: max-height 0.2s ease;
}
.category__filters-content-container-item{
    display: flex;
    gap: 0.625rem;
    align-items: center;
    min-width: 0;
    color: var(--fg-secondary);
    font-feature-settings: 'ss01' on;
    opacity: 0.8;
    font-family: var(--font-text);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0.15px;
}

.category__filters-content-item-body--hide{
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    gap: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.category__filters-content-item-body--show{
    max-height: none;
    opacity: 1;
    visibility: visible;
}

/* Price range */
.category__filters-price{
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.25rem;
}

.category__filters-price-inputs{
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.category__filters-price-field{
    flex: 1 1 0;
    min-width: 0;
}

.category__filters-price-sep{
    flex-shrink: 0;
    padding-bottom: 0.625rem;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    line-height: 1;
}

/* Price range — tertiary-style thumbs; stable hitbox (no transform jump) */
.category__filters-price-range{
    --price-thumb-size: 1.25rem;
    --price-thumb-edge: 0.125rem;
    --price-thumb-hit: 2.5rem;
    --price-thumb-motion: 140ms cubic-bezier(0.22, 1, 0.36, 1);

    position: relative;
    height: var(--price-thumb-hit);
    display: flex;
    align-items: center;
}

.category__filters-price-track{
    position: absolute;
    left: calc(var(--price-thumb-size) / 2);
    right: calc(var(--price-thumb-size) / 2);
    top: 50%;
    height: 0.25rem;
    border-radius: 999px;
    background-color: var(--border-secondary);
    pointer-events: none;
    transform: translateY(-50%);
}

.category__filters-price-track-fill{
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: inherit;
    background-color: var(--bg-brand-primary);
}

.category__filters-price-slider{
    position: absolute;
    left: 0;
    width: 100%;
    margin: 0;
    appearance: none;
    background: transparent;
    pointer-events: auto;
    height: var(--price-thumb-hit);
    cursor: pointer;
    touch-action: none;
}

.category__filters-price-slider::-webkit-slider-runnable-track{
    height: 0.25rem;
    background: transparent;
}

.category__filters-price-slider::-moz-range-track{
    height: 0.25rem;
    background: transparent;
    border: 0;
}

.category__filters-price-slider::-webkit-slider-thumb{
    appearance: none;
    width: var(--price-thumb-size);
    height: var(--price-thumb-size);
    margin-top: calc((0.25rem - var(--price-thumb-size)) / 2);
    border-radius: 999px;
    border: var(--price-thumb-edge) solid var(--border-secondary);
    background-color: var(--bg-primary-alt);
    box-shadow: 0 var(--price-thumb-edge) 0 0 var(--border-secondary);
    cursor: grab;
    transition:
        background-color var(--price-thumb-motion),
        border-color var(--price-thumb-motion),
        box-shadow var(--price-thumb-motion);
}

.category__filters-price-slider::-moz-range-thumb{
    width: var(--price-thumb-size);
    height: var(--price-thumb-size);
    border-radius: 999px;
    border: var(--price-thumb-edge) solid var(--border-secondary);
    background-color: var(--bg-primary-alt);
    box-shadow: 0 var(--price-thumb-edge) 0 0 var(--border-secondary);
    cursor: grab;
    transition:
        background-color var(--price-thumb-motion),
        border-color var(--price-thumb-motion),
        box-shadow var(--price-thumb-motion);
}

.category__filters-price-slider::-webkit-slider-thumb:hover{
    background-color: var(--bg-primary-hover);
}

.category__filters-price-slider::-moz-range-thumb:hover{
    background-color: var(--bg-primary-hover);
}

.category__filters-price-slider::-webkit-slider-thumb:active{
    cursor: grabbing;
    background-color: var(--bg-primary-press);
    box-shadow: none;
}

.category__filters-price-slider::-moz-range-thumb:active{
    cursor: grabbing;
    background-color: var(--bg-primary-press);
    box-shadow: none;
}

.category__filters-price-slider--min{
    z-index: 3;
}

.category__filters-price-slider--max{
    z-index: 4;
}

.category__filters-price-slider--active{
    z-index: 5;
}

.category__filters-price-hint{
    margin: 0;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-xs);
    font-weight: 500;
    line-height: 1rem;
}

/* Desktop: push slot instant, panel slides on translate */
@media (min-width: 1024px) {
    .category__filters{
        width: 0;
        max-width: 0;
        flex: 0 0 0;
        margin: 0;
        padding: 0;
        border-width: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transform: translateX(110%);
    }

    .category__body--filters-open .category__filters{
        width: 18.75rem;
        max-width: 18.75rem;
        flex: 0 0 18.75rem;
        margin-right: 2.5rem;
        padding: 0.5rem 1rem 0.75rem;
        border-width: 0.125rem;
        overflow: hidden;
        visibility: visible;
    }

    .category__filters--open{
        position: sticky;
        top: calc(var(--shop-header-clearance) + 0.75rem);
        align-self: flex-start;
        max-height: calc(100vh - var(--shop-header-clearance) - 1.5rem);
        height: auto;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .category__body--filters-open .category__filters--close{
        opacity: 0;
        pointer-events: none;
        transform: translateX(110%);
    }

    .category__body--filters-open .category__content-products{
        padding-right: 1rem;
    }
}

/* Tablet + mobile: floating bottom sheet */
@media (max-width: 1023px) {
    .category__filters-backdrop{
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background-color: var(--bg-primary-80);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .category__filters-backdrop--open{
        opacity: 1;
        pointer-events: auto;
    }

    .category__filters{
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        z-index: 50;
        width: auto;
        max-width: none;
        flex: none;
        height: auto;
        max-height: min(85vh, 40rem);
        margin: 0;
        padding: 0;
        border-width: 0.1875rem;
        opacity: 1;
        overflow: hidden;
        visibility: visible;
        transform: translateY(calc(100% + 1.5rem));
        transition: transform 0.3s ease;
        pointer-events: none;
        box-shadow: var(--effect-tooltip-shadow);
    }

    .category__filters--open{
        padding: 0 1rem 0.75rem;
        transform: translateY(0);
        pointer-events: auto;
    }

    .category__filters--close{
        width: auto;
        max-width: none;
    }

    .category__filters-handle{
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        height: 1.75rem;
        cursor: grab;
        touch-action: none;
    }

    .category__filters-handle-line{
        display: block;
        width: 2.75rem;
        height: 0.25rem;
        border-radius: 999px;
        background-color: var(--border-secondary);
        opacity: 0.85;
    }
}



@media (max-width: 768px) {
    .category__header{
        height: 7.5rem;
        min-height: 7.5rem;
    }

    .category__header-content{
        padding: 1.125rem 1rem;
        align-items: center;
    }

    /* Room plate extends under fixed shop-header + mobile page crumbs */
    .shop-header__page-crumbs + .category__header{
        height: auto;
        min-height: calc(
            var(--shop-header-clearance)
            + var(--shop-header-mobile-action-stack, 3.875rem)
            + var(--shop-header-mobile-crumbs-slot, 1.75rem)
            + 0.75rem
            + 7.5rem
        );
    }

    .shop-header__page-crumbs + .category__header .category__header-content{
        box-sizing: border-box;
        min-height: 7.5rem;
        padding:
            calc(
                var(--shop-header-clearance)
                + var(--shop-header-mobile-action-stack, 3.875rem)
                + var(--shop-header-mobile-crumbs-slot, 1.75rem)
                + 0.75rem
            )
            1rem
            1.125rem;
        align-items: center;
    }

    .category__header-content-image{
        max-width: 7.5rem;
    }

    .category__header-tag span{
        font-weight: 500;
        line-height: 1.375rem;
    }

    .category__content-products{
        display: grid;
        padding: 18px 16px 18px 16px;
        grid-template-columns: 1fr;
    }

    .category__content-load-more{
        padding: 0 1rem 1.125rem;
    }

    .category__content-load-more-grid{
        grid-template-columns: 1fr;
    }

    .category__description.content-page{
        padding: 1.75rem 1rem 2rem;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-skeleton) 25%, var(--bg-skeleton-shine) 50%, var(--bg-skeleton) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 12px;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-skeleton) 25%, var(--bg-skeleton-shine) 50%, var(--bg-skeleton) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin: 8px 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
