/**
 * Estilos del Localizador de Tiendas
 * Para archive-rank_math_locations.php
 */

/* Archive header */
.archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.archive-title {
    margin: 0;
    font-size: 2rem;
    color: #333;
}

/* Container layout */
.store-locator-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}

/* Map */
#store-locator-map {
    flex: 1 1 60%;
    min-height: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Location list */
.locations-list {
    flex: 1 1 30%;
    min-width: 300px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.location-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #eee;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-item:hover,
.location-item.active {
    background-color: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.location-item.active {
    border-color: #0073aa;
    border-left: 3px solid #0073aa;
}

.location-item h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #333;
}

.location-item p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.location-item .address {
    font-style: italic;
}

.view-details {
    display: inline-block;
    margin-top: 0.75rem;
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-details:hover {
    text-decoration: underline;
}

/* Mapbox custom styling */
.marker {
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 1;
}

.marker:hover {
    transform: translate(-50%, -105%) scale(1.1);
    z-index: 2;
}

.marker.bounce {
    animation: bounce 0.75s ease-in-out;
    z-index: 3;
}

@keyframes bounce {
    0% { transform: translate(-50%, -100%) scale(1); }
    40% { transform: translate(-50%, -120%) scale(1.2); }
    70% { transform: translate(-50%, -90%) scale(0.95); }
    100% { transform: translate(-50%, -100%) scale(1); }
}

.mapboxgl-popup {
    max-width: 300px;
}

.mapboxgl-popup-content {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 250px;
}

.mapboxgl-popup-close-button {
    font-size: 16px;
    color: #333 !important;
    top: 8px;
    right: 8px;
    background: transparent !important;
    border: 0 !important;
    padding: 5px !important;
}

.mapboxgl-popup-close-button:hover {
    background-color: #f0f0f0;
    border-radius: 50%;
}

.marker-popup-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #0073aa;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.popup-address,
.popup-phone {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.popup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.popup-link-container {
    margin-top: 15px;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.popup-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background-color: #f0f7fa;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.popup-link:hover {
    text-decoration: none;
    background-color: #0073aa;
    color: #fff;
}

/* Mensaje de no hay ubicaciones */
.no-locations-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 10;
}

.no-locations-message h3 {
    margin: 0;
    color: #666;
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .store-locator-container {
        flex-direction: column;
    }
    
    #store-locator-map {
        height: 400px;
        order: 1;
    }
    
    .locations-list {
        order: 2;
        max-height: none;
    }
}

/* Controles de navegación (Zoom in/out) */
.mapboxgl-ctrl-top-right {
    top: 10px;
    right: 10px;
}

.mapboxgl-ctrl-group {
    border-radius: 4px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.mapboxgl-ctrl-group button {
    width: 30px !important;
    height: 30px !important;
    background-color: transparent !important;
    border: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    outline: none !important;
    cursor: pointer !important;
}

.mapboxgl-ctrl-group button:hover {
    background-color: #f5f5f5 !important;
}

/* Personalización de íconos de zoom */
.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%230073aa' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 20px !important;
    height: 20px !important;
}

.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%230073aa' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 13H5v-2h14v2z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 20px !important;
    height: 20px !important;
}

/* Asegurarse de que los controles estén encima del mensaje de "no hay ubicaciones" */
.mapboxgl-ctrl {
    z-index: 20;
}

/* Efectos de hover y estados activos para los botones de zoom */
.mapboxgl-ctrl-zoom-in:hover .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-zoom-out:hover .mapboxgl-ctrl-icon {
    opacity: 0.8;
}

.mapboxgl-ctrl-zoom-in:active .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-zoom-out:active .mapboxgl-ctrl-icon {
    transform: scale(0.95);
}
