/**
 * Estilos del Store Locator - Frontend
 */

/* Contenedor principal */
.store-locator-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Controles superiores */
.store-locator-controls {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Búsqueda */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

.store-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.store-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

/* Filtros por sector */
.filter-container h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.sector-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sector-filter {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #555;
}

.sector-filter:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.sector-filter.active {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

/* Contenido principal - Mapa y Lista */
.store-locator-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
}

/* Mapa */
#store-map {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Ajustar z-index para controles de Leaflet */
.leaflet-top,
.leaflet-bottom {
    z-index: 999;
}

/* Lista de tiendas */
.store-list-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.store-list-container h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#store-count {
    color: #2271b1;
}

.store-list {
    overflow-y: auto;
    max-height: calc(600px - 80px);
    flex: 1;
}

/* Items de la lista */
.store-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.store-item:last-child {
    border-bottom: none;
}

.store-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.store-item.active {
    background: #e7f3ff;
    border-left: 3px solid #2271b1;
}

.store-item-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.store-item-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.store-item-sector {
    display: inline-block;
    padding: 4px 10px;
    background: #e7f3ff;
    color: #2271b1;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Mensaje cuando no hay resultados */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Popup del mapa */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

.store-popup {
    min-width: 200px;
}

.store-popup-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.store-popup-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.store-popup-sector {
    display: inline-block;
    padding: 4px 10px;
    background: #e7f3ff;
    color: #2271b1;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Colores de marcadores por sector */
.marker-icon {
    background-color: #2271b1;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .store-locator-content {
        grid-template-columns: 1fr 350px;
    }
    
    .store-list {
        max-height: calc(500px - 80px);
    }
}

/* Responsive - Móvil */
@media (max-width: 768px) {
    .store-locator-content {
        grid-template-columns: 1fr;
    }
    
    #store-map {
        height: 400px !important;
    }
    
    .store-list-container {
        max-height: 400px;
    }
    
    .store-list {
        max-height: calc(400px - 80px);
    }
    
    .sector-filters {
        gap: 8px;
    }
    
    .sector-filter {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .store-locator-controls {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .store-search-input {
        font-size: 14px;
        padding: 10px 40px 10px 12px;
    }
    
    #store-map {
        height: 350px !important;
    }
    
    .store-item-name {
        font-size: 15px;
    }
    
    .store-item-address {
        font-size: 13px;
    }
}

/* Scrollbar personalizada */
.store-list::-webkit-scrollbar {
    width: 8px;
}

.store-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.store-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.store-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animación de carga */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

