/**
 * Estilos para el Buscador de Locales v2
 */

.locales-finder-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Layout en dos columnas */
.locales-finder-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
    height: 700px;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

/* Sidebar izquierdo */
.locales-sidebar {
    display: flex;
    flex-direction: column;
    border-right: none;
    background: #fff;
    overflow-y: auto;
}

/* Sección de búsqueda */
.locales-finder-search {
    display: flex;
    padding: 0 25px 30px 25px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    justify-content: center;
}

.locales-finder-search h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 400;
    color: #000;
}

.search-box {
    display: flex;
    flex-direction: row;
    gap: 0;
    min-width: 480px;
}

.locales-address-input {
    border-radius: 50px !important;
    margin-bottom: 0 !important;
}


.btn-search-locales {
    width: 100%;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 400;
    max-width: 165px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    left: -35px;
}


.btn-use-location-alt {
    padding: 0;
    background: transparent !important;
    color: var(--nooni-button-bg) !important;
    border: 0;
    font-size: 15px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

button#locales-use-location svg {
    position: relative;
    top: -2px;
}
.btn-use-location-alt.loading {
    opacity: 0.6;
}

/* Loading */
.locales-loading {
    text-align: center;
    padding: 15px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(74, 142, 232, 0.2);
    border-top-color: var(--nooni-button-bg) ;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Resultados */
.locales-results-container {
    flex: 1;
    background: #fff;
}

.locales-results {
    display: flex;
    flex-direction: column;
}

.local-item {
    padding: 20px 25px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.local-item::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-top: 2px solid #ccc;
    border-right: 2px solid #ccc;
    transform: translateY(-50%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.local-item:hover::before,
.local-item.active::before {
    opacity: 1;
}

.local-item:hover,
.local-item.active {
    background: #fafbfc;
}

.local-item.fade-in {
    animation: fadeInLeft 0.3s ease forwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.local-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.local-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.local-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    flex: 1;
}

.local-distance {
    background: var(--nooni-button-bg) ;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.local-address,
.local-phone,
.local-hours {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.local-phone a {
    color: var(--nooni-button-bg) ;
    text-decoration: none;
}

.local-phone a:hover {
    text-decoration: underline;
}

/* Mapa */
.locales-map-container {
    position: relative;
    background: #e5e3df;
}

.locales-map {
    width: 100%;
    height: 100%;
}

/* Popup del mapa */
.map-popup {
    min-width: 200px;
}

.map-popup h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.map-popup p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.map-popup img {
    margin-bottom: 10px;
}

/* Marcador de usuario */
.user-location-marker {
    background: transparent;
    border: none;
}

.user-marker-inner {
    font-size: 28px;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

/* Estados vacíos */
.locales-empty {
    text-align: center;
    padding: 40px 20px;
}

.locales-empty p {
    margin: 0;
    font-size: 14px;
    color: #999;
}

/* Scrollbar personalizado */
.locales-results-container::-webkit-scrollbar {
    width: 6px;
}

.locales-results-container::-webkit-scrollbar-track {
    background: #fafafa;
}

.locales-results-container::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.locales-results-container::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Responsive */
@media (max-width: 992px) {
    .locales-finder-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
    }
    
    .locales-sidebar {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .locales-results-container {
        max-height: 400px;
    }
    
    .locales-map-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .locales-finder-layout {
        height: auto;
    }
    
    .search-box {
    min-width: 100%;
}

    .locales-finder-search {
        padding: 0 15px 20px 15px;
        justify-content: center;
        flex-direction: column;
        gap: 20px;
    }
    
    .locales-finder-search h3 {
        font-size: 18px;
    }
    
    .locales-map-container {
        height: 400px;
    }
    
    .local-item {
        padding: 15px;
    }
    .locales-address-input {
        position: relative;
        left: 25px;
    }
    .btn-search-locales {{
        left: -25px;
    }
}

@media (max-width: 480px) {
    .locales-address-input {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .btn-search-locales {
        font-size: 14px;
        padding: 12px;
    }
    
    .local-title {
        font-size: 15px;
    }
}
