/* ============================================
   Search
   ============================================ */

.search-form {
    margin-bottom: 24px;
}

.search-bar {
    display: flex;
    gap: 12px;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar .btn-primary {
    padding: 14px 28px;
}

/* Inline Geographic Filters (inside semantic-search-toggle row) */
.search-options-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

.inline-provincia-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    max-width: 200px;
}

.inline-radio-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-radio-input {
    width: 80px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
}

.inline-radio-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
}

/* Map panel - visually separate from the form */
.radio-map-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.radio-map-panel-header {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Casilla para dejar en el mapa solo los pines que coinciden. Va junto al
   buscador de direcciones porque esa fila viaja con el mapa cuando la
   búsqueda pasa a vista partida */
.map-hide-red {
    flex-shrink: 0;
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
}

.radio-address-row .radio-address-input { flex: 1; min-width: 0; }
/* radio siempre visible junto al mapa, fuera del formulario de busqueda */
.radio-address-row .map-radio-wrap { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.85rem; color: var(--text-secondary); }
.radio-address-row .inline-radio-input { width: 78px; }

/* Leyenda de colores del mapa de busqueda, en una sola linea discreta */
.mapa-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: -4px 0 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.leyenda-punto {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-radius: 50%;
    vertical-align: middle;
}
.leyenda-punto.verde { background: #38a169; }
.leyenda-punto.ambar { background: #e8a13a; }
.leyenda-punto.rojo { background: #e53e3e; }

@media (max-width: 900px) {
    .radio-address-row { flex-wrap: wrap; }
    .map-hide-red { font-size: 0.75rem; }
}

.radio-map-panel-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.radio-map-panel-body {
    padding: 0 16px 16px;
}

.radio-address-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.radio-address-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
}

.radio-address-input:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-map-container {
    height: 300px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    z-index: 0;
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
    z-index: 10001 !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    font-family: inherit;
}

.pac-item {
    padding: 8px 12px;
    font-size: 0.88rem;
    cursor: pointer;
}

.pac-item:hover {
    background: var(--bg-hover);
}

.inline-provincia-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .search-options-sep {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }
    .inline-provincia-select {
        max-width: 100%;
        width: 100%;
    }
}

/* Image Search */
.image-search-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.image-search-section h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.image-search-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.image-search-dropzone {
    width: 150px;
    height: 150px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.image-search-dropzone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.image-search-dropzone input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-search-dropzone .dropzone-content {
    text-align: center;
    padding: 10px;
}

.image-search-dropzone .dropzone-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.image-search-dropzone .dropzone-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.image-search-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-search-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-preview:hover {
    background: var(--error);
}

.similarity-control {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.similarity-control label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.similarity-control label span {
    color: #059669;
    font-weight: bold;
    font-size: 1.2rem;
}

.similarity-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #cbd5e1, #059669);
    outline: none;
    -webkit-appearance: none;
}

.similarity-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #059669;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.similarity-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #059669;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.similarity-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-image-search {
    align-self: center;
    padding: 14px 24px;
}

.btn-image-search:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

