/*
 * OTOSync filters are deliberately brand-neutral.
 * A theme can customize them by setting the variables below on any ancestor.
 */
.otosync-filters,
.otosync-external-actions {
    --otosync-filter-control-bg: transparent;
    --otosync-filter-control-color: currentColor;
    --otosync-filter-border-color: #b8b8b8;
    --otosync-filter-focus-color: currentColor;
    --otosync-filter-button-bg: transparent;
    --otosync-filter-button-color: currentColor;
    --otosync-filter-button-border: currentColor;
    --otosync-filter-sticky-bg: transparent;
    color: inherit;
    font-family: inherit;
}

.otosync-filters {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.otosync-filters--stack {
    display: block;
}

.otosync-filters--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.otosync-filter-field {
    display: block;
    min-width: 0;
    margin: 0 0 22px;
    color: inherit;
}

.otosync-filters--grid .otosync-filter-field {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    margin: 0;
}

.otosync-filters--grid .otosync-filter-control,
.otosync-filters--grid input.otosync-filter-input {
    margin-top: auto;
}

.otosync-filter-label {
    display: block;
    margin: 0 0 8px;
    color: inherit;
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
}

.otosync-filter-control {
    position: relative;
    display: block;
    width: 100%;
}

.otosync-filter-control::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.otosync-filters select.otosync-filter-select,
.otosync-filters input.otosync-filter-input,
.otosync-filter-bar select.otosync-filter-select,
.otosync-filter-bar input.otosync-filter-input {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    background: var(--otosync-filter-control-bg);
    border: 1px solid var(--otosync-filter-border-color);
    border-radius: 6px;
    color: var(--otosync-filter-control-color);
    font: inherit;
    line-height: 44px;
    outline: 0;
    box-shadow: none;
}

.otosync-filters select.otosync-filter-select {
    padding-right: 42px !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.otosync-filter-select:hover,
.otosync-filter-input:hover {
    border-color: currentColor;
}

.otosync-filter-select:focus,
.otosync-filter-input:focus {
    border-color: var(--otosync-filter-focus-color);
    outline: 2px solid var(--otosync-filter-focus-color);
    outline-offset: 1px;
}

.otosync-filter-input::-webkit-inner-spin-button,
.otosync-filter-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.otosync-filters input.otosync-filter-input[type="number"] {
    appearance: textfield;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.otosync-filter-actions,
.otosync-external-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.otosync-filters--grid .otosync-filter-actions {
    grid-column: 1 / -1;
    margin-top: 0;
}

.otosync-filter-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0 22px;
    background: var(--otosync-filter-button-bg);
    border: 2px solid var(--otosync-filter-button-border);
    border-radius: 999px;
    color: var(--otosync-filter-button-color);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

.otosync-filter-submit:hover,
.otosync-filter-submit:focus {
    background: var(--otosync-filter-button-bg);
    border-color: var(--otosync-filter-button-border);
    color: var(--otosync-filter-button-color);
    opacity: .75;
}

.otosync-filter-clear {
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
}

.otosync-filter-clear:hover,
.otosync-filter-clear:focus {
    color: inherit;
    opacity: .75;
}

.otosync-external-actions--sticky {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    padding: 12px 0;
    background: var(--otosync-filter-sticky-bg);
}

@media (max-width: 1024px) {
    .otosync-filters--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .otosync-filters--grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .otosync-external-actions--sticky {
        bottom: 12px;
    }
}
