/**
 * Alien Tools — Product filters widget (frontend).
 *
 * Token-friendly: uses at-theme custom properties with neutral fallbacks
 * so the widget matches the at-theme add-to-cart visual treatment
 * without the plugin depending on the theme.
 */

/* ------------------------------------------------------------------ */
/* Fieldset reset — soften the enveloppe                              */
/* ------------------------------------------------------------------ */

.alien-tools-filters-widget .alien-tools-filters {
    margin: 0;
}

.alien-tools-filters-widget .alien-tools-filter {
    margin: 0 0 var(--at-space-4, 1rem);
    padding: 0;
    border: 0;
}

.alien-tools-filters-widget .alien-tools-filter__label {
    display: block;
    margin: 0 0 var(--at-space-2, 0.4rem);
    padding: 0;
    font-family: var(--at-font-body, inherit);
    font-size: var(--at-fs-body-sm, 0.875rem);
    font-weight: 600;
    color: var(--at-body, inherit);
    text-transform: none;
    letter-spacing: 0;
}

/* ------------------------------------------------------------------ */
/* Native select / number inputs                                       */
/* ------------------------------------------------------------------ */

.alien-tools-filters-widget select,
.alien-tools-filters-widget .alien-tools-filter__price input {
    display: block;
    width: 100%;
    padding: var(--at-space-2, 0.45rem) var(--at-space-3, 0.65rem);
    background: var(--at-canvas, transparent);
    color: var(--at-body, inherit);
    border: 1px solid var(--at-divider, rgba(255, 255, 255, 0.18));
    border-radius: var(--at-radius-xs, 2px);
    font: inherit;
    line-height: 1.3;
}

.alien-tools-filters-widget select:focus,
.alien-tools-filters-widget .alien-tools-filter__price input:focus {
    outline: none;
    border-color: var(--at-highlight, #fff);
}

.alien-tools-filters-widget .alien-tools-filter__price {
    display: flex;
    align-items: center;
    gap: var(--at-space-2, 0.4rem);
}

.alien-tools-filters-widget .alien-tools-filter__price input {
    flex: 1 1 0;
    min-width: 0;
}

/* ------------------------------------------------------------------ */
/* Checkbox / radio option rows                                        */
/* ------------------------------------------------------------------ */

.alien-tools-filters-widget .alien-tools-filter__option {
    display: flex;
    align-items: center;
    gap: var(--at-space-2, 0.4rem);
    margin: 0 0 var(--at-space-2, 0.4rem);
    font-size: var(--at-fs-body-sm, 0.875rem);
    color: var(--at-body, inherit);
    cursor: pointer;
}

.alien-tools-filters-widget .alien-tools-filter__option:last-child {
    margin-bottom: 0;
}

.alien-tools-filters-widget .alien-tools-filter__count {
    color: var(--at-muted, rgba(255, 255, 255, 0.55));
    font-family: var(--at-font-mono, inherit);
    font-size: var(--at-fs-eyebrow, 0.7rem);
    margin-left: auto;
}

/* ------------------------------------------------------------------ */
/* Multi-select dropdown (custom)                                      */
/* ------------------------------------------------------------------ */

.alien-tools-filter__multiselect {
    position: relative;
}

.alien-tools-filter__multiselect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--at-space-2, 0.4rem);
    width: 100%;
    padding: var(--at-space-2, 0.45rem) var(--at-space-3, 0.65rem);
    background: var(--at-canvas, transparent);
    color: var(--at-body, inherit);
    border: 1px solid var(--at-divider, rgba(255, 255, 255, 0.18));
    border-radius: var(--at-radius-xs, 2px);
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
    text-align: left;
}

.alien-tools-filter__multiselect-toggle:focus {
    outline: none;
    border-color: var(--at-highlight, #fff);
}

.alien-tools-filter__multiselect-summary {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alien-tools-filter__multiselect-summary--empty {
    color: var(--at-muted, rgba(255, 255, 255, 0.55));
}

.alien-tools-filter__multiselect-chevron {
    flex: 0 0 auto;
    font-size: 0.7em;
    line-height: 1;
    transition: transform var(--at-trans-fast, 150ms ease);
}

.alien-tools-filter__multiselect-toggle[aria-expanded="true"] .alien-tools-filter__multiselect-chevron {
    transform: rotate(180deg);
}

.alien-tools-filter__multiselect-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--at-space-2, 0.45rem) var(--at-space-3, 0.65rem);
    background: var(--at-canvas, #1a1a1a);
    border: 1px solid var(--at-divider, rgba(255, 255, 255, 0.18));
    border-radius: var(--at-radius-xs, 2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.alien-tools-filter__multiselect-panel[hidden] {
    display: none;
}

.alien-tools-filter__multiselect-panel .alien-tools-filter__option {
    margin-bottom: var(--at-space-2, 0.4rem);
}

.alien-tools-filter__multiselect-panel .alien-tools-filter__option:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Actions row + Reset button (mirrors at-theme add-to-cart)           */
/* ------------------------------------------------------------------ */

.alien-tools-filters__actions {
    display: flex;
    justify-content: flex-end;
    padding: var(--at-space-4, 1rem) 0 0;
}

.alien-tools-filters__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--at-space-3, 0.65rem) var(--at-space-4, 1rem);
    border: 2px solid var(--at-highlight, #fff);
    border-radius: 0;
    background-color: var(--at-canvas, transparent);
    background-image: none;
    color: var(--at-highlight, #fff);
    font-family: var(--at-font-body, inherit);
    font-size: var(--at-fs-body-sm, 0.85rem);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: background-color var(--at-trans-fast, 150ms ease),
                color var(--at-trans-fast, 150ms ease);
}

.alien-tools-filters__reset:hover,
.alien-tools-filters__reset:focus {
    background-color: var(--at-highlight, #fff);
    color: var(--at-canvas, #000);
    outline: none;
}
