/* ==========================================================================
   Terranet PT Filters — Filter bar styles
   ========================================================================== */

/* CSS custom properties set inline by PHP via style="" on .tpf-wrapper */
.tpf-wrapper {
    --tpf-bg:           #4a8fa8;
    --tpf-bar:          #d6e8ee;
    --tpf-btn:          #ffffff;
    --tpf-btn-text:     #4a8fa8;
    --tpf-text:         #5c7d8a;
    --tpf-radius:       60px;
    --tpf-sep:          rgba(92, 125, 138, 0.30);
    --tpf-ease:         0.2s ease;
    --tpf-border-color: #ffffff;
    --tpf-border-width: 0px;

    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.tpf-wrapper *,
.tpf-wrapper *::before,
.tpf-wrapper *::after {
    box-sizing: inherit;
}

/* --- Background strip ----------------------------------------------------- */
.tpf-filter-form {
    background: var(--tpf-bg);
    border-radius: 20px;
    padding: 24px 32px;
}

/* --- Pill bar -------------------------------------------------------------- */
.tpf-bar {
    display: flex;
    align-items: center;
    background: var(--tpf-bar);
    border-radius: var(--tpf-radius);
    padding: 6px;
    gap: 0;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: var(--tpf-border-width) solid var(--tpf-border-color);
}

/* --- Field ----------------------------------------------------------------- */
.tpf-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    min-width: 0;
    border-radius: calc(var(--tpf-radius) - 6px);
    transition: background var(--tpf-ease);
    cursor: pointer;
}

.tpf-field:hover {
    background: rgba(255, 255, 255, 0.40);
}

.tpf-field__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tpf-text);
    margin-bottom: 3px;
    pointer-events: none;
    white-space: nowrap;
}

.tpf-field__input {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--tpf-text);
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
}

.tpf-field__input:focus-visible {
    outline: 2px solid var(--tpf-btn-text);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Separator ------------------------------------------------------------- */
.tpf-sep {
    display: block;
    width: 1px;
    height: 28px;
    background: var(--tpf-sep);
    flex-shrink: 0;
}

/* --- Search button --------------------------------------------------------- */
.tpf-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--tpf-btn);
    color: var(--tpf-btn-text);
    border: none;
    border-radius: calc(var(--tpf-radius) - 4px);
    padding: 0 36px;
    margin: 4px;
    align-self: stretch;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.03em;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: opacity var(--tpf-ease), transform var(--tpf-ease), box-shadow var(--tpf-ease);
}

.tpf-search-btn:hover:not(:disabled) {
    opacity: 0.92;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    transform: translateY(-1px);
}

.tpf-search-btn:active {
    transform: translateY(0);
}

.tpf-search-btn:disabled {
    cursor: wait;
    opacity: 0.75;
}

/* Clear mode — subtle visual difference (slightly muted background) */
.tpf-search-btn.is-clear {
    opacity: 0.80;
}

.tpf-search-btn.is-clear:hover:not(:disabled) {
    opacity: 1;
}

/* Spinner (shown on submit while browser navigates) */
.tpf-search-btn__spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    flex-shrink: 0;
    animation: tpf-spin 0.7s linear infinite;
}

.tpf-search-btn.is-loading .tpf-search-btn__spinner {
    display: block;
}

.tpf-search-btn.is-loading .tpf-search-btn__text {
    opacity: 0.7;
}

@keyframes tpf-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .tpf-filter-form {
        padding: 16px;
        border-radius: 14px;
    }

    .tpf-bar {
        flex-direction: column;
        border-radius: 20px;
        padding: 8px;
        gap: 2px;
    }

    .tpf-field {
        width: 100%;
        align-items: flex-start;
        padding: 10px 16px;
        border-radius: 14px;
    }

    .tpf-field__input {
        text-align: left;
        font-size: 15px;
    }

    .tpf-sep {
        width: 100%;
        height: 1px;
    }

    .tpf-search-btn {
        width: calc(100% - 4px);
        justify-content: center;
        border-radius: 14px;
        padding: 14px;
        font-size: 15px;
        margin: 2px;
    }
}
