/**
 * Estilos para el widget de filtrado por ubicación
 */

/* Contenedor principal */
.dt24-filtro-ubicacion {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Formulario */
.dt24-filtro-form {
    position: relative;
}

/* Título del widget */
.dt24-filtro-ubicacion .widget-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #e9ecef;
    color: #343a40;
    line-height: 1.4;
}

/* Título de los grupos de filtro */
.dt24-filtro-titulo {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #343a40;
}

/* Grupos de filtro */
.dt24-filtro-grupo {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    position: relative;
}

/* Contenedor de opciones */
.dt24-filtro-opciones {
    display: flex;
    flex-direction: column; /* Apilar verticalmente */
    gap: 5px; /* Espacio entre opciones */
}

/* Opción de filtro */
.dt24-filtro-opcion {
    display: block; /* Cambiado a block para un control más simple */
    position: relative;
    padding-left: 35px; /* Espacio para el checkmark personalizado */
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 16px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.dt24-filtro-opcion:hover {
    background-color: #f8f9fa;
}

/* Checkbox personalizado (oculto) */
.dt24-filtro-opcion input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Contenedor del label y el checkmark visual */


/* Estilo del checkmark */
.dt24-filtro-opcion .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: all 0.2s;
}

/* Al pasar el ratón sobre el checkbox */
.dt24-filtro-opcion:hover input ~ .checkmark {
    border-color: var(--e-global-color-primary);
}

/* Cuando el checkbox está marcado */
.dt24-filtro-opcion input:checked ~ .checkmark {
    background-color: var(--e-global-color-primary);
    border-color: var(--e-global-color-primary);
}

/* Crear el checkmark/indicador (escondido cuando no está marcado) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Mostrar el checkmark cuando está marcado */
.dt24-filtro-opcion input:checked ~ .checkmark:after {
    display: block;
}

/* Estilo del checkmark/indicador */
.dt24-filtro-opcion .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Etiqueta del checkbox */
.dt24-filtro-opcion label {
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    color: #495057;
    flex-grow: 1;
    padding: 2px 0;
    line-height: 1.4;
    font-weight: 500;
}

/* Etiquetas */
.dt24-filtro-etiqueta {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

/* Selects */
.dt24-filtro-select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23343a40' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 32px;
}

.dt24-filtro-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.dt24-filtro-select:disabled {
    background-color: #e9ecef;
    opacity: 1;
    cursor: not-allowed;
}

/* Botones */
.dt24-filtro-acciones {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.dt24-filtro-boton,
.dt24-filtro-limpiar {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.dt24-filtro-boton {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    flex: 1;
}

.dt24-filtro-boton:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.dt24-filtro-boton:focus {
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

.dt24-filtro-limpiar {
    color: #6c757d;
    background-color: #fff;
    border-color: #6c757d;
}

.dt24-filtro-limpiar:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Enlaces "Ver más" */
.dt24-filtro-enlaces {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dt24-ver-mas {
    font-size: 13px;
    color: #007bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dt24-ver-mas:hover {
    text-decoration: underline;
    color: #0056b3;
}

.dt24-ver-mas .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.dt24-ver-mas.activo .dashicons {
    transform: rotate(180deg);
}

/* Contadores */
.dt24-contador {
    font-size: 12px;
    color: #6c757d;
    margin-left: 4px;
    font-weight: normal;
}

/* Contenedor de ciudades */
.dt24-ciudades-container {
    margin-top: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    border: 1px dashed #dee2e6;
}

/* Mensaje cuando no hay resultados */
.dt24-sin-resultados {
    color: #6c757d;
    font-style: italic;
    padding: 10px 0;
    margin: 0;
    font-size: 13px;
}

/* Estado de carga */
.dt24-cargando {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin: 10px 0;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    color: #6c757d;
}

.dt24-cargando .spinner {
    visibility: visible;
    background: none;
    float: none;
    margin: 0 8px 0 0;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: dt24-spin 1s linear infinite;
}

@keyframes dt24-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Botón Ver más */
.dt24-ver-mas {
    display: inline-flex;
    align-items: center;
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    margin-top: 8px;
    padding: 4px 0;
    transition: color 0.2s;
}

.dt24-ver-mas:hover {
    color: #0056b3;
    text-decoration: underline;
}

.dt24-ver-mas .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    transition: transform 0.3s ease;
}

.dt24-ver-mas.activo .dashicons {
    transform: rotate(180deg);
}

/* Opciones adicionales (para el efecto "Ver más") */
.dt24-opcion-adicional {
    display: none;
}

.dt24-opcion-adicional.visible {
    display: block;
}

/* Estilos responsivos */
@media (min-width: 768px) {
    .dt24-filtro-ubicacion {
        padding: 20px;
    }
    
    .dt24-filtro-acciones {
        flex-direction: row;
    }
    
    .dt24-filtro-boton,
    .dt24-filtro-limpiar {
        flex: 1;
    }
}

/* Compatibilidad con temas de WooCommerce */
.woocommerce .dt24-filtro-ubicacion,
.woocommerce-page .dt24-filtro-ubicacion {
    box-shadow: none;
    border: 1px solid #e5e5e5;
}

/* Estilo para cuando el widget está en la barra lateral */
#secondary .dt24-filtro-ubicacion,
.widget-area .dt24-filtro-ubicacion {
    padding: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .dt24-filtro-grupo {
        padding: 12px;
    }
    
    .dt24-filtro-opciones {
        max-height: 250px;
    }
    
    .dt24-filtro-acciones {
        flex-direction: column;
        gap: 8px;
    }
    
    .dt24-filtro-boton,
    .dt24-filtro-limpiar {
        width: 100%;
    }
}

/* Estilo para cuando el widget está en el pie de página */
#colophon .dt24-filtro-ubicacion {
    background-color: transparent;
    border: none;
    padding: 0;
}
