/* =========================================
   mapa.css — Rediseño completo
   Ruta: public/css/mapa.css
   ========================================= */

html { scroll-behavior: smooth; }

/* =========================================
   HERO CANOPY
   ========================================= */
/* Altura mínima de 65vh, pero crece si la tarjeta necesita más espacio
   (logos grandes, títulos en dos líneas) en vez de recortarla. */
.hero-canopy {
    position: relative;
    display: flex;
    width: 100%;
    min-height: max(400px, 65vh);
    min-height: max(400px, 65svh);
    overflow: hidden;
    isolation: isolate;
    background-color: var(--canopy-fade-color, #f8f9fa);
}

.canopy-imagen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: calc(100% + 36px);
    top: -18px;
    object-fit: cover;
    object-position: center 58%;
    will-change: transform;
    
    /* Efecto de desvanecimiento borroso en los bordes izquierdo y derecho */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* Gradiente inferior: se funde con la página solo en el último cuarto del banner */
.canopy-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--canopy-fade-color, #f8f9fa) 100%
    );
    background: linear-gradient(
        to bottom,
        transparent 0%,
        color-mix(in srgb, var(--canopy-fade-color, #f8f9fa) 12%, transparent) 30%,
        color-mix(in srgb, var(--canopy-fade-color, #f8f9fa) 58%, transparent) 68%,
        var(--canopy-fade-color, #f8f9fa) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Overlay oscuro semitransparente sobre la imagen */
.canopy-overlay {
    position: relative;
    flex: 1;
    box-sizing: border-box;
    padding: 48px 16px 64px;
    background: linear-gradient(180deg, rgba(0, 15, 36, 0.42) 0%, rgba(0, 15, 36, 0.28) 48%, rgba(0, 15, 36, 0.08) 70%, transparent 100%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenido centrado sobre el canopy.
   "Dark glass": el fondo oscuro mantiene legible el texto blanco aunque la
   página que sigue sea blanca (fadeColor #ffffff) o azul marino. */
.canopy-contenido {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: min(92%, 780px);
    padding: 28px 36px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    background: rgba(0, 15, 36, 0.48);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s linear, opacity 0.2s linear;
    animation: canopy-entrada 0.8s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

/* Sin desenfoque disponible: se compensa con un fondo más opaco */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .canopy-contenido {
        background: rgba(0, 15, 36, 0.78);
    }
}

/* Logo de la abeja / Grupo FE */
.canopy-logo {
    /* 1. Aumentamos el ancho máximo (de 220px a 340px) */
    max-width: min(340px, 80vw); 
    
    /* 2. Aumentamos la altura (de 150px a 220px) */
    height: clamp(150px, 25vh, 220px); 
    
    max-height: none;
    width: auto;
    object-fit: contain;
    
    /* 3. Sombreado más oscuro y amplio para que resalte más contra el cielo claro */
    filter: drop-shadow(0 8px 26px rgba(0, 0, 0, 0.85));
    
    animation: canopy-entrada 0.8s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

/* Logo Texas Gas más grande y prominente para que resalte más */
.canopy-logo.canopy-logo-texas,
.canopy-logo-texas {
    max-width: min(440px, 86vw) !important;
    height: clamp(190px, 34vh, 310px) !important;
    transform: scale(1.12);
    /* El logo es negro y rojo: sobre el dark glass necesita un halo claro */
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95))
            drop-shadow(0 0 12px rgba(255, 255, 255, 0.55)) !important;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .canopy-logo.canopy-logo-texas,
    .canopy-logo-texas {
        max-width: min(350px, 90vw) !important;
        height: clamp(160px, 27vh, 220px) !important;
        transform: scale(1.08);
    }
}

/* Línea dorada opcional sobre el título ($eyebrow del partial) */
.canopy-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ecc94b;
    font-weight: 700;
    margin: 0 0 14px;
}

/* Título principal */
.canopy-titulo {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    color: #fffdfd;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.6);
    font-family: Georgia, 'Times New Roman', serif;
    animation: canopy-entrada 0.75s 0.08s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

/* Subtítulo */
.canopy-subtitulo {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: #fff;
    margin: 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    line-height: 1.55;
    animation: canopy-entrada 0.75s 0.16s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

/* Botón "Ver mapa" con flecha animada */
.canopy-btn-bajar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 8px 24px rgba(0, 16, 38, 0.24);
    animation: canopy-entrada 0.75s 0.24s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.canopy-btn-bajar:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.72);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 16, 38, 0.34);
}

.canopy-btn-bajar:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

@keyframes canopy-entrada {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .canopy-contenido,
    .canopy-logo {
        animation: none;
    }

    .canopy-contenido,
    .canopy-btn-bajar {
        transition: none;
    }
}

/* =========================================
   SECCIÓN MAPA
   ========================================= */
.seccion-mapa {
    position: relative;
    z-index: 10;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    padding: 56px 0 60px;
}

.estaciones-resumen {
    max-width: 900px;
    margin: 0 auto 22px;
    padding: 0 5%;
    background: transparent;
    /* Mismo estilo que .qs-texto del inicio */
    color: #4a5568;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.85;
}

@media (max-width: 768px) {
    .estaciones-resumen {
        font-size: 1.05rem;
    }
}

/* =========================================
   BARRA DE FILTROS
   ========================================= */
.barra-filtros {
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 74, 153, 0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    padding: 14px 5%;
}


.barra-filtros-inner {
    display: flex;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    align-items: center;
}

/* Campo de búsqueda */
.campo-busqueda {
    position: relative;
    flex: 2;
}

.icono-busqueda {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#buscador {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border-radius: 12px;
    border: 2px solid #e0e7f0;
    font-size: 14px;
    outline: none;
    background: #f8f9fa;
    color: #222;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

#buscador:focus {
    border-color: #004a99;
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 74, 153, 0.08);
}

/* Select de marca */
.select-marca {
    flex: 1;
    padding: 13px 16px;
    border-radius: 12px;
    border: 2px solid #e0e7f0;
    background: #f8f9fa;
    color: #004a99;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23004a99' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.select-marca:focus {
    border-color: #004a99;
    background-color: white;
}

/* Sugerencias del buscador */
#sugerencias {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    list-style: none;
    padding: 6px 0;
    margin: 0;
    display: none;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 1000;
}

#sugerencias li {
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

#sugerencias li:last-child { border-bottom: none; }

#sugerencias li:hover {
    background: #f0f5ff;
    color: #004a99;
}

/* =========================================
   MAPA
   ========================================= */

/* Wrapper relativo para que el panel se posicione sobre el mapa */
.contenedor-mapa {
    position: relative;
    width: 92%;
    max-width: 1200px;
    margin: 28px auto 0;
}

#mapa {
    height: min(680px, 70vh);
    width: 100%;
    border-radius: 20px;
    border: 3px solid rgba(0, 74, 153, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 74, 153, 0.12),
        0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.btn-mi-ubicacion {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(15, 26, 54, .14);
    border-radius: 8px;
    background: #fff;
    color: #0f1a36;
    box-shadow: 0 3px 12px rgba(15, 26, 54, .2);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 800;
}

.btn-mi-ubicacion:hover,
.btn-mi-ubicacion.ubicacion-activa {
    background: #0f1a36;
    color: #fff;
}

.btn-mi-ubicacion.cargando {
    opacity: .65;
    cursor: wait;
}

@media (max-width: 600px) {
    .btn-mi-ubicacion {
        right: 12px;
        bottom: 12px;
        min-width: 42px;
        padding: 0 11px;
    }

    .btn-mi-ubicacion span {
        display: none;
    }
}

/* =========================================
   PINES DEL MAPA
   ========================================= */
.pin-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #ffffff;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.25),
        0 0 0 2px rgba(0, 74, 153, 0.15);
    transition: transform 0.2s ease;
}

.pin-badge:hover { transform: scale(1.15); }

.pin-logo {
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
}

/* =========================================
   RESPONSIVE — MEJORADO PARA MÓVILES
   ========================================= */

/* Tablets medianos: panel más estrecho */
@media (max-width: 900px) and (min-width: 701px) {
    .barra-filtros-inner {
        flex-wrap: wrap;
    }
}

/* ─────────────────────────────────────────
   MÓVILES GRANDES Y TABLETS (700px y menos)
   ───────────────────────────────────────── */
@media (max-width: 700px) {
    /* Hero Canopy */
    .hero-canopy {
        min-height: max(320px, 70vh);
        min-height: max(320px, 70svh);
    }

    .canopy-logo {
        height: 130px;
    }

    .canopy-contenido {
        gap: 12px;
        padding: 18px 20px;
    }

    .canopy-titulo {
        font-size: clamp(1.8rem, 5vw, 2.8rem);
    }

    .canopy-subtitulo {
        font-size: clamp(0.85rem, 1.5vw, 1rem);
    }

    /* Barra de filtros mejorada */
    /* Barra compacta: la frase de arriba ya no vive aquí, así que ocupa ~110 px y no 197 px. */
    .barra-filtros {
        padding: 10px 3%;
        position: sticky;
        top: 0;
        z-index: 500;
    }

    .barra-filtros-inner {
        flex-direction: column;
        gap: 8px;
    }

    .campo-busqueda,
    .select-marca {
        width: 100%;
        flex: none;
    }

    #buscador,
    .select-marca {
        padding: 10px 16px 10px 44px;
        font-size: 16px;            /* mínimo 16 px: con menos, Safari hace zoom al tocar el campo */
        height: 46px;
        border-radius: 12px;
        min-height: 46px;
    }

    #buscador {
        padding-left: 44px;
    }

    .select-marca {
        padding-right: 44px;
    }

    /* Mapa y contenedor */
    .contenedor-mapa {
        width: 96%;
        margin: 20px auto 0;
    }

    #mapa {
        height: 480px;
        /* Pantalla menos barra de filtros (~110 px) y márgenes: el mapa llena lo que queda a la vista. */
        height: clamp(380px, calc(100dvh - 190px), 720px);
        width: 100%;
        border-radius: 14px;
        border: 2px solid rgba(0, 74, 153, 0.15);
    }

    /* Widget de la abeja mejorado en móvil */
    .abeja-widget {
        top: 10px;
        left: 10px;
        gap: 6px;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    /* Con el panel de estación abierto la hoja inferior ocupa casi toda la
       pantalla y la burbuja (z-index 1150) quedaba encima de los precios.
       Mientras se lee una estación, la Consejera se aparta. */
    body.panel-abierto .abeja-widget {
        opacity: 0;
        transform: translateX(-12px);
        pointer-events: none;
        visibility: hidden;
    }

    .abeja-logo-img {
        width: 56px;
        height: 56px;
        padding: 8px;
        min-width: 56px;
        min-height: 56px;
    }

    .abeja-pensamiento {
        max-width: 240px;
        padding: 12px 14px;
        border-radius: 16px;
        font-size: 0.82rem;
    }

    .abeja-mensaje {
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .abeja-puntitos {
        padding-left: 18px;
        gap: 4px;
    }

    .abeja-btn-accion {
        padding: 8px 12px;
        font-size: 0.75rem;
        height: 36px;
        min-height: 36px;
    }
}

/* ─────────────────────────────────────────
   MÓVILES MEDIANOS (600px y menos)
   ───────────────────────────────────────── */
@media (max-width: 600px) {
    .hero-canopy {
        min-height: max(300px, 65vh);
        min-height: max(300px, 65svh);
    }

    .canopy-logo {
        height: 120px;
    }

    .canopy-titulo {
        font-size: clamp(1.6rem, 4vw, 2.4rem);
    }

    .barra-filtros {
        padding: 10px 3%;
    }

    #buscador,
    .select-marca {
        padding: 10px 14px 10px 44px;
        font-size: 16px;
        height: 44px;
        min-height: 44px;
        border-radius: 10px;
    }

    .select-marca {
        padding-right: 42px;
    }

    #mapa {
        border-radius: 12px;
    }

    .abeja-logo-img {
        width: 52px;
        height: 52px;
        padding: 6px;
    }

    .abeja-pensamiento {
        max-width: 220px;
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .abeja-puntitos span:nth-child(1) { width: 6px;  height: 6px; }
    .abeja-puntitos span:nth-child(2) { width: 9px;  height: 9px; }
    .abeja-puntitos span:nth-child(3) { width: 12px; height: 12px; }
}

/* ─────────────────────────────────────────
   MÓVILES PEQUEÑOS (480px y menos)
   ───────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-canopy {
        min-height: max(280px, 60vh);
        min-height: max(280px, 60svh);
    }

    .canopy-logo {
        height: 110px;
    }

    .canopy-titulo {
        font-size: clamp(1.4rem, 3.5vw, 2rem);
        letter-spacing: 1px;
    }

    .canopy-subtitulo {
        font-size: 0.75rem;
    }

    .canopy-btn-bajar {
        padding: 10px 24px;
        font-size: 0.75rem;
    }

    .barra-filtros {
        padding: 8px 2%;
    }

    .barra-filtros-inner {
        gap: 8px;
    }

    #buscador,
    .select-marca {
        padding: 10px 12px 10px 40px;
        font-size: 16px;            /* 15 px hacía que el iPhone ampliara la página al escribir */
        height: 44px;
        min-height: 44px;
        border-radius: 9px;
    }

    .icono-busqueda {
        left: 12px;
    }

    .contenedor-mapa {
        width: 97%;
    }

    #mapa {
        border-radius: 11px;
    }

    .abeja-widget {
        top: 8px;
        left: 8px;
    }

    .abeja-logo-img {
        width: 48px;
        height: 48px;
        padding: 5px;
    }

    .abeja-pensamiento {
        max-width: 200px;
        padding: 9px 11px;
        font-size: 0.75rem;
        border-radius: 14px;
    }

    .abeja-mensaje {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .abeja-btn-accion {
        padding: 6px 10px;
        font-size: 0.7rem;
        height: 32px;
    }

    #sugerencias {
        max-height: 200px;
        font-size: 13px;
    }

    #sugerencias li {
        padding: 9px 12px;
    }
}

/* =========================================
   CONSEJERA DE RUTAS — Pensamiento automático MEJORADO
   ========================================= */
.abeja-widget {
    position: absolute;
    top: 14px;
    left: 14px;
    /* Debajo del menú de servicios (#nav-principal: z-index 1200)
       pero por encima de la barra de filtros (1000) y el mapa */
    z-index: 1150;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    pointer-events: auto;
}

/* Logo con pulso animado y mejor diseño */
.abeja-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,249,250,0.96));
    padding: 8px;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.18),
        inset 0 1px 2px rgba(255,255,255,0.8);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    animation: abeja-flotar 3s ease-in-out infinite, abeja-pulso 2s ease-in-out infinite;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.abeja-logo-img:hover {
    transform: scale(1.12);
    box-shadow:
        0 8px 28px rgba(0,0,0,0.25),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 2px rgba(255,255,255,0.8);
}

.abeja-logo-img:active {
    transform: scale(1.08);
}

/* Pulso de brillo para indicar interactividad */
@keyframes abeja-pulso {
    0%, 100% {
        box-shadow:
            0 4px 16px rgba(0,0,0,0.18),
            0 0 0 0 rgba(255, 215, 0, 0.7),
            inset 0 1px 2px rgba(255,255,255,0.8);
    }
    50% {
        box-shadow:
            0 4px 16px rgba(0,0,0,0.18),
            0 0 0 8px rgba(255, 215, 0, 0),
            inset 0 1px 2px rgba(255,255,255,0.8);
    }
}

@keyframes abeja-flotar {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* Tres puntitos de pensamiento mejorados */
.abeja-puntitos {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-left: 20px;
}
.abeja-puntitos span {
    display: block;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    animation: puntito-burbuja 1.5s ease-in-out infinite;
}
.abeja-puntitos span:nth-child(1) { width: 8px;  height: 8px;  animation-delay: 0s; }
.abeja-puntitos span:nth-child(2) { width: 11px; height: 11px; animation-delay: 0.15s; }
.abeja-puntitos span:nth-child(3) { width: 14px; height: 14px; animation-delay: 0.3s; }

@keyframes puntito-burbuja {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.1); }
}

/* Burbuja de pensamiento mejorada */
.abeja-pensamiento {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,252,255,0.96));
    border-radius: 18px;
    border: 2px solid rgba(0, 74, 153, 0.25);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.15),
        0 0 1px rgba(0, 74, 153, 0.1);
    padding: 14px 16px;
    max-width: 300px;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom left;
}

.abeja-pensamiento-oculto {
    opacity: 0;
    transform: scale(0.85) translateY(10px);
    pointer-events: none;
}

.abeja-pensamiento-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: entrada-burbuja 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.abeja-pensamiento:hover {
    border-color: rgba(0, 74, 153, 0.5);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.2),
        0 0 1px rgba(0, 74, 153, 0.2);
    transform: translateY(-2px);
}

@keyframes entrada-burbuja {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Contenedor del mensaje */
.abeja-mensaje-contenedor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Mensaje principal */
.abeja-mensaje {
    font-size: 0.87rem;
    line-height: 1.5;
    color: #1a365d;
    font-weight: 500;
}
.abeja-mensaje strong {
    color: #004a99;
    font-weight: 700;
}

/* Indicador de progreso */
.abeja-indicador-progreso {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.abeja-dots-progress {
    display: flex;
    gap: 4px;
}

.abeja-dots-progress span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}

.abeja-dots-progress span.activo {
    background: #004a99;
    transform: scale(1.4);
}

/* Botón de acción mejorado */
.abeja-btn-accion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #004a99, #0066cc);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 74, 153, 0.25);
    white-space: nowrap;
}

.abeja-btn-accion:hover {
    background: linear-gradient(135deg, #003d80, #0055aa);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 74, 153, 0.4);
}

.abeja-btn-accion:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 74, 153, 0.3);
}

.abeja-btn-accion svg {
    width: 14px;
    height: 14px;
}

/* Ícono informativo */
.abeja-icono {
    font-size: 1.2rem;
    display: inline;
}

/* Responsivo */
@media (max-width: 600px) {
    .abeja-widget {
        top: 10px;
        left: 10px;
        gap: 6px;
    }

    .abeja-logo-img {
        width: 52px;
        height: 52px;
        padding: 6px;
    }

    .abeja-pensamiento {
        max-width: 220px;
        font-size: 0.82rem;
        padding: 12px 14px;
    }

    .abeja-mensaje {
        font-size: 0.8rem;
    }

    .abeja-btn-accion {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    .abeja-puntitos {
        padding-left: 16px;
        gap: 4px;
    }
}


/* =========================================
   PANEL DE LA ESTACIÓN  (<dialog id="panel-estacion">)
   - Escritorio: tarjeta NO modal arriba a la derecha del mapa.
   - Celular (≤700px, o teléfono en horizontal): tarjeta flotante centrada en un diálogo MODAL,
     como la vista previa de un chat de WhatsApp en el iPhone. El mapa y la página se atenúan y
     se desenfocan detrás, y una X pequeña la cierra ("minimiza" con animación).
   El navegador dibuja un diálogo modal en su capa superior: ningún contenedor con transform,
   overflow o z-index puede recortarlo ni taparlo (así se cortaba el panel antes).
   ========================================= */
.panel-estacion {
    /* <dialog> trae borde, relleno, margen automático y color propios: se anulan. */
    position: absolute;
    inset: 12px 12px auto auto;
    margin: 0;
    padding: 0;
    border: 0;
    width: 270px;
    max-width: calc(100% - 24px);
    height: auto;
    max-height: calc(min(680px, 70vh) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #0f1a36;
    border-radius: 16px;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.20);
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.panel-estacion::-webkit-scrollbar { width: 4px; }
.panel-estacion::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.panel-estacion[open] { animation: panel-entrar-escritorio 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.panel-estacion.cerrando { animation: panel-salir-escritorio 0.2s ease-in forwards; pointer-events: none; }

@keyframes panel-entrar-escritorio {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}
@keyframes panel-salir-escritorio {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 900px) and (min-width: 701px) and (min-height: 501px) {
    .panel-estacion { width: 240px; }
}

/* Barra pegajosa de altura cero: la X se queda a la vista aunque se desplace el contenido. */
.panel-barra {
    position: sticky;
    top: 0;
    height: 0;
    z-index: 3;
}

.btn-cerrar-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 26, 54, 0.08);
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Se ve de 30 px pero responde al dedo en 46 px. */
.btn-cerrar-panel::before { content: ''; position: absolute; inset: -8px; }
.btn-cerrar-panel svg { width: 14px; height: 14px; }
.btn-cerrar-panel:hover { background: rgba(15, 26, 54, 0.16); }
.btn-cerrar-panel:active { background: rgba(15, 26, 54, 0.18); transform: scale(0.9); }
.btn-cerrar-panel:focus-visible { outline: 3px solid #004a99; outline-offset: 2px; }

/* Contenido (lo genera estaciones.blade.php) */
.pe-contenido {
    padding: 14px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.pe-cabecera {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 34px; /* deja libre la X */
}

.pe-logo {
    flex: 0 0 auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.pe-logo img { display: block; width: 40px; height: 40px; object-fit: contain; }

.pe-nombre {
    margin: 0 0 4px;
    color: #0f1a36;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.pe-direccion {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.35;
}

.pe-direccion svg { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 3px; }

.pe-etiqueta {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pe-confirmado { display: flex; align-items: center; gap: 6px; color: #28a745; }
.pe-confirmado::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #28a745;
    box-shadow: 0 0 4px #28a745;
}

.pe-precios {
    margin-bottom: 18px;
    padding: 4px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.pe-precio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #e2e8f0;
}

.pe-precio:last-child { border-bottom: 0; }

.pe-precio-tipo {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pe-precio-valor { color: #0f1a36; font-size: 1.15rem; font-weight: 900; }
.pe-precio--regular .pe-precio-valor { color: #28a745; }
.pe-precio--especial .pe-precio-valor { color: #0d6efd; }
.pe-precio--diesel .pe-precio-valor { color: #fd7e14; }

.pe-negocios { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.pe-negocio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
}

.pe-negocio img { height: 16px; max-width: 40px; object-fit: contain; }
.pe-negocio-emoji { font-size: 1rem; }

.pe-waze {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 13px 0;
    background: #0f1a36;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(15, 26, 54, 0.25);
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.pe-waze:active { transform: scale(0.98); }
.pe-waze svg { flex: 0 0 auto; }

/* ── Celular: diálogo modal centrado ─────────────────────────────────────────── */
@media (max-width: 700px), (max-height: 500px) {
    .panel-estacion {
        /* position:fixed explícito: el estilo propio de .panel-estacion (absolute) gana al del navegador. */
        position: fixed;
        inset: 0;
        margin: auto;
        width: min(calc(100% - 28px), 380px);
        height: fit-content;
        max-height: min(82vh, 640px);
        max-height: min(82dvh, 640px);
        border-radius: 22px;
        box-shadow: 0 24px 60px rgba(0, 10, 30, 0.45);
    }

    .panel-estacion[open] { animation: panel-entrar-movil 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
    .panel-estacion.cerrando { animation: panel-salir-movil 0.2s ease-in forwards; }

    /* Detrás de la tarjeta: el mapa y la página se atenúan y se desenfocan. */
    .panel-estacion::backdrop {
        background: rgba(0, 18, 40, 0.42);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        animation: panel-fondo-entra 0.25s ease both;
    }

    .panel-estacion.cerrando::backdrop { animation: panel-fondo-sale 0.2s ease-in forwards; }

    .pe-contenido { padding: 16px 16px 18px; }
    .btn-cerrar-panel { top: 12px; right: 12px; }

    /* Con la tarjeta abierta la página de atrás no se desplaza. */
    body.panel-abierto { overflow: hidden; }
}

@keyframes panel-entrar-movil {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes panel-salir-movil {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: scale(0.9) translateY(12px); }
}
@keyframes panel-fondo-entra { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-fondo-sale  { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .panel-estacion[open],
    .panel-estacion.cerrando,
    .panel-estacion::backdrop,
    .panel-estacion.cerrando::backdrop { animation: none; }
}
