/**
 * 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;
}

/* Tagline and title spacing - applied via wb-global-styles.css (--spacing-8x, --spacing-12x) */

.ubicacion__description {
    margin-bottom: 0;
}

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

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

.ubicacion__locations-wrapper {
    width: 100%;
}

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

.ubicacion__locations-list > *:not(:last-child) {
    margin-bottom: 1rem;
}

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

.ubicacion__locations-list::-webkit-scrollbar-track {
    background: var(--e-global-color-secondary, #f2f2f2);
    border-radius: 3px;
}

.ubicacion__locations-list::-webkit-scrollbar-thumb {
    background: var(--e-global-color-482f50f, #857f82);
    border-radius: 3px;
}

.ubicacion__locations-list::-webkit-scrollbar-thumb:hover {
    background: var(--e-global-color-c868736, #544c50);
}

/* 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: var(--e-global-color-primary, #ffffff);
}

.ubicacion__location-item:hover {
    border-color: var(--_primitives---opacity--neutral-darkest);
    box-shadow: 0 2px 8px var(--_primitives---opacity--neutral-darkest-10, rgba(11,0,6,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: var(--radius-small);
    overflow: hidden;
    box-shadow: 0 2px 12px var(--_primitives---opacity--neutral-darkest-10, rgba(11,0,6,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; /* Mantener gap: CSS Grid estándar */
    }
    
    .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);
    }
    
    .ubicacion__locations-list > *:not(:last-child) {
        margin-bottom: 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: var(--e-global-color-482f50f, #857f82);
    border: 2px dashed var(--e-global-color-82c53d5, #dad8d9);
    border-radius: 4px;
}

/* Loading state for maps */
.ubicacion__map-item iframe {
    background-color: var(--e-global-color-secondary, #f2f2f2);
}

