/* Mapa de oficina AFR-IX ([data-afrix-office-map]). Independiente del mapa de red y del globo. */

/* Alto por defecto sin especificidad: una clase de Bricks (vh85…) lo pisa */
:where([data-afrix-office-map]) {
    height: 500px;
}

@media (max-width: 767px) {
    :where([data-afrix-office-map]) {
        height: 360px;
    }
}

[data-afrix-office-map] {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #e2f0ed; /* mientras carga */
}

/* Globo suelto (data-zoom="auto"): sin fondo ni zoom, solo la esfera sobre la página */
[data-afrix-office-map].is-globe {
    background: transparent;
}

.is-globe .mapboxgl-canvas {
    background: transparent;
}

/* Con el dedo, lo vertical es scroll de página y lo horizontal gira el globo (como el de la home).
   Pisa el touch-action: none que pone Mapbox con el arrastre activado. */
.is-globe .mapboxgl-canvas-container,
.is-globe .mapboxgl-canvas-container .mapboxgl-canvas {
    touch-action: pan-y !important;
}

/* En móvil la esfera cabe a lo ancho: caja cuadrada, sin hueco arriba y abajo. Va por el atributo (no por
   .is-globe, que pone el JS) para que la caja tenga ya su alto antes de crear el mapa */
@media (max-width: 767px) {
    [data-afrix-office-map][data-zoom="auto"] {
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* Oficinas (varias por mapa): ocultas hasta que el JS las pasa a su ventana */
[data-afrix-office-map] > [data-office] {
    display: none;
}

/* --- Pin ------------------------------------------------------------------ */

.afrix-office-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0;
}

.afrix-office-pin {
    width: 36px;
    height: 47px;
    filter: drop-shadow(0 4px 6px rgba(0, 50, 47, 0.3));
}

.afrix-office-pin path {
    fill: #39b54a; /* --brand */
}

.afrix-office-pin circle {
    fill: #fff;
}

.afrix-office-marker.is-small {
    cursor: pointer;
}

.afrix-office-marker.is-small .afrix-office-pin {
    width: 28px;
    height: 37px;
    transition: transform 0.2s ease;
    transform-origin: 50% 100%;
}

.afrix-office-marker.is-small:hover .afrix-office-pin {
    transform: scale(1.15);
}

.afrix-office-label {
    order: -1;
    margin-bottom: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    background: #00322f; /* --brand-500 */
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* --- Controles -------------------------------------------------------------- */

.afrix-office-map .mapboxgl-ctrl-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 50, 47, 0.15);
}

/* --- Ventana de la oficina ------------------------------------------------ */

.afrix-office-popup .mapboxgl-popup-content {
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 50, 47, 0.18);
    font-family: inherit;
}

.afrix-office-popup .mapboxgl-popup-close-button {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #5c5c5c;
}

.afrix-office-popup .mapboxgl-popup-close-button:hover {
    background: #f5f7f9;
}
