/*
 * public/css/filter.css
 * ---------------------------------------------------------------------------
 * PURPOSE:
 *   Styles for the horizontal category filter bar above the listings grid.
 * ---------------------------------------------------------------------------
 */

/* -------------------------------------------------------------------------- */
/* FILTER BAR                                                                 */
/* -------------------------------------------------------------------------- */

.filters-main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;

    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.35rem 0.25rem;
    background-color: var(--bg-primary, #FFFFFF);
    border-bottom: 1px solid rgba(34, 34, 34, 0.08);
}

#filters {
    position: relative;

    display: flex;
    flex: 1 1 auto;
    align-items: center;

    width: auto;
    min-width: 0;
    height: 90px;

    margin: 0;
    padding: 0;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
}

#filters > a {
    display: block;
    flex: 0 0 auto;
    align-self: stretch;

    margin: 0 1.25rem;

    color: inherit;
    text-decoration: none;
}

#filters > a:focus-visible {
    outline: 2px solid var(--text-dark, #222222);
    outline-offset: -3px;
    border-radius: var(--radius-small, 8px);
}

@media (max-width: 768px) {
    #filters > a {
        margin: 0 0.95rem;
    }
}

@media (max-width: 425px) {
    #filters > a {
        margin: 0 0.65rem;
    }
}

/* -------------------------------------------------------------------------- */
/* SLIDE BUTTONS                                                              */
/* -------------------------------------------------------------------------- */

.category-arrow {
    position: sticky;
    z-index: 100;

    display: flex;
    flex: 0 0 2.35rem;
    align-items: center;
    justify-content: center;

    width: 2.35rem;
    height: 2.35rem;
    margin: 0 0.25rem;
    padding: 0;

    color: var(--text-dark, #222222);
    background-color: var(--bg-primary, #FFFFFF);

    border: 1px solid var(--border-light, #DDDDDD);
    border-radius: 50%;

    font-size: 1rem;
    cursor: pointer;

    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease,
        background-color 0.15s ease;
}

.category-arrow:hover:not(:disabled) {
    box-shadow: var(--shadow-tertiary, 0 2px 4px rgba(0, 0, 0, 0.18));
    transform: scale(1.04);
}

.category-arrow:active:not(:disabled) {
    transform: scale(0.95);
    background-color: var(--bg-hover, #F7F7F7);
}

.category-arrow:focus-visible {
    outline: 2px solid var(--text-dark, #222222);
    outline-offset: 3px;
}

.category-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.category-arrow[hidden] {
    display: none;
}

.category-arrow > i {
    font-size: 0.8rem;
}

.left_img_button {
    left: 0;
}

.right_img_button {
    right: 0;
}

/* Hide scrollbar */

#filters::-webkit-scrollbar {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* CATEGORY ITEMS                                                             */
/* -------------------------------------------------------------------------- */

.filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: max-content;
    height: 100%;
    margin-top: 1rem;

    color: var(--text-dark, #222222);
    text-align: center;
    opacity: 0.65;

    border-bottom: 2px solid transparent;

    transition:
        opacity 0.15s ease,
        border-color 0.15s ease;
}

.filter > div {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 2rem;
    height: 2rem;
}

.filter > div img {
    display: block;
    width: 1.75rem !important;
    height: 1.75rem !important;
    object-fit: contain;
}

.filter:hover {
    opacity: 1 !important;
    border-bottom-color: var(--text-dark, #222222) !important;
    transform: none !important;
}

#filters > a.active .filter,
#filters > a.selected .filter {
    opacity: 1;
    border-bottom-color: var(--text-dark, #222222);
}

.selectedFilter {
    opacity: 1;
    border-bottom-color: var(--text-dark, #222222);
}

.filter > p {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 1.25rem;
    margin-top: 0.35rem;
    margin-bottom: 0;

    color: var(--text-dark, #222222);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;

    white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* TAX INFORMATION                                                            */
/* -------------------------------------------------------------------------- */

.tax-info {
    display: none;
}

.tax-underline {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.price-info {
    display: inline;
}

/* -------------------------------------------------------------------------- */
/* TAX TOGGLE                                                                 */
/* -------------------------------------------------------------------------- */

.tax-toggle {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: fit-content;
    min-width: 0;
    height: 3rem;

    padding: 0 14px;

    color: var(--text-dark, #222222);
    background-color: var(--bg-primary, #FFFFFF);

    border: 1px solid var(--border-light, #DDDDDD);
    border-radius: var(--radius-medium, 12px);

    font-size: 0.9rem;
    font-weight: 500;

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

.tax-toggle:hover {
    border-color: var(--text-dark, #222222);
}

.tax-toggle .form-check {
    display: flex;
    align-items: center;
    gap: 8px;

    min-height: 0;
    margin: 0;
    padding: 0;
}

.tax-toggle .form-check-label {
    color: var(--text-dark, #222222);
    line-height: 1.4;
}

.tax-filter {
    width: 14.5rem;
    min-width: 14.5rem;
    justify-self: flex-end;
}

.tax-sticky-sticky {
    position: relative;
    top: -2px;
}

/* -------------------------------------------------------------------------- */
/* SWITCH                                                                     */
/* -------------------------------------------------------------------------- */

/* Scope switch styles to tax controls instead of every checkbox on the site. */
.tax-toggle .form-check-input.tax-switch {
    flex: 0 0 auto;

    width: 2.3rem !important;
    height: 23px;

    margin: 0 !important;

    cursor: pointer;
}

.tax-toggle .form-check-input.tax-switch:checked {
    background-color: var(--text-dark, #222222);
    border-color: var(--text-dark, #222222);
}

.tax-toggle .form-switch .form-check-input {
    transition: background-position 0.25s ease-in-out;
}

.tax-sticky {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* FILTER BUTTON                                                              */
/* -------------------------------------------------------------------------- */

.tax-filter-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: 6.25rem;
    min-width: 6.25rem;
    margin: 0;
}

.tax-filter-icon-small {
    display: none;
}

.filterIcon {
    cursor: pointer;
}

.tax-filter-icon .form-check-label {
    white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* MOBILE                                                                     */
/* -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .filters-main {
        gap: 0.5rem;
        align-items: center;
    }

    #filters {
        flex: 1 1 auto;
        min-width: 0;
        height: 82px;
        margin: 0;
    }

    #filters > a {
        margin-right: 0.7rem;
        margin-left: 0.7rem;
    }

    .filter {
        margin-top: 0.5rem;
    }

    .tax-filter {
        display: none;
    }

    .tax-filter-icon {
        display: none;
    }

    .tax-filter-icon-small {
        display: flex;
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;

        width: 40px;
        min-width: 40px;
        height: 40px;

        margin: 0 !important;
        padding: 0;

        background-color: var(--bg-primary, #FFFFFF);
        border: 1px solid var(--border-light, #DDDDDD);
        border-radius: var(--radius-medium, 12px);
    }

    .tax-filter-icon-small:hover {
        background-color: var(--bg-hover, #F7F7F7);
        border-color: var(--text-dark, #222222);
    }

    .tax-filter-icon-small i {
        color: var(--text-dark, #222222);
        font-size: 1rem;
    }

    .tax-sticky {
        position: sticky;
        top: calc(var(--header-height, 80px) + 0.5px);
        z-index: 15;

        display: flex;
        justify-content: center;

        width: fit-content;
        max-width: calc(100% - 2rem);
        min-width: 0;
        height: auto;

        margin: 0 auto 12px !important;
        padding: 10px 14px;

        background-color: var(--bg-primary, #FFFFFF);
        border: 1px solid var(--border-light, #DDDDDD);
        border-radius: var(--radius-medium, 12px);

        box-shadow: var(--shadow-tertiary, 0 2px 4px rgba(0, 0, 0, 0.18));
    }

    .tax-sticky .form-check {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .tax-sticky .form-check-label {
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* -------------------------------------------------------------------------- */
/* SMALL MOBILE SCREENS                                                       */
/* -------------------------------------------------------------------------- */

@media (max-width: 375px) {
    .filters-main {
        gap: 4px;
    }

    #filters > a {
        margin-right: 0.55rem;
        margin-left: 0.55rem;
    }

    .tax-filter-icon-small {
        flex-basis: 36px;
        width: 36px;
        min-width: 36px;
        height: 36px;
    }

    .tax-sticky {
        padding: 8px 10px;
    }

    .tax-sticky .form-check-label {
        font-size: 0.8rem;
    }
}

/* -------------------------------------------------------------------------- */
/* REDUCED MOTION                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #filters {
        scroll-behavior: auto;
    }

    .category-arrow,
    .filter,
    .tax-toggle {
        transition: none;
    }
}
