/* =======================================================================
   FILTER PANEL v2 - Side Panel (Slides from Right)
   Clean, minimal, mobile-friendly
   ======================================================================= */

/* =======================================================================
   CONTAINER v2 - Override all old styles
   ======================================================================= */
.ssf-container.ssf-container--v2,
.woocommerce .ssf-container.ssf-container--v2,
.content .ssf-container.ssf-container--v2,
body .ssf-container.ssf-container--v2 {
    margin: 0 !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.5rem !important; /* Tighter - less gap before products */
    padding: 0 !important;
    background: none !important;
}

/* Breadcrumbs - Compact but visible */
.ssf-container--v2 .ssf-breadcrumb {
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13px;
}

/* Archive intro shown directly under breadcrumbs */
.ssf-archive-intro-slot {
    margin: 0 0 0.35rem 0;
}

.ssf-archive-intro {
    padding: 0.7rem 0.85rem;
    border: 1px solid #d0ddd8;
    border-radius: 8px;
    background: #f5f9f6;
    color: #1f2b1f;
}

.ssf-archive-intro__title {
    margin: 0 0 0.35rem 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.ssf-archive-intro__content {
    font-size: 14px;
    line-height: 1.55;
}

.ssf-archive-intro__content p:last-child {
    margin-bottom: 0;
}

/* Collapsible archive intro: header row (category name + "Why it matters" button) */
.ssf-archive-intro__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ssf-archive-intro__heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ssf-archive-intro__icon {
    flex-shrink: 0;
}

.ssf-archive-intro__icon .category-icon {
    display: flex;
}

.ssf-archive-intro__icon .category-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.ssf-archive-intro__heading-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ssf-archive-intro__title,
.ssf-archive-intro__header .archive-intro-collapsible__category-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.ssf-archive-intro__subtitle {
    font-size: 12.5px;
    color: #4f5f55;
    line-height: 1.3;
    font-weight: 400;
}

.ssf-archive-intro__toggle,
.archive-intro-collapsible__trigger {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 14px;
    font-weight: 600;
    color: #2b5735;
    background: #e4f4ea;
    border: 1px solid #b8d8c4;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ssf-archive-intro__toggle::after,
.ssf-archive-intro--collapsible .archive-intro-collapsible__trigger::after {
    content: " ▾";
    font-size: 0.85em;
    transition: transform 0.2s ease;
    display: inline-block;
}

.ssf-archive-intro--expanded .ssf-archive-intro__toggle::after,
.ssf-archive-intro--expanded .archive-intro-collapsible__trigger::after {
    content: " ▴";
}

.ssf-archive-intro__toggle:hover,
.archive-intro-collapsible__trigger:hover {
    background: #d4ecdb;
    border-color: #9dcbad;
}

/* Bottom close button — no ::after arrow since the label already has ▴ */
.archive-intro-collapsible__close {
    display: block;
    margin: 1rem auto 0;
    font-size: 13px;
    padding: 0.3rem 0.7rem;
}

.archive-intro-collapsible__close::after {
    content: none;
}

/* Collapse content by default at all screen sizes */
.ssf-archive-intro--collapsible .ssf-archive-intro__content.archive-intro-collapsible__content,
.archive-intro-collapsible .archive-intro-collapsible__content {
    display: none;
    margin-top: 0.5rem;
}

.ssf-archive-intro--collapsible.ssf-archive-intro--expanded .ssf-archive-intro__content.archive-intro-collapsible__content,
.archive-intro-collapsible--expanded .archive-intro-collapsible__content {
    display: block;
}

/* Desktop: bump icon size */
@media (min-width: 769px) {
    .ssf-archive-intro__icon .category-icon img {
        width: 80px;
        height: 80px;
    }
}

/* =======================================================================
   HOW WE CHOOSE - Fresh Produce structured layout
   ======================================================================= */

/* Two-column grid for skip/choose pairs */
.hwc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

@media (min-width: 769px) {
    .hwc-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
}

/* Individual pair card */
.hwc-pair {
    padding: 0.65rem 0.75rem;
    background: #fff;
    border: 1px solid #d0ddd8;
    border-radius: 6px;
}

.hwc-skip,
.hwc-choose {
    margin: 0 0 0.3rem 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.hwc-skip {
    color: #3a3a3a;
}

.hwc-choose {
    color: #1f4a42;
}

/* WE SKIP / WE CHOOSE inline labels */
.hwc-label {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: baseline;
    margin-right: 0.25rem;
}

.hwc-label--skip {
    background: #fdeae8;
    color: #9b3023;
}

.hwc-label--choose {
    background: #e4f4ea;
    color: #2b5735;
}

/* Explanatory note below the pair */
.hwc-note {
    margin: 0.4rem 0 0 0;
    font-size: 12px;
    color: #5a6e62;
    line-height: 1.45;
    font-style: italic;
}

/* Ultra-seasonal info box */
.hwc-seasonal-box {
    border: 1px solid #d0ddd8;
    border-radius: 8px;
    padding: 0.65rem 0.85rem 1.1rem;
    margin-bottom: 0.65rem;
    background: #fff;
}

.hwc-seasonal-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f4a42;
    margin: 0 0 0.4rem 0;
}

.hwc-seasonal-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 13px;
    line-height: 1.55;
    color: #1f2b1f;
}

.hwc-seasonal-list li {
    margin-bottom: 0.35rem;
}

.hwc-seasonal-list li:last-child {
    margin-bottom: 0;
}

.hwc-seasonal-list li strong {
    color: #1f4a42;
}

/* Footer link */
.hwc-footer {
    font-size: 12.5px;
    color: #5a6e62;
    margin: 0;
    font-style: italic;
}

.hwc-footer a {
    color: #2c5e54;
    text-decoration: underline;
}

.hwc-footer a:hover {
    color: #1f4a42;
}

/* =======================================================================
   FILTER BAR - Compact inline bar
   ======================================================================= */
.ssf-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Tighter gap */
    padding: 0.25rem 0 0.5rem 0; /* Minimal padding */
    flex-wrap: wrap;
}

/* Filter Toggle Button - Small and subtle */
.ssf-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: #f5f9f6;
    border: 1.5px solid #a5ccbc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #2c5e54;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ssf-filter-toggle:hover {
    background: rgba(191, 226, 220, 0.25);
    border-color: #2c5e54;
}

.ssf-filter-toggle[aria-expanded="true"] {
    background: linear-gradient(135deg, #d7edf7, #bfe2dc);
    border-color: #2c5e54;
    color: #0f4c3a;
}

.ssf-filter-toggle svg {
    opacity: 0.7;
}

/* Shipping Filter - Always visible, inline */
.ssf-shipping-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: #fff8e6;
    border: 1px solid #f0e0a0;
    border-radius: 5px;
    font-size: 12px;
    color: #665520;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ssf-shipping-filter:hover {
    background: #fff3d0;
}

.ssf-shipping-filter input {
    margin: 0;
    cursor: pointer;
}

.ssf-shipping-filter__text {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ssf-shipping-filter__text svg {
    opacity: 0.6;
}

/* Results count */
.ssf-results-count {
    font-size: 13px;
    color: #666;
    margin-left: auto;
}

.ssf-scoped-search-context {
    display: none;
    font-size: 12px;
    color: #476153;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(100%, 420px);
}

.ssf-scoped-search-context.is-active {
    display: inline-block;
}

/* =======================================================================
   FILTER PANEL - Slides in from right
   ======================================================================= */
.ssf-filter-panel,
body .ssf-filter-panel,
.woocommerce .ssf-filter-panel,
#page .ssf-filter-panel {
    position: fixed !important;
    top: var(--ssf-panel-top, 140px) !important; /* Aligned with breadcrumbs */
    right: 0 !important;
    width: 280px;
    max-width: 85vw;
    height: calc(100vh - var(--ssf-panel-top, 140px)) !important;
    height: calc(100dvh - var(--ssf-panel-top, 140px)) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 50001 !important; /* Above search dropdowns (9999), below mega menu (99999) */
    isolation: isolate !important; /* Create new stacking context */
    overflow: hidden !important;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    opacity: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 
 * Fix hearts/subtotals appearing over the filter panel.
 * 
 * The root cause: Product cards with position:relative + z-index create their own 
 * stacking contexts. Children (like hearts with z-index:10) then compete within 
 * that local context, not with the fixed-position panel/overlay.
 * 
 * Solution: Reset stacking context ONLY on the product card containers (not their
 * children). This way hearts keep their z-index:10 to stay above product images,
 * but the cards don't create isolated stacking contexts that compete with the overlay.
 */

/* Reset stacking context on product card containers only */
body.ssf-panel-open .woocommerce ul.products li.product,
body.ssf-panel-open .products li.product,
body.ssf-panel-open ul.products li.product {
    z-index: auto !important;
    isolation: auto !important;
}

/* Reset any wrapper elements that might create stacking contexts */
body.ssf-panel-open .mlvf-image-wrapper,
body.ssf-panel-open .mlvf-simple-overlay {
    z-index: auto !important;
}

/* Ensure overlay covers everything */
.ssf-filter-overlay--visible {
    z-index: 50000 !important;
}

.ssf-filter-panel.ssf-filter-panel--open {
    transform: translateX(0);
}

/* Panel Header (fixed at top via flex) */
.ssf-filter-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.ssf-filter-panel__title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.ssf-filter-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.ssf-filter-panel__close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Overlay behind panel */
.ssf-filter-overlay {
    position: fixed;
    top: var(--ssf-panel-top, 140px);
    left: 0;
    width: 100%;
    height: calc(100% - var(--ssf-panel-top, 140px));
    background: rgba(0, 0, 0, 0.3);
    z-index: 50000 !important; /* Just below panel (50001) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ssf-filter-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* =======================================================================
   SCROLLABLE CONTENT AREA
   ======================================================================= */
.ssf-filter-panel__content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Empty state message */
.ssf-filter-section--empty {
    padding: 1.5rem 1rem;
}

.ssf-no-filters-message {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    text-align: center;
    font-style: italic;
}

/* =======================================================================
   FILTER SECTIONS
   ======================================================================= */
.ssf-filter-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.ssf-filter-section__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 0.5rem 0;
}

/* =======================================================================
   CATEGORY TREE - Icon-button style (matches mega menu)
   ======================================================================= */
.ssf-category-tree {
    font-size: 13px;
    line-height: 1.3;
}

.ssf-category-tree__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

/* Indent nested levels */
.ssf-category-tree__level-1 { padding-left: 8px; }
.ssf-category-tree__level-2 { padding-left: 8px; }
.ssf-category-tree__level-3 { padding-left: 8px; }

.ssf-category-tree__item {
    margin: 0;
    padding: 0;
}

.ssf-category-tree__row {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
}

/* Toggle button - chevron sits beside the button */
.ssf-category-tree__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    background: none;
    border: none;
    cursor: pointer;
    color: #4a6a60;
    padding: 0;
    flex-shrink: 0;
    border-radius: 6px 0 0 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.ssf-category-tree__toggle:hover {
    color: #1f4a42;
    background: rgba(31, 74, 66, 0.06);
}

.ssf-category-tree__toggle[aria-expanded="true"] {
    color: #1f4a42;
}

.ssf-category-tree__toggle[aria-expanded="true"] svg {
    transform: rotate(90deg);
}

.ssf-category-tree__toggle svg {
    transition: transform 0.15s ease;
    width: 10px;
    height: 10px;
}

.ssf-category-tree__spacer {
    width: 22px;
    flex-shrink: 0;
}

/* Category link - button style matching mega menu */
.ssf-category-tree__link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #1f4a42;
    text-decoration: none;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(31, 74, 66, 0.1);
    background: #f7faf9;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    overflow: visible;
    min-height: 34px;
}

/* When toggle is present, remove left border-radius */
.ssf-category-tree__item--has-children > .ssf-category-tree__row > .ssf-category-tree__link {
    border-radius: 0 8px 8px 0;
}

.ssf-category-tree__link:hover {
    background: #e8f0f1;
    border-color: rgba(31, 74, 66, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(20, 51, 45, 0.08);
}

/* Icon inside the link */
.ssf-category-tree__link .category-icon--small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
}

.ssf-category-tree__link .category-icon--small svg,
.ssf-category-tree__link .category-icon--small img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Label text */
.ssf-category-tree__label {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Current category */
.ssf-category-tree__item--current > .ssf-category-tree__row > .ssf-category-tree__link {
    background: #e5eeeb;
    border-color: #3d6b62;
    color: #1f4a42;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(20, 51, 45, 0.1);
}

/* Ancestor in path */
.ssf-category-tree__item--ancestor > .ssf-category-tree__row > .ssf-category-tree__link {
    color: #1f4a42;
    font-weight: 600;
    border-color: rgba(31, 74, 66, 0.18);
    background: #edf3f1;
}

/* Product count */
.ssf-category-tree__count {
    font-size: 11px;
    color: #4a6a60;
    margin-left: auto;
    flex-shrink: 0;
    font-weight: 400;
}

/* Smooth expand animation */
.ssf-category-tree__children {
    overflow: hidden;
    transition: max-height 0.2s ease;
    padding-top: 4px;
}

/* =======================================================================
   SCOPED SEARCH - Search within current filter context
   ======================================================================= */
.ssf-panel-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ssf-panel-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    color: #222;
    background: #fff;
}

.ssf-panel-search-input::placeholder {
    color: #999;
    font-style: italic;
    opacity: 1;
}

.ssf-panel-search-input:focus {
    outline: none;
    border-color: #86b29a;
    box-shadow: 0 0 0 2px rgba(134, 178, 154, 0.18);
}

.ssf-panel-search-clear {
    flex-shrink: 0;
    border: 1px solid #d8d8d8;
    background: #f7f7f7;
    color: #444;
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.ssf-panel-search-clear:hover {
    background: #efefef;
}

.ssf-search-fallback {
    margin: 0.45rem 0 0;
    font-size: 14px;
}

.ssf-search-fallback a {
    color: #2d4a35;
    text-decoration: underline;
}

/* =======================================================================
   SORT SECTION - Sorting dropdown inside panel
   ======================================================================= */
.ssf-filter-section--sort .woocommerce-ordering {
    margin: 0 !important;
    float: none !important;
}

.ssf-filter-section--sort .woocommerce-ordering label {
    display: none;
}

.ssf-filter-section--sort .woocommerce-ordering select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    font-size: 13px;
    font-family: brandon-grotesque, sans-serif;
    color: #222;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}

.ssf-filter-section--sort .woocommerce-ordering select:focus {
    outline: none;
    border-color: #86b29a;
    box-shadow: 0 0 0 2px rgba(134, 178, 154, 0.18);
}

/* =======================================================================
   FILTER OPTIONS - Compact checkboxes
   ======================================================================= */
.ssf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ssf-filter-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.ssf-filter-option:hover {
    background: #f5f5f5;
}

.ssf-filter-option input {
    margin: 0;
    cursor: pointer;
}

.ssf-filter-option img {
    opacity: 0.8;
}

.ssf-filter-option span {
    font-size: 13px;
    color: #333;
}

/* =======================================================================
   PANEL FOOTER - Done button (ALWAYS visible at bottom via flex)
   ======================================================================= */
.ssf-filter-panel__footer,
body .ssf-filter-panel__footer,
.ssf-filter-panel .ssf-filter-panel__footer {
    padding: 0.75rem 1rem;
    background: #fff !important;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.ssf-filter-panel__apply {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #2d4a35;
    color: #f4fff9 !important;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ssf-filter-panel__apply:hover {
    background: #3d5a45;
    color: #f4fff9 !important;
}

/* =======================================================================
   MOBILE RESPONSIVE
   ======================================================================= */
@media (max-width: 768px) {
    .ssf-filter-panel,
    body .ssf-filter-panel {
        width: 260px;
    }
}

@media (max-width: 480px) {
    .ssf-filter-panel,
    body .ssf-filter-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .ssf-filter-bar {
        gap: 0.5rem;
    }
    
    .ssf-shipping-filter {
        font-size: 12px;
        padding: 0.3rem 0.5rem;
    }
    
    .ssf-results-count {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* =======================================================================
   BODY SCROLL LOCK when panel open
   ======================================================================= */
body.ssf-panel-open {
    overflow: hidden;
}

/* =======================================================================
   SEARCH RESULTS BANNER
   ======================================================================= */
.ssf-search-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--ssf-light-mint) 0%, var(--ssf-hover-mint) 100%);
    border: 1px solid var(--ssf-active-sage);
    border-radius: 6px;
    font-size: 14px;
}

.ssf-search-banner__text {
    color: var(--ssf-text-dark);
}

.ssf-search-banner__text strong {
    color: #2d4a35;
}

.ssf-search-banner__correction {
    display: inline-block;
    margin-left: 0.35rem;
    color: var(--ssf-text-soft);
    font-size: 12px;
}

.ssf-search-banner__clear {
    color: var(--ssf-text-soft);
    text-decoration: none;
    font-size: 12px;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.ssf-search-banner__clear:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ssf-text-dark);
}

/* Search filter link styling */
.ssf-search-filter-link {
    cursor: pointer;
}

.ssf-search-filter-link:hover {
    background: #e8f5f2 !important;
}

.ssf-search-filter-link.ssf-category-tree__link--active,
.ssf-category-tree__link--active {
    background: #c8e3db !important;
    color: #2d4a35 !important;
    font-weight: 600;
}

/* =======================================================================
   HERBAL FILTER OPTIONS - Flavor & Body System Filters
   ======================================================================= */
.ssf-herbal-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ssf-herbal-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ssf-herbal-option:hover {
    background: #e8f5f2;
    border-color: #c8e3db;
}

.ssf-herbal-option input[type="checkbox"] {
    display: none;
}

.ssf-herbal-option input[type="checkbox"]:checked + .ssf-herbal-icon,
.ssf-herbal-option input[type="checkbox"]:checked ~ span {
    font-weight: 600;
}

.ssf-herbal-option:has(input:checked) {
    background: #c8e3db;
    border-color: #2d4a35;
}

.ssf-herbal-icon {
    font-size: 16px;
    line-height: 1;
}

.ssf-filter-count {
    font-size: 11px;
    color: #888;
    margin-left: 0.15rem;
}

/* =======================================================================
   COLOR FILTER SWATCHES
   ======================================================================= */
.ssf-color-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ssf-color-filter-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.3rem 0.55rem 0.3rem 0.35rem;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-size: 12px;
    line-height: 1;
}

.ssf-color-filter-option:hover {
    border-color: #999;
}

.ssf-color-filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ssf-color-filter-option:has(input:checked) {
    border-color: #333;
    box-shadow: 0 0 0 1.5px #333;
}

.ssf-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.ssf-color-swatch--light {
    border-color: rgba(0, 0, 0, 0.25);
}

.ssf-color-label {
    white-space: nowrap;
    color: #333;
}

/* Section titles for herbal filters */
.ssf-filter-section__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #eee;
}

/* =======================================================================
   NARROW-BY SECTION — surfaces child subcategories of the active pill
   when deeper filtering is available. Sits at the top of the panel so
   it's the first thing shoppers see when they open Filter & Sort after
   selecting a parent-with-children like "Apothecary-style Herbs".
   ======================================================================= */
.ssf-filter-section--narrow-by {
    background: #eef6f2;
    border-left: 3px solid #5a8770;
    border-radius: 6px;
    padding: 0.85rem 0.95rem !important;
    margin-bottom: 1rem !important;
}

.ssf-filter-section--narrow-by .ssf-filter-section__title {
    color: #2c5e54;
    border-bottom: none;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ssf-narrow-by__prefix {
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.72rem;
    opacity: 0.75;
}

.ssf-narrow-by__parent-name {
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    font-size: 0.95rem;
    color: #1a3328;
}

.ssf-narrow-by__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.ssf-narrow-by__chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: #fff;
    border: 1px solid #c8d9cf;
    border-radius: 999px;
    color: #1a3328;
    font-family: brandon-grotesque, sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ssf-narrow-by__chip:hover,
.ssf-narrow-by__chip:focus-visible {
    background: #d9ebe2;
    border-color: #5a8770;
    outline: none;
    box-shadow: 0 1px 3px rgba(26, 51, 40, 0.08);
}

.ssf-narrow-by__chip.active {
    background: #5a8770;
    border-color: #476a58;
    color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ssf-narrow-by__chip.active:hover {
    background: #476a58;
    color: #fff;
}

.ssf-narrow-by__chip-label {
    line-height: 1.2;
}

.ssf-narrow-by__loading,
.ssf-narrow-by__empty,
.ssf-narrow-by__error {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0;
    padding: 0.35rem 0;
}

.ssf-narrow-by__error {
    color: #a84040;
}

/* =======================================================================
   FILTER & SORT TOGGLE — accent state when active pill has children.
   Added by JS via .ssf-filter-toggle--has-narrow when revealNarrowBy()
   fires; removed by hideNarrowBy().
   ======================================================================= */
.ssf-filter-toggle--has-narrow {
    background: #eef6f2 !important;
    border-color: #5a8770 !important;
    color: #1a3328 !important;
    box-shadow: 0 0 0 2px rgba(90, 135, 112, 0.15);
}

.ssf-filter-toggle--has-narrow::after {
    content: ' · + narrow further';
    font-size: 0.78em;
    font-weight: 600;
    font-style: italic;
    color: #2c5e54;
    margin-left: 0.25rem;
    letter-spacing: 0.01em;
}

/* Tighter accent text on narrow mobile — just the dot + "filter deeper" */
@media (max-width: 480px) {
    .ssf-filter-toggle--has-narrow::after {
        content: ' · deeper';
        font-size: 0.82em;
    }
}
