/* ===== Filtros de la tienda: Categorías / Tallas / Combos (Por Llegar) =====
   Copied from the catalogue (CFV.Frontend.Catalogo2/wwwroot/css/site.css) and adapted to Por
   Llegar: the bar sticks under the fixed header (82px, 70px at <=820px), takes the page's
   panel look and its --cyan tokens. The light theme only redefines the --ft-* tokens
   (theme-light.css, last section). */

.ft-bar,
.ft-results {
    --ft-accent: var(--cyan, #08e3ed);
    --ft-accent-ink: #001416;
    --ft-accent-text: var(--cyan, #08e3ed);
    --ft-accent-strong: var(--cyan-2, #37f5ff);
    --ft-accent-soft: var(--cyan-soft, rgba(8, 227, 237, 0.14));
    --ft-accent-line: var(--cyan-line, rgba(8, 227, 237, 0.48));
    --ft-ring: rgba(8, 227, 237, 0.22);
    --ft-glow: rgba(8, 227, 237, 0.24);
    --ft-bar-bg: rgba(5, 8, 10, 0.92);
    --ft-panel-bg: #0b0f11;
    --ft-card-bg: rgba(255, 255, 255, 0.025);
    --ft-control-bg: #101619;
    --ft-control-hover: #141c20;
    --ft-line: var(--line, rgba(255, 255, 255, 0.1));
    --ft-line-strong: rgba(255, 255, 255, 0.16);
    --ft-line-hover: rgba(255, 255, 255, 0.3);
    --ft-text: var(--text, #f4f7f8);
    --ft-muted: var(--muted, #9ca8ad);
    --ft-bubble: rgba(255, 255, 255, 0.09);
    --ft-bubble-on-accent: rgba(0, 0, 0, 0.14);
    --ft-shadow-stuck: 0 14px 30px rgba(0, 0, 0, 0.5);
    --ft-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ft-header: 84px;
    /* Chevron of the "por página" select, in --ft-muted (light: theme-light.css). */
    --ft-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca8ad' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Under Por Llegar's fixed header, never under it: .site-header is 82px (70px at <=820px)
   plus its 1px border once scrolled, so the bar stops 2px lower. */
.ft-bar {
    position: sticky;
    top: var(--ft-header);
    z-index: 30;
    margin: 0 0 18px;
    background-color: var(--ft-bar-bg);
    border: 1px solid var(--ft-line);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    color: var(--ft-text);
    transition: box-shadow 0.2s ease;
}

@media (max-width: 820px) {
    .ft-bar,
    .ft-results {
        --ft-header: 72px;
    }
}

.ft-bar.is-stuck {
    box-shadow: var(--ft-shadow-stuck);
}

.ft-bar__inner {
    padding: 14px 22px;
}

.ft-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Trigger pills */
.ft-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 41px;
    padding: 9px 16px;
    border: 1px solid var(--ft-line-strong);
    border-radius: 999px;
    background-color: var(--ft-control-bg);
    color: var(--ft-text);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    line-height: 21px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.ft-trigger:hover {
    border-color: var(--ft-line-hover);
    background-color: var(--ft-control-hover);
    color: var(--ft-text);
    text-decoration: none;
}

.ft-trigger.has-value {
    border-color: var(--ft-accent-line);
    background-color: var(--ft-accent-soft);
}

.ft-trigger[aria-expanded="true"],
.ft-trigger[aria-pressed="true"] {
    border-color: var(--ft-accent-strong);
    box-shadow: 0 0 0 2px var(--ft-ring);
}

.ft-trigger__emoji {
    font-size: 15px;
    line-height: 1;
}

.ft-badge {
    max-width: 140px;
    overflow: hidden;
    padding: 2px 9px;
    border-radius: 999px;
    background-color: var(--ft-accent);
    color: var(--ft-accent-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-caret {
    display: inline-block;
    color: var(--ft-muted);
    font-size: 9px;
    transition: transform 0.2s var(--ft-ease);
}

.ft-trigger[aria-expanded="true"] .ft-caret {
    transform: rotate(180deg);
}

.ft-clear {
    padding: 6px 4px;
    color: var(--ft-accent-text);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ft-clear:hover {
    color: var(--ft-text);
}

/* Panels: in place under the row, never a popover */
.ft-panel {
    max-height: 60vh;
    margin-top: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    border: 1px solid var(--ft-line);
    border-radius: 18px;
    background-color: var(--ft-panel-bg);
    animation: ft-panel-in 0.2s var(--ft-ease);
}

.ft-panel[hidden] {
    display: none;
}

@keyframes ft-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.ft-hint {
    margin: 0 0 12px;
    color: var(--ft-muted);
    font-size: 14px;
}

.ft-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ft-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border: 1px solid var(--ft-line-strong);
    border-radius: 999px;
    background-color: var(--ft-control-bg);
    color: var(--ft-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ft-ease), color 0.18s ease;
}

.ft-pill:hover {
    border-color: var(--ft-accent-line);
    background-color: var(--ft-control-hover);
    color: var(--ft-text);
    text-decoration: none;
}

.ft-pill--group {
    padding: 10px 16px;
    border-color: var(--ft-accent-line);
    font-size: 16px;
}

.ft-pill.is-selected,
.ft-pill.is-selected:hover {
    border-color: var(--ft-accent);
    background-color: var(--ft-accent);
    color: var(--ft-accent-ink);
    box-shadow: 0 8px 20px var(--ft-glow);
}

.ft-pill--sub.is-selected,
.ft-pill--model.is-selected {
    transform: scale(1.06);
}

.ft-pill--quiet {
    border-color: var(--ft-line-strong);
    background-color: transparent;
    color: var(--ft-muted);
    font-size: 13px;
}

.ft-subcard {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--ft-line);
    border-radius: 18px;
    background-color: var(--ft-card-bg);
}

.ft-subcard__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.ft-subcard__title {
    margin: 0;
    color: var(--ft-accent-text);
    font-size: 18px;
    font-weight: 700;
}

.ft-models {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--ft-line-strong);
}

.ft-models__label {
    margin: 0 0 10px;
    color: var(--ft-muted);
    font-size: 13px;
    font-weight: 600;
}

/* Tallas: type cards, then the chips of the chosen type */
.ft-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.ft-type {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--ft-line-strong);
    border-radius: 14px;
    background-color: var(--ft-control-bg);
    color: var(--ft-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.ft-type:hover:not(:disabled) {
    border-color: var(--ft-accent-line);
}

.ft-type.is-selected {
    border-color: var(--ft-accent-strong);
    background-color: var(--ft-accent-soft);
    box-shadow: 0 0 0 2px var(--ft-ring);
}

.ft-type:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ft-type__emoji {
    font-size: 22px;
    line-height: 1;
}

.ft-type__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ft-type__title {
    font-size: 14px;
    font-weight: 700;
}

.ft-type__meta {
    color: var(--ft-muted);
    font-size: 12.5px;
}

.ft-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ft-sizes[hidden] {
    display: none;
}

.ft-size {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 14px;
    border: 1px solid var(--ft-line-strong);
    border-radius: 999px;
    background-color: var(--ft-control-bg);
    color: var(--ft-text);
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ft-ease);
}

.ft-size:hover {
    border-color: var(--ft-accent-line);
    background-color: var(--ft-control-hover);
    color: var(--ft-text);
    text-decoration: none;
}

.ft-size__label {
    font-size: 15px;
}

.ft-size__count {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--ft-bubble);
    color: var(--ft-muted);
    font-size: 12px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ft-size.is-selected,
.ft-size.is-selected:hover {
    border-color: var(--ft-accent);
    background-color: var(--ft-accent);
    color: var(--ft-accent-ink);
    box-shadow: 0 8px 20px var(--ft-glow);
    transform: scale(1.08);
}

.ft-size.is-selected .ft-size__count {
    background-color: var(--ft-bubble-on-accent);
    color: var(--ft-accent-ink);
}

.ft-trigger:focus-visible,
.ft-pill:focus-visible,
.ft-type:focus-visible,
.ft-size:focus-visible,
.ft-clear:focus-visible,
.ft-chip:focus-visible,
.ft-empty__action:focus-visible {
    outline: 2px solid var(--ft-accent-strong);
    outline-offset: 2px;
}

/* Results header */
.ft-results {
    margin-bottom: 1rem;
}

.ft-results__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
}

.ft-results__title {
    margin: 0;
    color: var(--ft-text);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ft-results__count {
    margin: 4px 0 0;
    color: var(--ft-muted);
    font-size: 0.9rem;
}

.ft-results__page {
    margin-left: 4px;
}

.ft-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ft-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    padding: 5px 8px 5px 11px;
    border: 1px solid var(--ft-accent-line);
    border-radius: 999px;
    background-color: var(--ft-accent-soft);
    color: var(--ft-accent-text);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.ft-chip:hover {
    border-color: var(--ft-accent-strong);
    color: var(--ft-accent-text);
    text-decoration: none;
}

.ft-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ft-chip__x {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--ft-bubble);
    font-size: 13px;
    line-height: 1;
}

.ft-empty {
    margin-top: 18px;
    padding: 48px 24px;
    border: 1.5px dashed var(--ft-accent-line);
    border-radius: 18px;
    text-align: center;
}

.ft-empty__title {
    margin: 0 0 8px;
    color: var(--ft-text);
    font-size: 1.15rem;
    font-weight: 700;
}

.ft-empty__text {
    margin: 0 0 18px;
    color: var(--ft-muted);
}

.ft-empty__action {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 12px;
    background-color: var(--ft-accent);
    color: var(--ft-accent-ink);
    font-weight: 700;
    text-decoration: none;
    transition: box-shadow 0.18s ease;
}

.ft-empty__action:hover {
    color: var(--ft-accent-ink);
    box-shadow: 0 8px 20px var(--ft-glow);
    text-decoration: none;
}

@media (max-width: 575.98px) {
    .ft-bar__inner {
        padding: 12px 14px;
    }

    .ft-row {
        gap: 8px;
    }

    .ft-trigger {
        padding: 9px 13px;
    }

    .ft-types {
        grid-template-columns: 1fr;
    }

    .ft-subcard {
        padding: 14px 12px;
    }

    .ft-subcard__head {
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ft-panel {
        animation: none;
    }

    .ft-bar,
    .ft-trigger,
    .ft-caret,
    .ft-pill,
    .ft-type,
    .ft-size,
    .ft-chip,
    .ft-empty__action {
        transition: none;
    }

    .ft-pill--sub.is-selected,
    .ft-pill--model.is-selected,
    .ft-size.is-selected {
        transform: none;
    }
}

/* ---- Por Llegar specifics -------------------------------------------------------------
   The page's own ".pll-page a { color: inherit }" and ".pll-page button { font: inherit }"
   outrank the single-class rules above, so the links and buttons of the bar restate theirs. */
.pll-page .ft-trigger,
.pll-page .ft-type {
    font-size: 14px;
    font-weight: 700;
}

.pll-page .ft-type {
    font-weight: 400;
}

.pll-page .ft-clear,
.pll-page .ft-chip,
.pll-page .ft-chip:hover {
    color: var(--ft-accent-text);
}

.pll-page .ft-empty__action,
.pll-page .ft-empty__action:hover {
    color: var(--ft-accent-ink);
}

/* How many products a category shows once picked (CatalogInMemoryFilter counts). */
.ft-pill__count {
    min-width: 24px;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background-color: var(--ft-bubble);
    color: var(--ft-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.ft-pill.is-selected .ft-pill__count {
    background-color: var(--ft-bubble-on-accent);
    color: var(--ft-accent-ink);
}

/* A category with nothing to show under the other filters: not a dead-end link. */
.ft-pill.is-empty {
    opacity: 0.4;
    cursor: not-allowed;
}

.ft-pill.is-empty:hover {
    border-color: var(--ft-line-strong);
    background-color: var(--ft-control-bg);
}

/* Results header: the count takes the place of the old "N productos · página" line. */
.pll-page .ft-results {
    margin: 0 0 22px;
}

.pll-page .ft-results__head {
    align-items: center;
}

.ft-results__count strong {
    color: var(--ft-text);
}

.ft-notice {
    margin: 12px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--ft-accent-line);
    border-radius: 10px;
    background-color: var(--ft-accent-soft);
    color: var(--ft-text);
    font-size: 13px;
}

.pll-page .toolbar {
    margin-bottom: 14px;
}

/* A category tile with nothing to show under the active filters. */
.pll-page .category--empty {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .ft-bar__inner {
        padding: 10px 12px;
    }

    .ft-trigger {
        padding: 8px 12px;
    }

    .pll-page .toolbar .field {
        flex: 1 1 100%;
    }

    .pll-page .toolbar select {
        flex: 1 1 100%;
    }
}

/* Search box and page size on the same line as the filter triggers, pushed to the right. */
.ft-tools {
    margin-left: auto;
}

.pll-page .ft-tools .toolbar {
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0;
}

.pll-page .ft-tools .toolbar input {
    min-width: 270px;
}

/* "N por página": the native select dressed like the bar's trigger pills (same border, colours,
   radius and type), with its own chevron. Only --ft-* tokens, so both themes follow. */
.pll-page .ft-bar .ft-tools .toolbar select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 46px;
    padding: 0 44px 0 18px;
    border: 1px solid var(--ft-line-strong);
    border-radius: 999px;
    background-color: var(--ft-control-bg);
    background-image: var(--ft-chevron);
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 16px;
    color: var(--ft-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 21px;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.pll-page .ft-bar .ft-tools .toolbar select:hover {
    border-color: var(--ft-line-hover);
    background-color: var(--ft-control-hover);
}

.pll-page .ft-bar .ft-tools .toolbar select:focus {
    border-color: var(--ft-accent-strong);
    box-shadow: 0 0 0 2px var(--ft-ring);
}

.pll-page .ft-bar .ft-tools .toolbar select:focus-visible {
    outline: 2px solid var(--ft-accent-strong);
    outline-offset: 2px;
}

.pll-page .ft-bar .ft-tools .toolbar select option {
    background-color: var(--ft-panel-bg);
    color: var(--ft-text);
}

@media (prefers-reduced-motion: reduce) {
    .pll-page .ft-bar .ft-tools .toolbar select {
        transition: none;
    }
}

/* Narrow screens: the triggers keep their line and the search takes the next one, full width. */
@media (max-width: 820px) {
    .ft-tools {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .pll-page .ft-tools .toolbar {
        flex-wrap: wrap;
    }

    .pll-page .ft-tools .toolbar .field {
        flex: 1 1 220px;
    }

    .pll-page .ft-tools .toolbar input {
        min-width: 0;
        width: 100%;
    }
}
