/* ==========================================================================
   PT Business Directory — Radius Search Styles
   Scoped to .pt-bd-radius-* to avoid theme conflicts.
   Inherits CSS variables from the active theme file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Panel wrapper
   -------------------------------------------------------------------------- */

.pt-bd-radius-panel {
    border-top: 1px solid var(--pt-bd-border, #e5e7eb);
    padding: 14px 0 4px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Row of inputs
   -------------------------------------------------------------------------- */

.pt-bd-radius-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.pt-bd-radius-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pt-bd-radius-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pt-bd-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   ZIP field (input + inline status)
   -------------------------------------------------------------------------- */

.pt-bd-radius-zip-group {
    flex: 1 1 180px;
    min-width: 140px;
}

.pt-bd-radius-zip-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pt-bd-radius-zip-input {
    width: 100%;
}

.pt-bd-radius-zip-status {
    font-size: 11px;
    line-height: 1.4;
    min-height: 16px;
    display: block;
}

.pt-bd-radius-zip-status--loading { color: var(--pt-bd-text-muted, #6b7280); }
.pt-bd-radius-zip-status--ok      { color: var(--pt-bd-success, #16a34a); }
.pt-bd-radius-zip-status--error   { color: var(--pt-bd-error, #dc2626); }

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.pt-bd-radius-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-left: auto;
}

.pt-bd-radius-geo-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   Geolocation message
   -------------------------------------------------------------------------- */

.pt-bd-radius-geo-msg {
    margin-top: 8px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 5px;
    line-height: 1.4;
}

.pt-bd-radius-geo-msg--requesting {
    background: var(--pt-bd-bg, #f9fafb);
    color: var(--pt-bd-text-muted, #6b7280);
    border: 1px solid var(--pt-bd-border, #e5e7eb);
}

.pt-bd-radius-geo-msg--error {
    background: rgba(220, 38, 38, 0.07);
    color: var(--pt-bd-error, #dc2626);
    border: 1px solid rgba(220, 38, 38, 0.20);
}

/* --------------------------------------------------------------------------
   Active radius label (shown when a search is active)
   -------------------------------------------------------------------------- */

.pt-bd-radius-active-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--pt-bd-text-muted, #6b7280);
    background: var(--pt-bd-bg, #f9fafb);
    border: 1px solid var(--pt-bd-border, #e5e7eb);
    border-radius: 5px;
    padding: 5px 10px;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Distance badge on listing cards
   -------------------------------------------------------------------------- */

.pt-bd-distance-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--pt-bd-accent, #2563eb);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 4px;
    padding: 2px 7px;
    margin-right: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Dark theme overrides for the badge */
.ptvd-theme-dark .pt-bd-distance-badge {
    color: var(--pt-bd-accent, #38bdf8);
    background: rgba(56, 189, 248, 0.10);
    border-color: rgba(56, 189, 248, 0.22);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    .pt-bd-radius-row {
        flex-direction: column;
        gap: 10px;
    }

    .pt-bd-radius-group,
    .pt-bd-radius-zip-group {
        width: 100%;
        flex: none;
    }

    .pt-bd-radius-actions {
        margin-left: 0;
        width: 100%;
    }

    .pt-bd-radius-actions .pt-bd-btn {
        flex: 1;
        justify-content: center;
        text-align: center;
    }
}
