/* =========================================
   1. Variables Globales
========================================= */
:root {
    --rosa-principal: #f7a1c4;
    --rosa-fuerte: #d72660;
    --rosa-claro: #ffe0ef;
    --rosa-translucido: rgba(255, 192, 203, 0.25);
    --rosa-blur: rgba(255, 192, 203, 0.18);
    --rosa-borde: rgba(255, 192, 203, 0.35);
    --rosa-white: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 2px 8px rgba(31, 38, 135, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
}

/* =========================================
   2. Contenedores Principales
========================================= */
.veterinalia-tax-search {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.vtaxs-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    width: 100%;
    max-width: 500px;
    background: var(--rosa-blur);
    padding: 20px 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid var(--rosa-borde);
    position: relative;
    z-index: 1;
    margin: 20px auto;
    box-shadow: var(--shadow-soft);
    border-radius: 15px;
    box-sizing: border-box;
    /* Evita el parpadeo oscuro al renderizar el efecto glass */
    will-change: opacity, filter, transform;
}

/* =========================================
   3. Formularios y Filtros (Inputs & Selects)
========================================= */
#veterinalia-tax-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* Agrupamos estilos compartidos para inputs, selects y radio/buttons */
.vtaxs-select,
.vtaxs-radius-input,
.vtaxs-location-input,
.tax-filter {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font-size: 15px;
    background: var(--rosa-white);
    color: #2d2d2d;
    border: 1.5px solid var(--rosa-principal);
    border-radius: 8px;
    box-shadow: 0 2px 8px 0 rgba(255, 192, 203, 0.08);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Estados de Focus compartidos */
.vtaxs-select:focus,
.vtaxs-radius-input:focus,
.vtaxs-location-input:focus,
.tax-filter:focus {
    border-color: var(--rosa-fuerte);
    outline: none;
    box-shadow: 0 0 0 2px var(--rosa-borde);
    background: var(--rosa-claro) !important;
}

.vtaxs-select.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Etiquetas (Labels) */
.vtaxs-taxonomy-group label,
.vtaxs-radius-counter label,
.taxonomy-filter label {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
    text-align: left;
    display: block;
}

/* =========================================
   4. Botones (Buscar y Limpiar)
========================================= */

/* Forzar al grupo a estar en una sola fila horizontal */
.vtaxs-container .vtaxs-button-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    gap: 10px !important;
    margin-top: 5px !important;
}

/* Botón de búsqueda (ocupa todo el espacio sobrante) */
.vtaxs-redirect-button,
.search-submit {
    flex-grow: 1 !important;
    width: auto !important;
    height: 38px !important;
    margin-top: 0 !important;
    padding: 0 22px;
    background: var(--rosa-blur);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid var(--rosa-borde);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px 0 rgba(215, 38, 96, 0.08);
    transition: all 0.25s ease;
}

/* Botón de limpiar */
.vtaxs-clear-button {
    height: 38px;
    width: 38px;
    background: var(--rosa-white) !important;
    color: var(--rosa-fuerte);
    border: 1.5px solid var(--rosa-principal);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.vtaxs-clear-button:hover {
    background: var(--rosa-principal) !important;
    color: #fff;
    border-color: var(--rosa-fuerte);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(215, 38, 96, 0.2);
}

/* Efectos al pasar el ratón (Hover) para el botón de búsqueda */
.vtaxs-redirect-button:hover,
.search-submit:hover {
    background: rgba(255, 192, 203, 0.35) !important;
    border-color: var(--rosa-principal);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px 0 rgba(215, 38, 96, 0.18);
    color: #fff;
}

/* =========================================
   5. Elementos Específicos (Pills, Popups, Select2, etc.)
========================================= */

/* Animación de entrada suave para el popup */
@keyframes popupEntrada {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Radius Pill Buttons --- */
.vtaxs-radius-pills {
    width: 100%;
    z-index: 2;
}

.vtaxs-radius-pills-label {
    display: block;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 1px 4px rgba(180, 30, 80, 0.3);
    letter-spacing: 0.3px;
}

.vtaxs-pills-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.vtaxs-pill {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--rosa-principal);
    background: var(--rosa-white);
    color: var(--rosa-fuerte);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(215, 38, 96, 0.06);
}

.vtaxs-pill:hover {
    background: var(--rosa-claro);
    border-color: var(--rosa-fuerte);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(215, 38, 96, 0.18);
}

.vtaxs-pill-active {
    background: linear-gradient(135deg, var(--rosa-fuerte) 0%, var(--rosa-principal) 100%) !important;
    color: #fff !important;
    border-color: var(--rosa-fuerte) !important;
    box-shadow: 0 4px 15px rgba(215, 38, 96, 0.35);
    transform: scale(1.05);
}

.vtaxs-pill-active:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 6px 20px rgba(215, 38, 96, 0.4);
}

.vtaxs-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vtaxs-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fondo oscuro pero más suave, con ligero desenfoque */
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.vtaxs-popup-content {
    position: relative;
    z-index: 10000;
    width: 500px;
    max-width: 92vw;
    /* Llamamos a la animación de entrada */
    animation: popupEntrada 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vtaxs-close-popup-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #fff;
    color: var(--rosa-fuerte);
    border: 1.5px solid var(--rosa-fuerte);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vtaxs-close-popup-btn:hover {
    background: var(--rosa-fuerte);
    color: #fff;
    transform: rotate(90deg);
}

/* Estilos de la librería Select2 */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    background: white !important;
    border: 1.5px solid var(--rosa-principal) !important;
    border-radius: 8px !important;
}

.select2-dropdown {
    background: #ffffff !important;
    border: 1.5px solid var(--rosa-borde) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
}

/* =========================================
   6. Media Queries (Diseño Responsivo)
========================================= */
@media (max-width: 768px) {
    .vtaxs-container {
        padding: 15px !important;
    }

    .vtaxs-taxonomy-selectors,
    .vtaxs-location-section,
    .vtaxs-container {
        flex-direction: column !important;
        width: 100%;
    }

    .vtaxs-taxonomy-group,
    .vtaxs-location-field,
    .vtaxs-radius-container {
        width: 100% !important;
    }

    /* Aseguramos que los botones sigan alineados en móvil y no salten */
    .vtaxs-redirect-button {
        width: auto !important;
        margin-top: 0 !important;
    }

    .vtaxs-popup-content {
        width: 90%;
        max-width: 500px;
    }

    .vtaxs-close-popup-btn {
        top: 0px;
        right: 0px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}