/**
 * Ubicacion Widget Styles
 * 
 * Layout structure:
 * - Header centered (tagline, title, description)
 * - Content grid: Locations left (40%) | Map right (60%)
 * - Locations list with max 3 visible items + scroll
 * - Interactive: Click location to show its map
 */

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.ubicacion {
    width: 100%;
}

/* Header */
.ubicacion__header {
    margin-bottom: 3rem;
}

.ubicacion__tagline {
    margin-bottom: 0.5rem;
}

.ubicacion__title {
    margin-bottom: 1rem;
}

.ubicacion__description {
    margin-bottom: 0;
}

/* Main content grid: Locations | Map */
.ubicacion__content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    align-items: start;
}

/* ============================================
   LOCATIONS LIST (LEFT SIDE)
   ============================================ */

.ubicacion__locations-wrapper {
    width: 100%;
}

.ubicacion__locations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(3 * 120px + 2rem); /* 3 items visible */
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar styling */
.ubicacion__locations-list::-webkit-scrollbar {
    width: 6px;
}

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

.ubicacion__locations-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ubicacion__locations-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Individual location item */
.ubicacion__location-item {
    padding: 1.25rem;
    border-left: 1px solid var(--_primitives---opacity--neutral-darkest-15);
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.ubicacion__location-item:hover {
    border-color: var(--_primitives---opacity--neutral-darkest);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Location title */
.ubicacion__location-title {
    margin-bottom: 1rem;
}

/* Location address */
.ubicacion__location-address {
    margin-bottom: 1.5rem;
}

/* ============================================
   MAP CONTAINER (RIGHT SIDE)
   ============================================ */

.ubicacion__map-container {
    width: 100%;
    position: relative;
}

.ubicacion__map-wrapper {
    width: 100%;
    height: 400px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Individual map item */
.ubicacion__map-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ubicacion__map-item.is-visible {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Map iframe */
.ubicacion__map-item iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 991px) {
    .ubicacion__content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .ubicacion__locations-list {
        max-height: calc(3 * 110px + 2rem);
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 767px) {
    .ubicacion__header {
        margin-bottom: 2rem;
    }
    
    /* Stack locations and map vertically */
    .ubicacion__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Locations on top */
    .ubicacion__locations-wrapper {
        order: 1;
    }
    
    /* Map below */
    .ubicacion__map-container {
        order: 2;
    }
    
    .ubicacion__locations-list {
        max-height: calc(3 * 100px + 2rem);
        gap: 0.75rem;
    }
    
    .ubicacion__location-item {
        padding: 1rem;
    }
    
    .ubicacion__map-wrapper {
        height: 300px;
    }
}

/* ============================================
   ELEMENTOR EDITOR SPECIFICS
   ============================================ */

/* Ensure proper spacing in Elementor editor */
.elementor-editor-active .ubicacion {
    min-height: 200px;
}

/* Empty state messaging */
.elementor-editor-active .ubicacion__content:empty::before {
    content: 'Ubicación Widget - Agrega ubicaciones en los controles';
    display: block;
    padding: 2rem;
    text-align: center;
    color: #999;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

/* Loading state for maps */
.ubicacion__map-item iframe {
    background-color: #f5f5f5;
}

