/* ============================================
   STORE LOCATOR MAP STYLES
   Version: 2.0.0
   ============================================ */

/* Container Principal */
#er-map-container {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
}

/* ============================================
   SIDEBAR - Panel Izquierdo
   ============================================ */
.er-map-sidebar {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    padding: 30px 20px;
    overflow-y: auto;
    max-height: 650px;
}

/* Título */
.er-map-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0 0 15px 0;
    color: #000000;
}

/* ============================================
   BÚSQUEDA
   ============================================ */
.er-search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#er-zip-search {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #d0d0d0;
    border-radius: 0;
    font-size: 14px;
    color: #666666;
    outline: none;
    transition: border-color 0.3s ease;
}

#er-zip-search:focus {
    border-color: #000000;
}

#er-zip-search::placeholder {
    color: #999999;
}

#er-search-btn {
    padding: 12px 28px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#er-search-btn:hover {
    background-color: #333333;
}

/* ============================================
   LISTA DE UBICACIONES
   ============================================ */
#er-location-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.er-location-item {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.er-location-item:hover {
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.er-location-item.active {
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Imagen de la ubicación */
.er-location-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.er-location-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.er-location-item:hover .er-location-thumb img {
    transform: scale(1.05);
}

/* Contenido de texto */
.er-location-text {
    padding: 20px;
}

.er-location-text h4 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin: 0 0 12px 0;
    color: #000000;
    text-transform: uppercase;
}

.er-location-text p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666666;
    line-height: 1.3;
    padding-bottom: 0px;
}

.er-location-text p:last-child {
    margin-bottom: 0;
}

.er-hours {
    font-weight: 500;
    color: #888888;
}

.er-address {
    color: #666666;
}

.er-phone {
    color: #666666;
    font-weight: 500;
}

/* ============================================
   MAPA
   ============================================ */
.er-map-wrapper {
    flex: 1;
    min-height: 650px;
    position: relative;
}

#er-google-map {
    width: 100%;
    height: 100%;
    min-height: 650px;
}

/* ============================================
   INFO WINDOW (Popup del Mapa)
   ============================================ */
.er-infowindow {
    max-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

.er-infowindow-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    color: #000000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.er-infowindow-close:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.er-infowindow-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    margin-bottom: 15px;
}

.er-infowindow-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.er-infowindow-content {
    padding: 0 15px 20px 15px;
}

.er-infowindow-content h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin: 0 0 12px 0;
    color: #000000;
    text-align: left;
    text-transform: uppercase;
}

.er-infowindow-content p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
    text-align: left;
    padding-bottom: 0px;
}

.er-info-hours {
    font-weight: 500;
    color: #888888;
}

.er-info-address a {
    color: #666666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.er-info-address a:hover {
    color: #000000;
    text-decoration: underline;
}

.er-info-phone a {
    color: #666666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.er-info-phone a:hover {
    color: #000000;
    text-decoration: underline;
}

/* Botón ORDER */
.er-order-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    margin-top: 15px;
    margin-bottom: 10px;
    background: transparent;
    color: #000000;
    border: 2px solid #000000;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.er-order-btn:hover {
    background: #000000;
    color: #ffffff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    #er-map-container {
        flex-direction: column;
    }

    .er-map-sidebar {
        max-width: 100%;
        max-height: 500px;
    }

    .er-map-wrapper {
        min-height: 500px;
    }

    #er-google-map {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .er-map-title {
        font-size: 18px;
        letter-spacing: 1.3px;
    }

    .er-search-wrapper {
        flex-direction: column;
    }

    #er-search-btn {
        width: 100%;
    }

    .er-location-thumb {
        height: 180px;
    }

    .er-map-sidebar {
        max-height: 400px;
    }

    .er-map-wrapper {
        min-height: 400px;
    }

    #er-google-map {
        min-height: 400px;
    }
    
    /* InfoWindow Mobile Optimization */
    .er-infowindow {
        max-width: 280px;
    }
    
    .er-infowindow-image {
        height: 150px;
        margin-bottom: 12px;
    }
    
    .er-infowindow-content {
        padding: 0 12px 15px 12px;
    }
    
    .er-infowindow-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
        letter-spacing: 1.2px;
    }
    
    .er-infowindow-content p {
        font-size: 12px;
        margin-bottom: 6px;
        line-height: 1.4;
    }
    
    .er-order-btn {
        padding: 10px 15px;
        margin-top: 12px;
        font-size: 13px;
        letter-spacing: 1.2px;
    }
    
    .er-infowindow-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
        top: 8px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .er-map-sidebar {
        padding: 20px 15px;
    }

    .er-map-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .er-location-text {
        padding: 15px;
    }

    .er-location-text h4 {
        font-size: 16px;
    }

    .er-location-thumb {
        height: 160px;
    }
    
    /* InfoWindow Extra Small Mobile */
    .er-infowindow {
        max-width: 260px;
    }
    
    .er-infowindow-image {
        height: 130px;
        margin-bottom: 10px;
    }
    
    .er-infowindow-content {
        padding: 0 10px 12px 10px;
    }
    
    .er-infowindow-content h3 {
        font-size: 14px;
        margin-bottom: 8px;
        letter-spacing: 1px;
    }
    
    .er-infowindow-content p {
        font-size: 11px;
        margin-bottom: 5px;
        line-height: 1.3;
    }
    
    .er-order-btn {
        padding: 8px 12px;
        margin-top: 10px;
        font-size: 12px;
        letter-spacing: 1px;
    }
}

/* ============================================
   OVERRIDE DE ESTILOS DE GOOGLE MAPS
   ============================================ */
/* Ajustar el infoWindow de Google Maps */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    max-width: 320px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: none !important;
}

/* Ocultar el botón de cierre nativo de Google Maps - Múltiples selectores para asegurar */
.gm-style .gm-style-iw-t::after {
    display: none !important;
}

.gm-style-iw button[aria-label="Close"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.gm-style .gm-ui-hover-effect {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.gm-style-iw-ch {
    display: none !important;
}

button.gm-ui-hover-effect {
    display: none !important;
}

/* Ajustar padding del contenedor del infoWindow */
.gm-style-iw {
    padding: 0 !important;
}

/* Mobile-specific Google Maps InfoWindow overrides */
@media (max-width: 768px) {
    .gm-style .gm-style-iw-c {
        max-width: 280px !important;
    }
    
    .gm-style .gm-style-iw-d {
        overflow: auto !important;
        max-height: 400px !important;
    }
}

@media (max-width: 480px) {
    .gm-style .gm-style-iw-c {
        max-width: 260px !important;
    }
    
    .gm-style .gm-style-iw-d {
        overflow: auto !important;
        max-height: 350px !important;
    }
}
