/* =========================================================
   Faux Fur Finder

   ========================================================= */


/* =========================================================
   BASE
   ========================================================= */

.ffb-browser {
    --ffb-font-heading: 'Mochiy Pop P One', sans-serif;
    --ffb-font-body: 'Nunito Sans', sans-serif;

    width: 100%;
    max-width: 100%;

    overflow-x: hidden;

    box-sizing: border-box;

    font-family: var(--ffb-font-body);
}

.ffb-browser *,
.ffb-browser *::before,
.ffb-browser *::after {
    box-sizing: border-box;
}


/* =========================================================
   HEADER
   ========================================================= */


/* =========================================================
   SEARCH
   ========================================================= */

.ffb-search {
    width: 100%;
    margin-bottom: 20px;
}

.ffb-search-input {
    display: block;

    width: 100%;
    min-height: 48px;

    padding: 12px 15px;

    border: 1px solid #ccc;
    border-radius: 8px;

    background: #fff;
    color: #222;

    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ffb-search-input::placeholder {
    color: #888;
}

.ffb-search-input:hover {
    border-color: #999;
}

.ffb-search-input:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   SORT
   ========================================================= */

.ffb-sort {
    display: flex;

    align-items: center;
    flex-wrap: wrap;

    gap: 10px 20px;

    margin-bottom: 20px;
}

.ffb-sort .ffb-filter-label {
    flex: 0 0 auto;

    margin: 0;
}

.ffb-sort-select {
    min-height: 42px;

    padding: 8px 12px;

    border: 1px solid #ccc;
    border-radius: 7px;

    background: #fff;
    color: #222;

    font-family: inherit;
    font-size: 14px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ffb-sort-select:hover {
    border-color: #999;
}

.ffb-sort-select:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


.ffb-discontinued-toggle {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-left: auto;

    color: #555;

    font-size: 13px;

    cursor: pointer;

    user-select: none;
}

.ffb-discontinued-checkbox {
    width: 16px;
    height: 16px;

    margin: 0;

    cursor: pointer;
}


/* =========================================================
   FILTER GRID
   ========================================================= */

.ffb-filters {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(180px, 1fr));

    gap: 16px;

    width: 100%;

    margin-bottom: 20px;
}


/* =========================================================
   FILTER
   ========================================================= */

.ffb-filter {
    position: relative;

    min-width: 0;
}

.ffb-filter-label {
    display: block;

    margin-bottom: 7px;

    color: #333;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}


/* ---------------------------------------------------------
   Filter label row (label + currency toggle)
   --------------------------------------------------------- */

.ffb-filter-label-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 7px;
}

.ffb-filter-label-row .ffb-filter-label {
    margin-bottom: 0;
}

.ffb-currency-toggle,
.ffb-unit-toggle {
    min-height: 28px;

    padding: 3px 8px;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;
    color: #333;

    font-family: var(--ffb-font-heading);
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ffb-currency-toggle:hover,
.ffb-unit-toggle:hover {
    border-color: #999;
}

.ffb-currency-toggle:focus,
.ffb-unit-toggle:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   CUSTOM MULTI-SELECT
   ========================================================= */

.ffb-custom-filter {
    position: relative;

    width: 100%;
}


/* ---------------------------------------------------------
   Dropdown Button
   --------------------------------------------------------- */

.ffb-custom-filter-button {
    display: flex;

    align-items: center;

    width: 100%;
    min-height: 44px;

    padding: 10px 12px;

    border: 1px solid #ccc;
    border-radius: 7px;

    background: #fff;
    color: #222;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;

    text-align: left;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.ffb-custom-filter-button:hover {
    border-color: #999;
}

.ffb-custom-filter-button:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}


/* ---------------------------------------------------------
   Filter Name
   --------------------------------------------------------- */

.ffb-custom-filter-label {
    flex: 0 0 auto;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   Selected Values
   --------------------------------------------------------- */

.ffb-custom-filter-value {
    flex: 1 1 auto;

    min-width: 0;

    margin-left: 7px;

    color: #666;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.ffb-custom-filter.has-selection
.ffb-custom-filter-value {
    color: #222;
}


/* ---------------------------------------------------------
   Dropdown Arrow
   --------------------------------------------------------- */

.ffb-custom-filter-arrow {
    flex: 0 0 auto;

    margin-left: 8px;

    color: #666;

    font-size: 10px;

    transition:
        transform 0.2s ease;
}

.ffb-custom-filter.is-open
.ffb-custom-filter-arrow {
    transform: rotate(180deg);
}


/* ---------------------------------------------------------
   Dropdown Panel
   --------------------------------------------------------- */

.ffb-custom-filter-dropdown {
    position: absolute;

    z-index: 1000;

    top: calc(100% + 6px);
    left: 0;

    width: 100%;
    max-height: 280px;

    overflow-y: auto;

    padding: 7px;

    border: 1px solid #ccc;
    border-radius: 8px;

    background: #fff;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.14);
}


/* ---------------------------------------------------------
   Dropdown Options
   --------------------------------------------------------- */

.ffb-custom-filter-option {
    display: flex;

    align-items: center;

    width: 100%;

    margin: 0;
    padding: 8px 9px;

    border-radius: 5px;

    color: #333;

    font-size: 14px;
    line-height: 1.4;

    cursor: pointer;

    transition:
        background 0.15s ease;
}

.ffb-custom-filter-option:hover {
    background: #f3f3f3;
}


/* ---------------------------------------------------------
   Checkbox
   --------------------------------------------------------- */

.ffb-custom-filter-option input[type="checkbox"] {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    margin: 0 9px 0 0;

    cursor: pointer;
}


/* =========================================================
   RANGE FILTERS (SLIDER)
   ========================================================= */

.ffb-filter-range {
    min-width: 0;
}

.ffb-slider {
    position: relative;

    width: 100%;

    /* extra top padding so thumbs don't get clipped */
    padding-top: 6px;
}

.ffb-slider-track {
    position: relative;

    height: 4px;

    margin: 18px 10px 0;

    border-radius: 3px;

    background: #ddd;
}

.ffb-slider-track-fill {
    position: absolute;

    top: 0;
    bottom: 0;

    border-radius: 3px;

    background: #333;
}

/*
 * Two overlapping range inputs create the dual-handle
 * effect. Each is transparent except for its thumb, and
 * pointer-events are limited to the thumb itself so the
 * two sliders don't fight over clicks along the track.
 */
.ffb-slider-thumb {
    position: absolute;

    top: 12px;
    left: 10px;

    width: calc(100% - 20px);

    margin: 0;

    -webkit-appearance: none;
    appearance: none;

    background: transparent;

    pointer-events: none;
}

.ffb-slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 18px;
    height: 18px;

    border: 2px solid #333;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
    pointer-events: all;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ffb-slider-thumb::-moz-range-thumb {
    width: 18px;
    height: 18px;

    border: 2px solid #333;
    border-radius: 50%;

    background: #fff;

    cursor: pointer;
    pointer-events: all;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.ffb-slider-thumb::-webkit-slider-runnable-track {
    background: transparent;
}

.ffb-slider-thumb::-moz-range-track {
    background: transparent;
}

.ffb-slider-thumb:focus {
    outline: none;
}

.ffb-slider-thumb:focus::-webkit-slider-thumb {
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.15);
}

.ffb-slider-thumb:focus::-moz-range-thumb {
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.15);
}


/* Min/max labels under each end of the track */

.ffb-slider-bounds {
    display: flex;

    justify-content: space-between;

    margin-top: 10px;

    color: #777;

    font-size: 12px;
}


/* Current selected range — editable min/max boxes */

.ffb-slider-value {
    display: flex;

    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: 6px;

    padding: 6px 10px;

    border: 1px solid #ddd;
    border-radius: 7px;

    background: #f7f7f7;
    color: #222;

    font-size: 13px;
    text-align: center;
}

.ffb-slider-number {
    width: 72px;
    min-width: 0;
    min-height: 30px;

    padding: 4px 6px;

    border: 1px solid #ccc;
    border-radius: 5px;

    background: #fff;
    color: #222;

    font-family: inherit;
    font-size: 13px;
    text-align: center;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.ffb-slider-number:hover {
    border-color: #999;
}

.ffb-slider-number:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Remove number input arrows for a cleaner look */

.ffb-slider-number::-webkit-inner-spin-button,
.ffb-slider-number::-webkit-outer-spin-button {
    margin: 0;
}


/* =========================================================
   CLEAR FILTERS
   ========================================================= */

.ffb-clear-filters {
    align-self: end;

    min-height: 42px;

    padding: 10px 18px;

    border: 1px solid #333;
    border-radius: 7px;

    background: #333;
    color: #fff;

    font-family: var(--ffb-font-heading);
    font-size: 15px;
    font-weight: 400;

    line-height: 1.4;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.1s ease;
}

.ffb-clear-filters:hover {
    background: #222;

    border-color: #222;
}

.ffb-clear-filters:active {
    transform: translateY(1px);
}

.ffb-clear-filters:focus {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   RESULT COUNT
   ========================================================= */

.ffb-result-count {
    margin: 10px 0 20px;

    color: #555;

    font-size: 14px;
    line-height: 1.5;
}

.ffb-visible-count,
.ffb-total-count {
    color: #222;
}


/* =========================================================
   CARD GRID
   ========================================================= */

.ffb-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(min(100%, 280px), 1fr));

    gap: 24px;

    width: 100%;
}


@media (min-width: 1100px) {

    .ffb-grid {

        grid-template-columns:
            repeat(4, 1fr);

    }

}


/* =========================================================
   CARD
   ========================================================= */

.ffb-card {
    display: flex;

    flex-direction: column;

    min-width: 0;

    overflow: hidden;

    background: #fff;

    border: 1px solid #e2e2e2;
    border-radius: 12px;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.ffb-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   CARD IMAGE
   ========================================================= */

.ffb-card-image-wrap {
    position: relative;

    display: block;

    width: 100%;

    margin: 0;
    padding: 0;

    border: 0;

    cursor: pointer;

    /* Reset default <button> appearance */
    background: transparent;

    font: inherit;

    transition: opacity 0.2s ease;
}

.ffb-card-image-wrap:hover {
    opacity: 0.92;
}

.ffb-card-image-wrap:focus {
    outline: none;

    box-shadow:
        inset 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.ffb-card-cover {
    display: block;

    width: 100%;

    aspect-ratio: 4 / 3;

    object-fit: cover;

    background: #f5f5f5;
}

.ffb-card-swatch {
    position: absolute;

    right: 10px;
    bottom: 10px;

    width: 26px;
    height: 26px;

    border: 2px solid #fff;
    border-radius: 50%;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.35);
}

.ffb-discontinued-badge {
    position: absolute;

    top: 10px;
    left: 10px;

    padding: 4px 10px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.75);
    color: #fff;

    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}


.ffb-card-discontinued {
    opacity: 0.65;
}

.ffb-card-discontinued .ffb-card-cover {
    filter: grayscale(35%);
}


/* =========================================================
   CARD CONTENT
   ========================================================= */

.ffb-card-content {
    display: flex;

    flex-direction: column;

    padding: 18px;
}


/* =========================================================
   CARD TITLE
   ========================================================= */

.ffb-card-title {
    margin: 0 0 8px;

    color: #222;

    font-family: var(--ffb-font-heading);
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 400;

    line-height: 1.3;
}


/* =========================================================
   CARD QUICK META
   ========================================================= */

.ffb-card-quick-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin: 0 0 14px;

    color: #555;

    font-size: 13px;
}

.ffb-card-quick-item {
    padding: 3px 9px;

    border-radius: 20px;

    background: #f2f2f2;
}


.ffb-card-details-data {
    display: none;
}


/* =========================================================
   DETAIL FIELDS
   ========================================================= */

.ffb-field {
    margin: 0 0 9px;

    color: #444;

    font-size: 14px;

    line-height: 1.45;
}

.ffb-field:last-child {
    margin-bottom: 14px;
}

.ffb-field strong {
    color: #222;

    font-weight: 600;
}


/* =========================================================
   PRODUCT BUTTON
   ========================================================= */

.ffb-product-links {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 12px;
}

.ffb-product-links .ffb-product-button {
    margin-top: 0;
}

.ffb-product-button {
    display: inline-block;

    width: 100%;

    margin-top: 12px;

    padding: 10px 16px;

    border: 0;
    border-radius: 6px;

    background: #333;
    color: #fff;

    font-family: var(--ffb-font-heading);
    font-size: 15px;
    font-weight: 400;

    line-height: 1.4;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        opacity 0.2s ease;
}

.ffb-product-button:hover {
    background: #222;

    color: #fff;

    opacity: 0.95;
}

.ffb-product-button,
.ffb-fabric-modal-product-link {
    background: var(--ffb-vendor-bg, #333);
    color: var(--ffb-vendor-fg, #fff);
}

.ffb-product-button:hover,
.ffb-fabric-modal-product-link:hover {
    background: var(--ffb-vendor-bg, #222);
    color: var(--ffb-vendor-fg, #fff);
    filter: brightness(0.88);
}

.ffb-product-button {
    white-space: normal;
    overflow-wrap: anywhere;
}

.ffb-product-button:focus {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   HIDDEN FILTER DATA
   ========================================================= */

.ffb-card-filter-data {
    display: none !important;
}


/* =========================================================
   NO RESULTS
   ========================================================= */

.ffb-no-results {
    display: none;

    width: 100%;

    margin-top: 25px;

    padding: 25px 20px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: #fafafa;

    color: #555;

    font-size: 15px;

    line-height: 1.5;

    text-align: center;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.ffb-pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 18px;

    margin-top: 32px;
}

.ffb-pagination[hidden] {
    display: none;
}

.ffb-pagination-prev,
.ffb-pagination-next {
    padding: 10px 20px;

    border: 1px solid #ccc;
    border-radius: 7px;

    background: #fff;
    color: #222;

    font-family: var(--ffb-font-heading);
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.ffb-pagination-prev:hover,
.ffb-pagination-next:hover {
    border-color: #999;
}

.ffb-pagination-prev:disabled,
.ffb-pagination-next:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}

.ffb-pagination-status {
    color: #555;

    font-size: 14px;
}

.ffb-pagination-current,
.ffb-pagination-total {
    font-weight: 600;

    color: #222;
}


/* =========================================================
   FABRIC MODAL (details + similar colors popup)
   ========================================================= */

.ffb-fabric-modal {
    position: fixed;
    z-index: 9999;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 24px;
}

.ffb-fabric-modal[aria-hidden="true"] {
    display: none;
}

.ffb-fabric-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.55);
}

.ffb-fabric-modal-panel {
    position: relative;

    width: 100%;
    max-width: 900px;
    max-height: 88vh;

    overflow-y: auto;

    padding: 28px;

    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);
}

.ffb-fabric-modal-close {
    position: absolute;
    z-index: 2;

    top: 14px;
    right: 14px;

    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    background: #f2f2f2;
    color: #222;

    font-size: 20px;
    line-height: 1;

    cursor: pointer;

    transition: background 0.2s ease;
}

.ffb-fabric-modal-close:hover {
    background: #e2e2e2;
}

.ffb-fabric-modal-close:focus {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.15);
}


/* ---------------------------------------------------------
   Media + info layout
   --------------------------------------------------------- */

.ffb-fabric-modal-body {
    display: grid;

    grid-template-columns: minmax(0, 1fr);

    gap: 24px;

    margin-bottom: 28px;
}

@media (min-width: 640px) {

    .ffb-fabric-modal-body {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

}

.ffb-fabric-modal-media {
    position: relative;
}

.ffb-fabric-modal-image {
    display: block;

    width: 100%;

    border-radius: 10px;

    aspect-ratio: 4 / 3;

    object-fit: cover;

    background: #f5f5f5;
}

.ffb-fabric-modal-swatch {
    position: absolute;

    right: 12px;
    bottom: 12px;

    width: 34px;
    height: 34px;

    border: 2px solid #fff;
    border-radius: 50%;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.35);
}

.ffb-fabric-modal-badge {
    position: absolute;

    top: 12px;
    left: 12px;

    padding: 5px 12px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.75);
    color: #fff;

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ffb-fabric-modal-info {
    display: flex;

    flex-direction: column;
}

.ffb-fabric-modal-title {
    margin: 0 0 14px;

    color: #222;

    font-family: var(--ffb-font-heading);
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 400;

    line-height: 1.25;
}

.ffb-fabric-modal-details {
    margin-bottom: 16px;
}

.ffb-fabric-modal-product-links {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    align-self: flex-start;
}

.ffb-fabric-modal-product-links[hidden] {
    display: none;
}

.ffb-fabric-modal-product-link {
    align-self: flex-start;

    padding: 10px 18px;

    border: 1px solid #333;
    border-radius: 7px;

    background: #333;
    color: #fff;

    font-family: var(--ffb-font-heading);
    font-size: 15px;
    font-weight: 400;

    line-height: 1.4;

    text-decoration: none;

    transition: background 0.2s ease;
}

.ffb-fabric-modal-product-link:hover {
    background: #222;
}


/* ---------------------------------------------------------
   Similar colors section
   --------------------------------------------------------- */

.ffb-fabric-modal-similar {
    border-top: 1px solid #e5e5e5;

    padding-top: 22px;
}

.ffb-fabric-modal-similar-heading {
    margin: 0 0 16px;

    color: #222;

    font-family: var(--ffb-font-heading);
    font-size: 20px;
    font-weight: 400;
}

.ffb-fabric-modal-similar-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(110px, 1fr));

    gap: 14px;
}

.ffb-fabric-modal-similar-item {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 6px;

    margin: 0;
    padding: 8px;

    border: 1px solid #e5e5e5;
    border-radius: 10px;

    background: #fff;

    cursor: pointer;

    text-align: center;

    transition:
        border-color 0.2s ease,
        transform 0.15s ease;
}

.ffb-fabric-modal-similar-item:hover {
    border-color: #999;

    transform: translateY(-2px);
}

.ffb-fabric-modal-similar-item:focus {
    outline: none;

    border-color: #666;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.1);
}

.ffb-fabric-modal-similar-image {
    width: 100%;

    aspect-ratio: 1 / 1;

    border-radius: 6px;

    object-fit: cover;

    background: #f5f5f5;
}

.ffb-fabric-modal-similar-swatch {
    width: 18px;
    height: 18px;

    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
}

.ffb-fabric-modal-similar-name {
    color: #333;

    font-size: 12px;
    line-height: 1.3;
}

.ffb-fabric-modal-similar-item-discontinued {
    opacity: 0.65;
}

.ffb-fabric-modal-similar-item-discontinued
.ffb-fabric-modal-similar-image {
    filter: grayscale(35%);
}

.ffb-fabric-modal-similar-discontinued {
    padding: 2px 7px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.75);
    color: #fff;

    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ffb-fabric-modal-similar-empty {
    margin: 0;

    padding: 20px;

    border: 1px dashed #ddd;
    border-radius: 8px;

    background: #fafafa;
    color: #777;

    font-size: 14px;
    text-align: center;
}


body.ffb-modal-open {
    overflow: hidden;
}


/* =========================================================
   RESPONSIVE — LARGE TABLET
   ========================================================= */

@media (max-width: 1200px) {

    .ffb-filters {
        grid-template-columns:
            repeat(3, minmax(160px, 1fr));
    }

}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 900px) {

    .ffb-filters {
        grid-template-columns:
            repeat(2, minmax(160px, 1fr));
    }

}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .ffb-filters {
        grid-template-columns: 1fr;

        gap: 14px;
    }

    .ffb-grid {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .ffb-search-input {
        min-height: 46px;
    }

    .ffb-custom-filter-dropdown {
        max-height: 240px;
    }

    .ffb-clear-filters {
        width: 100%;
    }

    .ffb-card-content {
        padding: 16px;
    }

}


/* =========================================================
   RESPONSIVE — SMALL PHONE
   ========================================================= */

@media (max-width: 400px) {

    .ffb-card-title {
        font-size: 18px;
    }


}

.ffb-filters-top-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 4px;
}

.ffb-filters-search-row {
    flex: 0 1 70%;
    width: 70%;
    min-width: 0;
    margin-bottom: 0;
}

.ffb-filters-search-row .ffb-search-input {
    width: 100%;
}

.ffb-filters-top-row .ffb-result-count {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

/* Make the filter area feel like one contained control panel. */
.ffb-filters {
    position: relative;
    padding: 18px;
    border: 1.5px solid #d36bea;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow: 0 2px 10px rgba(150, 75, 190, 0.08);
    gap: 12px;
}

.ffb-filters {
    grid-template-columns:
        repeat(auto-fit, minmax(150px, 1fr));
}

/* Chip-style multi-selects */
.ffb-custom-filter-button {
    min-height: 48px;
    padding: 8px 13px;
    border: 1px solid #d9dbe8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #20284a;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(31, 37, 70, 0.03);
}

.ffb-custom-filter-button:hover {
    border-color: #c9a1dc;
}

.ffb-custom-filter.has-selection .ffb-custom-filter-button,
.ffb-custom-filter.is-active .ffb-custom-filter-button {
    border-color: #cf59e5;
    background: #f6d5ff;
    color: #7e2a9d;
    box-shadow: 0 0 0 2px rgba(207, 89, 229, 0.10);
}

.ffb-custom-filter.has-selection .ffb-custom-filter-value,
.ffb-custom-filter.is-active .ffb-custom-filter-value {
    color: #8d32aa;
    font-weight: 700;
}

.ffb-custom-filter-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ffb-custom-filter-value {
    flex: 0 0 auto;
    margin-left: 4px;
    color: #7b8097;
    font-weight: 600;
}

.ffb-custom-filter-arrow {
    margin-left: auto;
    color: #68708d;
    font-size: 11px;
}

/* More/Less Filters toggle lives in the box's bottom bar (left side). */
.ffb-more-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 2px;
    border: 0;
    background: transparent;
    color: #a42ac1;
    font-family: var(--ffb-font-heading);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.ffb-more-filters-toggle:hover {
    color: #7e208f;
}

.ffb-more-filters-chevron {
    font-size: 17px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ffb-more-filters-open .ffb-more-filters-chevron {
    transform: rotate(180deg);
}

/* Hidden until More Filters is opened. */
.ffb-filters .ffb-more-filter {
    display: none;
}

.ffb-filters.ffb-more-filters-open .ffb-more-filter {
    display: block;
}

.ffb-filters .ffb-filter-ranges-row > .ffb-filter-range.ffb-more-filter {
    display: none;
}

.ffb-filters.ffb-more-filters-open .ffb-filter-ranges-row > .ffb-filter-range.ffb-more-filter {
    display: flex;
}

.ffb-filter-ranges-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: start;
    gap: 16px;
    margin-top: 4px;
}

.ffb-filter-ranges-row > .ffb-filter-range {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Bottom bar: More/Less Filters (left) + Clear Filters (right). */
.ffb-filters-bottom-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #e7e4ef;
}

.ffb-filters-bottom-bar .ffb-clear-filters {
    min-height: 34px;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
}

/* Right side of the bottom bar: Discontinued switch, then Clear Filters. */
.ffb-filters-bottom-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ffb-below-filters-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 16px 0 20px;
}

/* Active numeric filters use the same highlighted border language. */
.ffb-filter-range {
    padding: 12px 14px 10px;
    border: 1px solid #e7e4ef;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.ffb-filter-range.is-active {
    border-color: #cf59e5;
    box-shadow: 0 0 0 2px rgba(207, 89, 229, 0.10);
}

.ffb-filter-label {
    margin-bottom: 9px;
    color: #20284a;
    font-size: 14px;
    font-weight: 600;
}

.ffb-filter-label-row {
    margin-bottom: 9px;
}

.ffb-currency-toggle,
.ffb-unit-toggle {
    min-height: 32px;
    border-color: #d9dbe8;
    border-radius: 8px;
    font-size: 12px;
}

/* One slider treatment for pile, price, and width. */
.ffb-slider-track {
    height: 5px;
    margin: 17px 10px 0;
    border-radius: 999px;
    background: #e3e0e8;
}

.ffb-slider-track-fill {
    background: #b84dd1;
}

.ffb-slider-thumb {
    top: 10px;
}

.ffb-slider-thumb::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #b84dd1;
    box-shadow: 0 1px 3px rgba(80, 40, 90, 0.18);
}

.ffb-slider-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 2px solid #b84dd1;
    box-shadow: 0 1px 3px rgba(80, 40, 90, 0.18);
}

.ffb-slider-bounds {
    margin-top: 9px;
    color: #74798e;
    font-size: 13px;
}

.ffb-slider-value {
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid #e3e0eb;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.7);
}

/* The discontinued switch also gets the active-filter treatment. */
.ffb-discontinued-toggle {
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
}

.ffb-discontinued-toggle.is-active {
    border-color: #cf59e5;
    background: #f6d5ff;
    color: #7e2a9d;
}

/* Keep the card's vendor links as the only vendor presentation. */
.ffb-card .ffb-field[data-field="vendor"],
.ffb-card .ffb-vendor-field {
    display: none;
}

@media (max-width: 1200px) {
    .ffb-filters {
        grid-template-columns:
            repeat(auto-fit, minmax(135px, 1fr));
    }
}

@media (max-width: 900px) {
    .ffb-filters {
        grid-template-columns:
            repeat(auto-fit, minmax(160px, 1fr));
    }

    .ffb-filters-search-row {
        flex: 1 1 100%;
        width: 100%;
    }

    .ffb-filters-top-row .ffb-result-count {
        flex: 1 1 100%;
        white-space: normal;
    }

}

@media (max-width: 600px) {
    .ffb-filters {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 10px;
    }

    .ffb-filters-bottom-bar {
        justify-content: flex-start;
    }

    .ffb-filters-bottom-right {
        flex-wrap: wrap;
        margin-left: auto;
    }
}


/* =========================================================
   CLEAR SINGLE FILTER (red x, left of the dropdown arrow)
   ========================================================= */

.ffb-custom-filter-clear {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: auto;
    border-radius: 50%;
    color: #d62828;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ffb-custom-filter.has-selection .ffb-custom-filter-clear {
    display: inline-flex;
}

/* With the x present it takes the free space; the arrow just follows it. */
.ffb-custom-filter.has-selection .ffb-custom-filter-arrow {
    margin-left: 8px;
}

.ffb-custom-filter-clear:hover,
.ffb-custom-filter-clear:focus-visible {
    background: rgba(214, 40, 40, 0.14);
    color: #a51616;
    outline: none;
}

.ffb-grid {
    scroll-margin-top: 24px;
}


/* =========================================================
   COLOR PALETTE
   ========================================================= */

/* Card: "Add to palette" checkbox */
.ffb-card-palette-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #20284a;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
}

.ffb-card-palette-toggle input {
    margin: 0;
    cursor: pointer;
}

.ffb-card-swatch.is-pickable {
    width: 36px;
    height: 36px;
    cursor: crosshair;
    transform-origin: bottom right;
    transition: transform 0.15s ease;
}

.ffb-card-swatch.is-pickable:hover {
    transform: scale(1.6);
}

.ffb-swatch-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ffb-palette-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    box-sizing: border-box;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #d9dbe8;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -4px 16px rgba(31, 37, 70, 0.14);
}

.ffb-palette-bar[hidden] {
    display: none;
}

.ffb-palette-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    color: #20284a;
    font-size: 13px;
}

.ffb-palette-count {
    color: #68708d;
}

.ffb-palette-note {
    color: #b3261e;
    font-weight: 600;
}

.ffb-palette-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
}

.ffb-palette-chip {
    position: relative;
    flex: 0 0 128px;
    width: 128px;
}

.ffb-palette-chip-swatch {
    display: block;
    width: 100%;
    height: 44px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
}

.ffb-palette-chip-name {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #20284a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ffb-palette-chip-hex {
    display: block;
    color: #555;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.25;
}

.ffb-palette-chip-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #d62828;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
}

.ffb-palette-chip-remove:hover {
    background: #fff;
    color: #a51616;
}

.ffb-palette-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ffb-palette-format {
    min-height: 32px;
    border: 1px solid #d9dbe8;
    border-radius: 8px;
    font-size: 13px;
}

.ffb-palette-save,
.ffb-palette-clear {
    min-height: 32px;
    padding: 5px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #333;
    color: #fff;
    font-family: var(--ffb-font-heading);
    font-size: 13px;
    cursor: pointer;
}

.ffb-palette-clear {
    margin-left: auto;
    border-color: #d9dbe8;
    background: #fff;
    color: #20284a;
}

.ffb-palette-save:hover {
    background: #222;
}

.ffb-palette-clear:hover {
    border-color: #999;
}


.ffb-fabric-modal-product-link {
    border-color: var(--ffb-vendor-bg, #333);
    background: var(--ffb-vendor-bg, #333);
    color: var(--ffb-vendor-fg, #fff);
}

.ffb-fabric-modal-product-link:hover {
    background: var(--ffb-vendor-bg, #222);
    color: var(--ffb-vendor-fg, #fff);
    filter: brightness(0.88);
}
/* Paste these at the end of your existing assets/browser.css */

/* Card title is now a link to the fur's own page; keep it looking like the plain title. */
.ffb-card-title a { color: inherit; text-decoration: none; }
.ffb-card-title a:hover,
.ffb-card-title a:focus-visible { text-decoration: underline; }

/* "View full page" link in the popup */
.ffb-fabric-modal-page-link {
	display: inline-block;
	margin-top: .75rem;
	font-weight: 600;
}
.ffb-fabric-modal-page-link[hidden] { display: none; }

/* =========================================================
   REPORT AN ERROR
   ========================================================= */

/* Popup link */
.ffb-fabric-modal-report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;

    margin-top: 0.75rem;

    color: #68708d;

    font-size: 14px;
    text-decoration: none;
}

.ffb-fabric-modal-report-link:hover,
.ffb-fabric-modal-report-link:focus-visible {
    color: #d62828;
    text-decoration: underline;
}

/* Filter-bar link */
.ffb-report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: #68708d;

    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.ffb-report-link:hover,
.ffb-report-link:focus-visible {
    color: #d62828;
    text-decoration: underline;
}
