@media (max-width: 768px) {
    html.fpcw-scroll-lock {
        overflow: hidden;
    }
}

.fpcw-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.fpcw-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.product-category-sticky {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    max-width: min(300px, 88vw);
    min-width: 260px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    contain: layout paint;
    touch-action: pan-y;
    box-shadow: 0 3px 13px 0 rgb(18 43 70 / 10%);
    opacity: 0;
    padding: 0;
    overflow: hidden;
}

.button-toggle-woo-category {
    z-index: 999;
    border: none;
    position: fixed;
    top: 200px; /* Overridden by Customizer inline CSS. */
    border-radius: 2px;
    box-shadow: 0 3px 13px 0 rgb(18 43 70 / 10%);
    padding: 0.45em 0.6em;
    transform: rotate(90deg) translate(0, 45px);
    transition: transform 0.5s ease-in;
    cursor: pointer;
    min-height: 44px;
}

.button-toggle-woo-category:focus-visible,
.float-cat-close-btn:focus-visible,
.fpcw-toggle:focus-visible,
.fpcw-tree-action:focus-visible,
.fpcw-search__clear:focus-visible,
.atomic-category__list__link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.fpcw-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.float-cat-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    box-shadow: 0 3px 13px 0 rgb(18 43 70 / 10%);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.fc-button-toggle-text {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
}

.active-appbar {
    opacity: 1;
}

.fpcw-breadcrumb {
    padding: 0 1rem 0.5rem;
    flex-shrink: 0;
}

.fpcw-cat-description {
    padding: 0 1rem 0.65rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    opacity: 0.9;
}

.fpcw-cat-description p:last-child {
    margin-bottom: 0;
}

.fpcw-breadcrumb__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.35rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

.fpcw-breadcrumb__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fpcw-breadcrumb__sep {
    opacity: 0.6;
}

.fpcw-search {
    padding: 0 1rem 0.65rem;
    flex-shrink: 0;
}

.fpcw-search__field {
    position: relative;
    display: flex;
    align-items: center;
}

.fpcw-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55em 2.2em 0.55em 0.65em;
    border: 1px solid color-mix(in srgb, var(--fpcw-chrome, #fff) 20%, transparent);
    border-radius: 4px;
    font-size: 0.9rem;
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 12%, transparent);
}

.fpcw-search__clear {
    position: absolute;
    right: 0.25rem;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 4px;
}

.fpcw-search__status {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
}

.fpcw-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 1rem 0.65rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.fpcw-shop-all {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.fpcw-shop-all:hover {
    text-decoration: underline;
}

.fpcw-tree-actions {
    display: flex;
    gap: 0.35rem;
}

.fpcw-tree-action {
    border: 1px solid color-mix(in srgb, var(--fpcw-chrome, #fff) 25%, transparent);
    background: transparent;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    cursor: pointer;
    min-height: 32px;
}

.fpcw-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 0 1rem 1rem;
}

.fpcw-term-section + .fpcw-term-section {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid color-mix(in srgb, var(--fpcw-chrome, #fff) 12%, transparent);
}

.fpcw-term-section__heading {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.85;
}

.fpcw-flat-list .fpcw-node--flat + .fpcw-node--flat {
    margin-top: 0;
}

.atomic-category__heading {
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0;
}

.atomic-category__list__link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.35rem;
    min-height: 44px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.atomic-category__list__link:hover {
    text-decoration: none;
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 8%, transparent);
}

.atomic-category__list__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atomic-category__list__count {
    flex: 0 0 auto;
    min-width: 1.5rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 15%, transparent);
}

.fpcw-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.fpcw-row .atomic-category__list__link {
    flex: 1 1 auto;
    min-width: 0;
}

.fpcw-toggle,
.fpcw-toggle-spacer {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
}

.fpcw-toggle {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    border-radius: 4px;
}

.fpcw-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease;
    opacity: 0.85;
}

.fpcw-toggle.is-open::before {
    transform: translate(-50%, -50%) rotate(90deg);
}

.fpcw-toggle:hover {
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 8%, transparent);
}

.fpcw-children {
    display: none;
    margin-left: 0.5rem;
    padding-left: 0.65rem;
    border-left: 2px solid color-mix(in srgb, var(--fpcw-chrome, #fff) 15%, transparent);
}

.fpcw-children.is-open {
    display: block;
}

.fpcw-node.depth-0 > .fpcw-row .atomic-category__list__name {
    font-weight: 600;
}

.fpcw-node.depth-1 .atomic-category__list__name {
    font-size: 0.95rem;
}

.fpcw-node.depth-2 .atomic-category__list__name {
    font-size: 0.9rem;
}

.fpcw-node.is-active-trail > .fpcw-row {
    position: relative;
}

.fpcw-node.is-active-trail > .fpcw-row .atomic-category__list__link {
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 10%, transparent);
}

.fpcw-node.is-current > .fpcw-row .atomic-category__list__link {
    font-weight: 700;
    box-shadow: inset 3px 0 0 currentColor;
}

.fpcw-node.fpcw-search-match > .fpcw-row .atomic-category__list__name {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fpcw-node[hidden] {
    display: none !important;
}

.fpcw-no-results {
    padding: 0.5rem 0.2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.fpcw-row.layout-card--image {
    margin-bottom: 0.35rem;
}

.fpcw-row.layout-card--image .atomic-category__list__link {
    gap: 0.55rem;
    padding: 0.35rem 0.45rem;
    min-height: 48px;
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 6%, transparent);
    border-radius: 4px;
}

.fpcw-row.layout-card--image .atomic-category__list__link:hover {
    background: color-mix(in srgb, var(--fpcw-chrome, #fff) 10%, transparent);
}

.layout-card--image-img {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-card--image-img .fpcw-cat-thumb,
.layout-card--image-img img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* Prevent theme WooCommerce product-card styles from affecting tree rows. */
.fpcw-tree .fpcw-node {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.product-category-sticky::-webkit-scrollbar-track {
    border-radius: 10px;
}

.product-category-sticky::-webkit-scrollbar {
    width: 10px;
    background-color: transparent;
}

.product-category-sticky::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--fpcw-chrome, #fff) 25%, transparent);
}

.button-toggle-woo-category.layout_right {
    right: 0;
    transform: rotate(90deg) translate(0, -45px);
}

.product-category-sticky.layout_right {
    right: 0 !important;
    left: auto !important;
}

.button-toggle-woo-category.layout_left {
    left: 0;
}

@media (min-width: 769px) {
    .fpcw-backdrop {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .product-category-sticky {
        max-width: min(280px, 94vw);
        min-width: 0;
    }

    .fpcw-backdrop.is-visible {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-category-sticky,
    .button-toggle-woo-category,
    .fpcw-backdrop,
    .fpcw-toggle::before {
        transition: none;
    }
}


/* ============================================================
   Featured category strip (curation)
   ============================================================ */

.fpcw-term-section--featured .fpcw-term-section__heading {
    color: inherit;
}

.fpcw-featured-star {
    color: #f5c518;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fpcw-node--featured > .fpcw-row .atomic-category__list__link {
    background: rgba(245, 197, 24, 0.08);
    border-radius: 4px;
}

.fpcw-node--featured > .fpcw-row .atomic-category__list__link:hover {
    background: rgba(245, 197, 24, 0.16);
}
