/*
 * Copyright (c) 2026 Philip Necsulescu.
 * All rights reserved.
 */

.visually-hidden,
.catalog-landing-visually-hidden,
.table-filter-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sort-button {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.sort-button:focus-visible {
    outline: none;
}

.sort-heading {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-items: start;
    justify-items: start;
    column-gap: 4px;
}

.sort-label {
    display: block;
    line-height: inherit;
}

.numeric-sort {
    justify-content: center;
}

.sort-chevrons {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 16px;
    flex: 0 0 auto;
}

.sort-chevrons::before,
.sort-chevrons::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sort-chevrons::before {
    top: 0;
    border-bottom: 8px solid var(--accent-arrow);
}

.sort-chevrons::after {
    bottom: 0;
    border-top: 8px solid var(--accent-arrow);
}

.sort-button[data-direction="asc"] .sort-chevrons::before {
    border-bottom-color: var(--accent);
}

.sort-button[data-direction="asc"] .sort-chevrons::after {
    border-top-color: var(--accent-arrow-muted);
}

.sort-button[data-direction="desc"] .sort-chevrons::before {
    border-bottom-color: var(--accent-arrow-muted);
}

.sort-button[data-direction="desc"] .sort-chevrons::after {
    border-top-color: var(--accent);
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) {
    --price-range-start: 0%;
    --price-range-end: 100%;
    position: relative;
    min-height: var(--range-slider-height, 32px);
}

:is(.table-price-slider-track, .table-price-slider-fill, .catalog-landing-price-slider-track, .catalog-landing-price-slider-fill) {
    position: absolute;
    top: 50%;
    height: 8px;
    border-radius: 999px;
    transform: translateY(-50%);
}

:is(.table-price-slider-track, .catalog-landing-price-slider-track) {
    left: 0;
    right: 0;
    background: var(--white-26);
}

:is(.table-price-slider-fill, .catalog-landing-price-slider-fill) {
    left: var(--price-range-start);
    right: calc(100% - var(--price-range-end));
    background: var(--ball-dot-yellow);
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--ball-dot-yellow);
    appearance: none;
    cursor: pointer;
    pointer-events: none;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"][data-price-range-role="min"] {
    z-index: 2;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"][data-price-range-role="max"] {
    z-index: 3;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"]:focus-visible {
    outline: 4px solid var(--ball-dot-yellow);
    outline-offset: 4px;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: transparent;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -4px;
    border: 4px solid var(--panel);
    border-radius: 50%;
    background: var(--ball-dot-yellow);
    pointer-events: auto;
    appearance: none;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: transparent;
}

:is(.table-price-dual-slider-content, .catalog-landing-price-dual-slider-content) input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 4px solid var(--panel);
    border-radius: 50%;
    background: var(--ball-dot-yellow);
    pointer-events: auto;
}
