/* ============================================================================
   FILTRO DE CIUDAD - ESTILOS PARA HEADER
   ============================================================================
   Archivo: city_filter_header.css
   Descripción: Estilos para los 3 modales de filtro de ciudad en header.html
   Autor: Sistema sembrisYa
   Última actualización: 2025
   ============================================================================ */

/* ========================================
   SPINNER OVERLAY
   ======================================== */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner-overlay.active {
    display: flex !important;
}

.spinner-content {
    text-align: center;
}

/* ========================================
   GOOGLE PLACES AUTOCOMPLETE
   ======================================== */
.pac-container {
    z-index: 10000 !important;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    border: 1px solid #e0e0e0;
}

.pac-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.pac-item:hover {
    background-color: #f8f9fa;
}

.pac-item:last-child {
    border-bottom: none;
}

.pac-icon {
    margin-right: 0.5rem;
}

.pac-item-query {
    font-size: 0.95rem;
    color: #212529;
    font-weight: 500;
}

.pac-matched {
    font-weight: 700;
    color: #28a745;
}

/* ========================================
   BOTÓN DE UBICACIÓN EN EL HEADER
   ======================================== */
.btn-ubicacion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.btn-ubicacion:hover {
    border-color: #28a745;
    background: #f8fff9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.btn-ubicacion i {
    color: #28a745;
    font-size: 1.2rem;
}

.ubicacion-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.ubicacion-text small {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ubicacion-text strong {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

/* ========================================
   MODALES - ESTILOS GENERALES
   ======================================== */
#filterSearchModal .modal-content,
#filterConfirmMapModal .modal-content,
#filterNoProductsModal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#filterSearchModal .modal-header,
#filterConfirmMapModal .modal-header,
#filterNoProductsModal .modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem;
}

#filterSearchModal .modal-title,
#filterConfirmMapModal .modal-title,
#filterNoProductsModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

/* ========================================
   MODAL 1: BÚSQUEDA
   ======================================== */
#filter-search-input {
    padding: 1rem 3rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#filter-search-input:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

#filter-clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

#filter-clear-btn:hover {
    color: #666;
}

#filter-gps-btn {
    padding: 1rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#filter-gps-btn:hover {
    border-color:#e91e63;
    background: #f8fff9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

#filter-btn-todas-ciudades {
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#filter-btn-todas-ciudades:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

/* ========================================
   MODAL 2: CONFIRMACIÓN CON MAPA
   ======================================== */
#filter-map {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#filter-selected-address {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

#filter-clear-address {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

#filter-clear-address:hover {
    color: #c82333;
    transform: scale(1.1);
}

#filter-confirm-btn {
    background: #e91e63;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#filter-confirm-btn:hover {
    background: #e91e63;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

/* ========================================
   MODAL 3: NO HAY PRODUCTOS
   ======================================== */
#filterNoProductsModal .modal-body {
    padding: 2rem;
    text-align: center;
}

#filterNoProductsModal .modal-header {
    border-bottom: none;
}

#filter-no-products-retry,
#filter-no-products-all-cities {
    border-radius: 10px;
    padding: 0.8rem 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#filter-no-products-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

#filter-no-products-all-cities:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

/* ========================================
   ANIMACIONES
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.show .modal-dialog {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    #filter-map {
        height: 300px;
    }
    
    #filterConfirmMapModal .modal-dialog,
    #filterSearchModal .modal-dialog,
    #filterNoProductsModal .modal-dialog {
        margin: 0.5rem;
    }
    
    #filterSearchModal .modal-body,
    #filterConfirmMapModal .modal-body,
    #filterNoProductsModal .modal-body {
        padding: 1.5rem;
    }
    
    .btn-ubicacion {
        padding: 0.4rem 0.8rem;
    }
    
    .ubicacion-text small {
        font-size: 0.65rem;
    }
    
    .ubicacion-text strong {
        font-size: 0.85rem;
    }
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */
.btn:focus,
input:focus,
button:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Alto contraste para usuarios con discapacidad visual */
@media (prefers-contrast: high) {
    #filter-search-input,
    #filter-gps-btn,
    .btn-ubicacion {
        border-width: 3px;
    }
}

/* Reducir movimiento para usuarios sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}