/*
    Autor: Cristobal Torres Ramos
    Proyecto: Mapa interactivo de la UTTECAM
*/

body,
html {

    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    font-family: 'Plus Jakarta Sans', sans-serif;

    background-color: var(--surface-variant);

}

/* Contenedor del Canvas 3D */

#webgl-container {

    width: 100vw;
    height: 100vh;

    display: block;

}

/* Botón Volver */

.back-button-overlay {

    position: absolute;

    top: 24px;
    left: 24px;

    z-index: 10;

}

.btn-secondary {

    background: #ffffff;

    color: #1a202c;

    padding: 10px 18px;

    border-radius: 12px;

    text-decoration: none;

    font-weight: 700;

    font-size: 14px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.3);

    display: inline-flex;

    align-items: center;

    gap: 8px;

}

/* Tarjeta lateral de detalles */

.floating-details-card {

    position: absolute;

    bottom: 24px;

    right: calc(100% + 300px);

    width: 360px;

    max-width: calc(100% - 48px);

    background: #ffffff;

    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.4);

    padding: 0;

    overflow: visible;

    box-sizing: border-box;

    z-index: 20;

    opacity: 0;

    transform: scale(0.9);

    transition:
        right .35s ease,
        opacity .35s ease,
        transform .35s ease;

}

/* Cabecera Héroe Estilo Google Maps */
.card-hero-container {
    width: 100%;
    display: none;
    overflow: hidden;
    position: relative;
    border-radius: 20px 20px 0 0;
    background: transparent;
}

.card-hero-container.visible {
    display: block;
}

.card-hero-container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 75px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 5;
}

.card-hero-img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.card-hero-img.contain-mode {
    object-fit: contain;
    background: transparent;
}

.card-hero-img:hover {
    transform: scale(1.02);
    filter: brightness(1.03);
}

/* Mascota asomándose mirando abajo en la tarjeta de detalles (Solo visible en móviles) */
.mascota-viewing {
    display: none;
    position: absolute;
    top: -80px;
    right: 20px;
    width: 150px;
    height: auto;
    pointer-events: none;
    z-index: 25;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

.floating-details-card.visible {

    right: 220px;

    opacity: 1;

    transform: scale(1);

}

.floating-details-card::after {

    content: "";

    position: absolute;

    right: -18px;

    bottom: 40px;

    width: 0;
    height: 0;

    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 20px solid #ffffff;

    pointer-events: none;

}

.card-header-overlay {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 0 20px;
    margin-bottom: 12px;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón regresar en posición superior izquierda absoluta */
.floating-details-card .btn-card-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    padding: 0;
}

.floating-details-card .btn-card-back:hover {
    background: #ffffff;
    color: #1a202c;
    transform: scale(1.08);
}

.card-header-overlay h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #1a202c;
    transition: margin-left 0.2s ease;
}

/* Sangría condicional para el título: solo se aplica cuando el botón regresar está activo Y NO HAY imagen disponible */
.floating-details-card.has-back-btn:not(.has-hero) .card-header-left h3 {
    margin-left: 32px;
}

/* Botón cerrar en posición superior derecha absoluta */
.floating-details-card .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.floating-details-card .close-btn:hover {
    background: #ffffff;
    color: #1a202c;
    transform: scale(1.08);
}

.card-content-body {
    padding: 0 20px 20px 20px;
}

/* Transición suave de contenido en la tarjeta de detalles */
#card-body {
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    will-change: opacity, transform;
}

#card-body.content-fading {
    opacity: 0;
    transform: translateY(6px);
}

#card-title {
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
    will-change: opacity, transform;
}

#card-title.title-fading {
    opacity: 0;
    transform: translateX(-6px);
}

.info-row {
    margin-bottom: 12px;
}

.info-row .label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #718096;
    margin-bottom: 4px;
}

.info-row .value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

/* Etiquetas de Especies en la tarjeta del Mapa 3D */
.map-species-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.map-species-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.map-species-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.map-species-tag.reino-animalia {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
    border-color: rgba(52, 152, 219, 0.3);
}

.map-species-tag.reino-fungi {
    background: rgba(155, 89, 182, 0.15);
    color: #8e44ad;
    border-color: rgba(155, 89, 182, 0.3);
}

.map-species-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Ficha Técnica de Elementos y Especies */
.card-detail-img,
.species-detail-img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid #e2e8f0;
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    margin-top: 8px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #edf2f7;
}

.taxonomy-item {
    font-size: 12px;
}

.taxonomy-item .tax-label {
    font-weight: 700;
    color: #718096;
    display: block;
    font-size: 10px;
    text-transform: uppercase;
}

.taxonomy-item .tax-val {
    color: #2d3748;
    font-weight: 600;
}


/* Tooltip */

.map-tooltip {

    position: absolute;

    background: rgba(15,23,42,0.9);

    color: #ffffff;

    padding: 8px 14px;

    border-radius: 8px;

    font-size: 13px;

    font-weight: 700;

    pointer-events: none;

    opacity: 0;

    transition: opacity 0.15s ease;

    z-index: 100;

    box-shadow: 0 4px 12px rgba(0,0,0,0.4);

    border: 1px solid rgba(255,255,255,0.2);

}

.map-tooltip.visible {

    opacity: 1;

}

/* Pantalla de carga del mapa */

#loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(24, 153, 132, 0.12), transparent 55%),
        #f4f7f8;
    color: #1a202c;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

#loader[hidden],
#loader [hidden] {
    display: none !important;
}

.loader-card {
    width: min(100%, 440px);
    box-sizing: border-box;
    padding: clamp(24px, 6vw, 40px);
    border: 1px solid rgba(26, 32, 44, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(26, 45, 54, 0.12);
}

.loader-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: #52616b;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.loader-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-action);
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0;
}

.loader-brand-divider {
    padding: 0 3px;
    color: var(--color-institucional-naranja-oscuro);
}

.loader-card h1 {
    margin: 0;
    color: #17252e;
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

#loader-stage {
    min-height: 1.5em;
    margin: 10px 0 28px;
    color: #61717b;
    font-size: 0.94rem;
    line-height: 1.5;
}

.loader-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: #60717b;
    font-size: 0.78rem;
    font-weight: 700;
}

#loader-percent {
    color: #167e70;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    font-weight: 800;
}

.loader-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8efef;
}

.loader-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #39b69f);
    transition: width 100ms linear;
}

.loader-activity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
    margin-top: 18px;
    color: #75838a;
    font-size: 0.74rem;
    line-height: 1.5;
}

.loader-spinner {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    border: 2px solid #d9e8e5;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

.loader-error {
    margin-top: 18px;
    color: #a63e26;
    font-size: 0.9rem;
    line-height: 1.5;
}

.loader-retry {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
    border: 0;
    border-radius: 12px;
    background: var(--color-institucional-naranja-oscuro);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.loader-retry:hover {
    background: #d95f25;
}

@media (max-width: 480px) {
    #loader {
        padding: 18px;
    }
    .loader-card {
        border-radius: 20px;
    }
}

/* Eventos públicos asociados a estructuras del modelo 3D */
.map-event-layer {
    position: absolute;
    inset: 0;
    z-index: 9;
    overflow: hidden;
    pointer-events: none;
}

.map-event-bubble {
    position: absolute;
    display: flex;
    width: fit-content;
    max-width: min(260px, calc(100vw - 28px));
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 13px 11px;
    color: #fff;
    background: linear-gradient(135deg, rgba(14, 105, 88, 0.98), rgba(22, 126, 104, 0.97) 55%, rgba(201, 88, 36, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 15px;
    box-shadow: 0 7px 20px rgba(12, 59, 51, 0.3), 0 0 0 1px rgba(24, 153, 132, 0.15);
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
    transform: translate(-50%, -100%) translateY(-17px);
    translate: 0 0;
    transition: opacity 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
    animation: mapEventFloat 4.8s ease-in-out infinite, mapEventPulse 3.8s ease-in-out infinite;
}

.map-event-bubble.visible {
    opacity: 1;
}

.map-event-bubble-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-event-bubble-icon {
    display: grid;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    place-items: center;
    color: #125f51;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 900;
}

.map-event-bubble-badge {
    color: #ffe4a8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1;
}

.map-event-bubble-name {
    display: block;
    width: auto;
    max-width: 100%;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.map-event-bubble::after {
    position: absolute;
    bottom: -7px;
    left: 50%;
    width: 12px;
    height: 12px;
    content: "";
    background: #a95a35;
    border-right: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    transform: translateX(-50%) rotate(45deg);
}

.map-event-bubble.below-anchor {
    transform: translate(-50%, 17px);
}

.map-event-bubble.below-anchor::after {
    top: -7px;
    bottom: auto;
    transform: translateX(-50%) rotate(225deg);
}

.map-event-bubble:hover,
.map-event-bubble:focus-visible {
    z-index: 1;
    box-shadow: 0 10px 25px rgba(12, 59, 51, 0.38), 0 0 0 3px rgba(243, 178, 60, 0.3);
    transform: translate(-50%, -100%) translateY(-17px) scale(1.04);
    animation-play-state: paused;
}

.map-event-bubble.below-anchor:hover,
.map-event-bubble.below-anchor:focus-visible {
    transform: translate(-50%, 17px) scale(1.04);
}

.map-event-bubble.selected {
    animation: mapEventSelect 0.46s ease-out;
}

.map-event-bubble.below-anchor.selected {
    animation-name: mapEventSelectBelow;
}

.map-event-bubble:focus-visible {
    outline: 3px solid #f3b23c;
    outline-offset: 3px;
}

.map-events-row {
    margin-top: 16px;
}

.map-events-list {
    display: grid;
    gap: 8px;
    margin-top: 9px;
}

.map-event-card-link {
    display: flex;
    width: 100%;
    min-height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 9px 11px;
    color: #176f60;
    background: rgba(24, 153, 132, 0.09);
    border: 1px solid rgba(24, 153, 132, 0.2);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
}

.map-event-card-link:hover,
.map-event-card-link:focus-visible {
    background: rgba(24, 153, 132, 0.16);
    outline: 2px solid rgba(24, 153, 132, 0.45);
    outline-offset: 1px;
}

.map-event-card-title {
    font-size: 12px;
    font-weight: 800;
}

.map-event-card-date {
    color: #45635d;
    font-size: 10px;
}

.map-event-image-container {
    margin-top: 14px;
}

.map-event-image {
    display: block;
    width: 100%;
    max-height: 220px;
    border-radius: 12px;
    object-fit: cover;
}

@keyframes mapEventFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -3px; }
}

@keyframes mapEventPulse {
    0%, 100% { box-shadow: 0 7px 20px rgba(12, 59, 51, 0.3), 0 0 0 1px rgba(24, 153, 132, 0.15); }
    50% { box-shadow: 0 8px 22px rgba(12, 59, 51, 0.32), 0 0 0 4px rgba(243, 178, 60, 0.12); }
}

@keyframes mapEventSelect {
    0%, 100% { transform: translate(-50%, -100%) translateY(-17px) scale(1); }
    45% { transform: translate(-50%, -100%) translateY(-17px) scale(1.1); }
}

@keyframes mapEventSelectBelow {
    0%, 100% { transform: translate(-50%, 17px) scale(1); }
    45% { transform: translate(-50%, 17px) scale(1.1); }
}

@media (max-width: 768px) {
    .map-event-bubble {
        max-width: min(230px, calc(100vw - 24px));
        padding: 9px 11px 10px;
        border-radius: 13px;
    }

    .map-event-bubble-name {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .map-event-bubble {
        max-width: calc(100vw - 20px);
        padding: 8px 10px;
    }

    .map-event-bubble-name {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-event-bubble {
        animation: none;
        transition: opacity 0.2s ease;
    }

    .map-event-bubble.selected,
    .map-event-bubble.below-anchor.selected {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .loader-spinner {
        animation: none;
    }

    .loader-progress-fill {
        transition: none;
    }
}

/* Controles del mapa */

.map-controls-overlay {

    position: absolute;

    bottom: 30px;

    left: 30px;

    display: flex;

    flex-direction: column;

    gap: 10px;

    z-index: 10;

}

/* Botones flotantes */

.ui-button,
button {

    background: rgba(255,255,255,0.85);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.4);

    border-radius: 14px;

    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.15);

    color: #1e293b;

    font-family: 'Segoe UI',
                 system-ui,
                 -apple-system,
                 sans-serif;

    font-weight: 600;

    cursor: pointer;

    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);

    width: 52px;

    height: 52px;

    font-size: 24px;

    display: flex;

    align-items: center;

    justify-content: center;

}

/* Hover */

.ui-button:hover,
button:hover {

    background: rgba(255,255,255,0.95);

    transform: translateY(-2px);

    box-shadow: 0 12px 40px 0 rgba(0,0,0,0.25);

    border-color: rgba(255,255,255,0.8);

}

/* Click */

.ui-button:active,
button:active {

    transform: translateY(0px);

    box-shadow: 0 4px 16px 0 rgba(0,0,0,0.15);

}

/* Botones especiales */

#btn-volver,
#btn-reset {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 10px 18px;

    font-size: 14px;

}

/* Drag handle para Bottom Sheet en móviles */
.card-drag-handle {
    display: none;
}

/* Media Query para Dispositivos Móviles (Diseño Responsivo) */
@media (max-width: 768px) {
    #webgl-container {
        touch-action: none;
    }

    .card-drag-handle {
        display: block;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 42px;
        height: 5px;
        background: rgba(203, 213, 225, 0.85);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border-radius: 3px;
        z-index: 35;
        cursor: grab;
        touch-action: pan-y;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .card-drag-handle:active {
        cursor: grabbing;
        background: #94a3b8;
    }

    /* Transformar la tarjeta flotante en Bottom Sheet modal */
    .floating-details-card {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 0;
        padding-bottom: 220px;
        margin-bottom: -200px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
        transform: translateY(100%);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
        z-index: 200;
        touch-action: pan-y;
        user-select: none;
    }

    .card-hero-container,
    .card-hero-img {
        border-radius: 24px 24px 0 0;
    }

    .floating-details-card.visible {
        right: 0;
        transform: translateY(0);
        opacity: 1;
    }

    .floating-details-card::after {
        display: none;
    }

    /* Ajustes de superposición de controles para pantallas pequeñas */
    .back-button-overlay {
        top: 16px;
        left: 16px;
    }

    .map-controls-overlay {
        bottom: 20px;
        left: 16px;
        gap: 8px;
    }

    button {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .btn-secondary {
        padding: 8px 14px;
        font-size: 13px;
    }

    .mascota-viewing {
        display: block;
    }
}

/* =========================================================
   UBICACIÓN + MENÚ EXPLORAR
   ========================================================= */

.map-explore-overlay {

    position: absolute;

    top: 24px;
    right: 24px;

    display: flex;
    flex-direction: column;

    align-items: flex-end;

    gap: 10px;

    z-index: 50;

    width: max-content;
}


/* =========================================================
   BOTÓN MI UBICACIÓN
   ========================================================= */

.location-button {

    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 9px;

    min-width: 180px;
    height: 52px;

    padding: 0 22px;

    border: 1px solid rgba(255, 255, 255, 0.8);

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.94);

    color: #263238;

    font-family: 'Plus Jakarta Sans', sans-serif;

    font-size: 14px;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.16),
        0 3px 8px rgba(0, 0, 0, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    overflow: hidden;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease;
}


.location-button:hover {

    transform: translateY(-3px);

    background: rgba(255, 255, 255, 0.98);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.20),
        0 5px 12px rgba(0, 0, 0, 0.10);
}


.location-button:active {

    transform: translateY(-1px) scale(0.97);
}


.location-icon {

    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    color: var(--color-institucional-verde-profundo);

    font-size: 18px;

    transition: transform 0.25s ease;
}


.location-button:hover .location-icon {

    transform: scale(1.15);
}


/* =========================================================
   CONTENEDOR DEL MENÚ
   ========================================================= */

.explore-wrapper {

    position: relative;

    width: 180px;
}


/* =========================================================
   BOTÓN EXPLORAR
   ========================================================= */

.explore-button {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: flex-start;

    width: 100%;
    height: 50px;

    padding: 0 15px;

    gap: 9px;

    border: 1px solid rgba(255, 255, 255, 0.75);

    border-radius: 15px;

    background: rgba(255, 255, 255, 0.92);

    color: #263238;

    font-family: 'Plus Jakarta Sans', sans-serif;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 3px 7px rgba(0, 0, 0, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}


.explore-button:hover {

    transform: translateY(-2px);

    background: rgba(255, 255, 255, 0.98);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.20);
}


.explore-icon {

    font-size: 20px;

    line-height: 1;

    color: var(--color-institucional-verde-profundo);
}


.explore-text {

    flex: 1;

    text-align: left;
}


.explore-arrow {

    font-size: 16px;

    transition: transform 0.3s ease;
}


.explore-button.open .explore-arrow {

    transform: rotate(180deg);
}


/* =========================================================
   MENÚ DESPLEGABLE
   ========================================================= */

.explore-menu {

    position: absolute;

    top: 0;

    right: calc(100% + 10px);

    width: 250px;

    padding: 10px;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid rgba(255, 255, 255, 0.8);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.20),
        0 5px 15px rgba(0, 0, 0, 0.08);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(-8px)
        scale(0.96);

    transform-origin: top right;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}


.explore-menu.open {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* =========================================================
   CABECERA DEL MENÚ
   ========================================================= */

.explore-menu-header {

    padding: 7px 10px 9px;

    font-size: 10px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.8px;

    color: #94a3b8;
}

/* =========================================================
   CABECERA DEL MENÚ + BOTÓN CERRAR
   ========================================================= */

/* =========================================================
   CABECERA DEL MENÚ
   ========================================================= */

.explore-menu-header {

    display: flex;

    align-items: center;
    justify-content: space-between;

    width: 100%;

    box-sizing: border-box;

    padding: 7px 6px 9px 10px;

    font-size: 10px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.8px;

    color: #94a3b8;
}


.explore-menu-title {

    flex: 1;

    line-height: 1.2;
}


/* =========================================================
   BOTÓN CERRAR
   ========================================================= */

.explore-close-button {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin: 0 0 0 8px;

    padding: 0;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: #64748b;

    font-family: Arial, sans-serif;

    font-size: 24px;

    font-weight: 400;

    line-height: 30px;

    text-align: center;

    cursor: pointer;

    flex-shrink: 0;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.explore-close-button:hover {

    background: #f1f5f9;

    color: #ef4444;

    transform: scale(1.08);
}


.explore-close-button:active {

    background: #e2e8f0;

    color: #dc2626;

    transform: scale(0.92);
}

/* =========================================================
   BOTÓN X PARA CERRAR MENÚ EXPLORAR
   ========================================================= */

.explore-close-button {

    position: relative;

    z-index: 100;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    margin: 0 0 0 8px;

    padding: 0;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: #64748b;

    font-family: Arial, sans-serif;

    font-size: 25px;

    font-weight: 400;

    line-height: 1;

    text-align: center;

    cursor: pointer;

    pointer-events: auto;

    flex-shrink: 0;

    user-select: none;

    -webkit-user-select: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.explore-close-button:hover {

    background: #f1f5f9;

    color: #ef4444;

    transform: scale(1.08);
}


.explore-close-button:active {

    background: #e2e8f0;

    color: #dc2626;

    transform: scale(0.92);
}

.explore-menu-title {

    flex: 1;

    line-height: 1.2;
}


/* =========================================================
   BOTÓN X
   ========================================================= */

.explore-close-button {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    margin-left: 8px;

    padding: 0;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: #64748b;

    font-family: Arial, sans-serif;

    font-size: 24px;

    font-weight: 400;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.explore-close-button:hover {

    background: #f1f5f9;

    color: #ef4444;

    transform: scale(1.08);
}


.explore-close-button:active {

    transform: scale(0.92);
}

/* =========================================================
   OPCIONES
   ========================================================= */

.explore-option {

    position: relative;

    display: flex;

    align-items: center;

    width: 100%;

    min-height: 48px;

    padding: 8px 10px;

    margin: 3px 0;

    gap: 10px;

    border: none;

    border-radius: 12px;

    background: transparent;

    color: #334155;

    font-family: 'Plus Jakarta Sans', sans-serif;

    font-size: 13px;

    font-weight: 700;

    cursor: pointer;

    text-align: left;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease;
}


.explore-option:hover {

    background: var(--surface-variant);

    transform: translateX(2px);
}


.explore-option.active {

    background: rgba(24, 153, 132, 0.12);

    color: var(--color-institucional-verde-profundo);
}


.explore-option-icon {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border-radius: 10px;

    background: var(--surface-variant);

    font-size: 16px;

    flex-shrink: 0;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.explore-option.active .explore-option-icon {

    background: rgba(24, 153, 132, 0.18);

    transform: scale(1.05);
}


.explore-option-text {

    flex: 1;

    white-space: nowrap;
}


/* =========================================================
   CHECK
   ========================================================= */

.explore-check {

    display: flex;

    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #e2e8f0;

    color: transparent;

    font-size: 12px;

    font-weight: 800;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.explore-option.active .explore-check {

    background: var(--color-institucional-verde-oscuro);

    color: #ffffff;

    transform: scale(1.05);
}


/* =========================================================
   AVISO DE ENTRADAS
   ========================================================= */

.explore-entrances-info {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 8px;

    padding: 9px 10px 6px;

    border-top: 1px solid #e2e8f0;

    color: #64748b;

    font-size: 10px;

    font-weight: 600;
}


.entrance-indicator {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #ef4444;

    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.10);
}

.explore-events-toggle {
    position: fixed;
    top: 92px;
    left: 24px;
    z-index: 81;
    display: inline-flex;
    min-width: 116px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 13px;
    color: #fff;
    background: linear-gradient(135deg, #127b6a, #0e564c);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(14, 86, 76, 0.25);
    font: 800 13px/1 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.explore-events-toggle:hover {
    background: linear-gradient(135deg, #0e6f60, #0a4b41);
    box-shadow: 0 9px 24px rgba(14, 86, 76, 0.32);
    transform: translateY(-1px);
}

.explore-events-toggle:focus-visible,
.explore-events-close:focus-visible {
    outline: 3px solid rgba(238, 112, 48, 0.55);
    outline-offset: 3px;
}

.explore-events-toggle-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: #f3b23c;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.explore-events-toggle-arrow {
    margin-top: -5px;
    color: #f3b23c;
    font-size: 17px;
    transition: transform 0.2s ease;
}

.explore-events-toggle[aria-expanded="true"] .explore-events-toggle-arrow {
    transform: rotate(180deg);
}

.explore-events-section {
    position: fixed;
    top: 146px;
    left: 24px;
    z-index: 80;
    box-sizing: border-box;
    width: min(340px, calc(100vw - 48px));
    max-height: min(calc(100vh - 170px), 540px);
    max-height: min(calc(100dvh - 170px), 540px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px) scale(0.98);
    transform-origin: top left;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.explore-events-section.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.explore-events-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 9px;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.explore-events-heading h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
}

.explore-events-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.explore-events-actions button {
    width: auto;
    height: auto;
    min-height: 30px;
    padding: 5px 8px;
    color: #176f60;
    background: rgba(24, 153, 132, 0.08);
    border: 1px solid rgba(24, 153, 132, 0.2);
    border-radius: 8px;
    font: 700 10px/1.2 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.explore-events-actions button:hover,
.explore-events-actions button:focus-visible {
    color: #fff;
    background: #188f7c;
    outline: 2px solid rgba(24, 153, 132, 0.25);
    outline-offset: 1px;
}

.explore-events-actions button:last-child {
    color: #a64b20;
    background: rgba(238, 112, 48, 0.08);
    border-color: rgba(238, 112, 48, 0.2);
}

.explore-events-actions button:last-child:hover,
.explore-events-actions button:last-child:focus-visible {
    color: #fff;
    background: #c85d28;
}

.explore-events-close {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    color: #52635f;
    background: #f1f5f4;
    border: 1px solid #dce7e4;
    border-radius: 9px;
    font: 700 20px/1 sans-serif;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.explore-events-close:hover {
    color: #fff;
    background: #a94414;
    border-color: #a94414;
}

.explore-events-list {
    display: flex;
    max-height: 220px;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b7cbc6 transparent;
}

.explore-event-option {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto 38px;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 5px 6px;
    color: #334155;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.18s ease;
}

.explore-event-option:hover {
    background: #f1f7f5;
}

.explore-event-option.active {
    background: rgba(24, 153, 132, 0.08);
}

.explore-event-icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    color: #b65325;
    background: rgba(238, 112, 48, 0.12);
    border-radius: 7px;
    font-size: 13px;
}

.explore-event-option.active .explore-event-icon {
    color: #147361;
    background: rgba(24, 153, 132, 0.15);
}

.explore-event-name {
    min-width: 0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.explore-event-state {
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
}

.explore-event-option.active .explore-event-state {
    color: #167968;
}

.explore-event-toggle {
    appearance: none;
    position: relative;
    width: 36px;
    height: 21px;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.explore-event-toggle::before {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    content: "";
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.18s ease;
}

.explore-event-toggle:checked {
    background: #188f7c;
    border-color: #188f7c;
}

.explore-event-toggle:checked::before {
    transform: translateX(15px);
}

.explore-event-toggle:focus-visible {
    outline: 3px solid rgba(238, 112, 48, 0.35);
    outline-offset: 2px;
}

.explore-events-empty {
    margin: 2px 4px 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 768px) {
    .explore-events-toggle {
        top: 116px;
        left: 10px;
        height: 42px;
    }

    .explore-events-section {
        top: 166px;
        left: 10px;
        width: min(340px, calc(100vw - 20px));
        max-height: min(38vh, 320px);
        max-height: min(38dvh, 320px);
        padding: 9px;
    }

    .explore-events-actions {
        gap: 5px;
    }

    .explore-events-actions button {
        flex: 1 1 68px;
        min-height: 32px;
        padding: 5px 6px;
        font-size: 9px;
    }

    .explore-menu {
        max-height: min(68dvh, 560px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .explore-events-list {
        max-height: min(25dvh, 210px);
    }

    .explore-event-option {
        grid-template-columns: 26px minmax(0, 1fr) auto 42px;
        min-height: 48px;
        gap: 6px;
        padding: 6px;
    }

    .explore-event-toggle {
        width: 40px;
        height: 24px;
    }

    .explore-event-toggle::before {
        width: 18px;
        height: 18px;
    }

    .explore-event-toggle:checked::before {
        transform: translateX(16px);
    }
}


/* =========================================================
   ETIQUETAS DEL MAPA
   ========================================================= */

.map-label-layer {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;

    overflow: hidden;

    z-index: 8;
}


.map-object-label {

    position: absolute;

    display: flex;

    align-items: center;

    gap: 7px;

    padding: 7px 11px;

    border-radius: 12px;

    background: rgba(14, 86, 76, 0.96);

    border: 1px solid rgba(255, 255, 255, 0.25);

    color: #ffffff;

    font-family: 'Plus Jakarta Sans', sans-serif;

    font-size: 11px;

    font-weight: 800;

    line-height: 1;

    white-space: nowrap;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.25);

    transform:
        translate(-50%, -100%)
        translateY(-12px);

    opacity: 0;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;

    will-change: left, top, transform;
}


.map-object-label.visible {

    opacity: 1;
}


.map-object-label::after {

    content: "";

    position: absolute;

    left: 50%;

    bottom: -8px;

    width: 12px;
    height: 12px;

    background: rgba(14, 86, 76, 0.96);

    transform:
        translateX(-50%)
        rotate(45deg);

    border-right: 1px solid rgba(255, 255, 255, 0.15);

    border-bottom: 1px solid rgba(255, 255, 255, 0.15);

    z-index: -1;
}


/* Punto de la etiqueta */

.map-label-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--color-institucional-amarillo);

    box-shadow:
        0 0 0 4px rgba(243, 178, 60, 0.22);

    flex-shrink: 0;
}


/* Entradas */

.map-object-label.entrance {

    background: var(--color-institucional-naranja-oscuro);

    border-color: rgba(255, 255, 255, 0.35);

    z-index: 20;
}


.map-object-label.entrance .map-label-dot {

    background: #ffffff;

    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.18);
}


/* Categorías */

.map-object-label.infrastructure {

    border-left: 3px solid var(--color-institucional-verde);
}


.map-object-label.common {

    border-left: 3px solid var(--color-institucional-naranja);
}


.map-object-label.natural {

    border-left: 3px solid var(--color-institucional-amarillo);
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 768px) {

    .map-explore-overlay {

        top: 16px;
        right: 16px;

        gap: 8px;
    }


    .location-button {

        min-width: 165px;

        height: 48px;

        padding: 0 17px;

        font-size: 13px;

        border-radius: 14px;
    }


    .explore-wrapper {

        width: 165px;
    }


    .explore-button {

        height: 47px;

        font-size: 13px;
    }


    .explore-menu {

        width: 235px;

        right: 0;
    }


    .map-object-label {

        padding: 6px 9px;

        font-size: 9px;

        border-radius: 10px;
    }
}


@media (max-width: 480px) {
    .explore-events-toggle {
        min-width: 108px;
        height: 40px;
        font-size: 12px;
    }

    .explore-events-section {
        max-height: min(32vh, 280px);
        max-height: min(32dvh, 280px);
    }

    .explore-events-heading {
        flex-wrap: wrap;
    }

    .explore-events-heading h2 {
        flex-basis: calc(100% - 40px);
    }

    .explore-events-actions {
        flex: 1 1 100%;
    }

    .explore-events-actions button {
        flex: 1 1 100px;
    }

    .map-explore-overlay {

        top: 12px;
        right: 12px;
    }


    .location-button {

        min-width: 150px;

        height: 46px;

        font-size: 12px;
    }


    .explore-wrapper {

        width: 150px;
    }


    .explore-button {

        height: 45px;

        font-size: 12px;
    }


    .explore-menu {
        width: 225px;
    }
}

@media (max-width: 500px) and (max-height: 500px) {
    .explore-events-section {
        width: min(340px, calc(50vw - 24px));
        max-height: min(32vh, 180px);
        max-height: min(32dvh, 180px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .explore-events-toggle,
    .explore-events-toggle-arrow,
    .explore-events-section,
    .explore-events-close {
        transition: none;
    }
}


/* =========================================================
   VISOR MODAL DE IMAGEN A PANTALLA COMPLETA (LIGHTBOX)
   ========================================================= */
.image-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
    padding: 24px;
    box-sizing: border-box;
}

.image-lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.image-lightbox-modal.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/*
  Autor: Cristobal Torres Ramos
  Ano: 2026
  Version: 1.1
  Descripcion: Ajuste de componentes de la brujula para integrarlos fluidamente a los controles inferiores del mapa, igualando el diseno de los demas botones UI.
*/

/* Contenedor de la brujula integrado en flexbox */
#compass-container {
    position: relative; /* Modificado para integrarse al flujo del flexbox */
    width: 75px; /* Alineado al tamano de los botones de control */
    height: 75px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

#compass-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.05s linear;
    user-select: none;
}

/* Estilos del boton norte para igualar a los botones de la clase .ui-button */
#btn-norte {
    position: relative; /* Mantiene el orden dentro de la columna flex */
    width: 52px;
    height: 52px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    color: #1e293b;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto hover identico a la UI del mapa */
#btn-norte:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Animacion al hacer click */
#btn-norte:active {
    transform: translateY(0px);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
}

/* Ajuste de tamano responsivo para coincidir con el media query original */
@media (max-width: 768px) {
    #compass-container,
    #btn-norte {
        width: 46px; 
        height: 46px;
    }
}

/* ==================================================
   FLECHA DE DIRECCIÓN
   ================================================== */
/*
 * Contenedor de la flecha.
 * Se coloca exactamente en el centro de la imagen
 * de la brújula.
 */
#compass-arrow {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 100%;
    height: 100%;

    transform-origin: center center;

    pointer-events: none;
}


.arrow-head {

    position: absolute;

    top: 5px;
    left: 50%;

    width: 0;
    height: 0;

    transform: translateX(-50%);

    border-left: 9px solid transparent;

    border-right: 9px solid transparent;

    border-bottom: 22px solid var(--color-institucional-naranja);
}


.arrow-line {

    position: absolute;

    top: 22px;
    left: 50%;

    width: 4px;
    height: 28px;

    transform: translateX(-50%);

    background: var(--color-institucional-naranja);

    border-radius: 4px;
}












































/*
    Autor: Cristobal Torres Ramos
    Proyecto: Mapa interactivo de la UTTECAM
    Año: 2026
    Versión: 1.0
    Descripción:
    Estilos del buscador principal del mapa.
*/

#map-search-container {
    position: fixed;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    width: min(500px, calc(100vw - 40px));

    z-index: 1000;

    font-family: inherit;
}


/* ==========================================
   CAJA PRINCIPAL DEL BUSCADOR
   ========================================== */

#map-search-box {
    display: flex;

    align-items: center;

    width: 100%;
    height: 52px;

    padding: 0 14px;

    background: rgba(255, 255, 255, 0.94);

    border: 1px solid rgba(255, 255, 255, 0.7);

    border-radius: 16px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25);

    backdrop-filter: blur(12px);

    transition:
        box-shadow 0.25s ease,
        transform 0.25s ease;
}


#map-search-box:focus-within {
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.22),
        0 0 0 2px var(--primary);

    transform: translateY(-1px);
}


/* ==========================================
   ICONO
   ========================================== */

#map-search-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 30px;

    font-size: 25px;

    color: #555;

    user-select: none;
}


/* ==========================================
   INPUT
   ========================================== */

#map-search-input {
    flex: 1;

    min-width: 0;

    height: 100%;

    border: none;
    outline: none;

    background: transparent;

    padding: 0 10px;

    font-size: 15px;

    color: #222;
}


#map-search-input::placeholder {
    color: #777;
}

#map-search-input::-webkit-search-cancel-button,
#map-search-input::-webkit-search-decoration,
#map-search-input::-webkit-search-results-button,
#map-search-input::-webkit-search-results-decoration {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

#map-search-input::-ms-clear {
    display: none;
}


/* ==========================================
   BOTÓN LIMPIAR
   ========================================== */

#map-search-clear {
    display: none;

    width: 30px;
    height: 30px;

    border: none;

    border-radius: 50%;

    background: transparent;

    color: #666;

    font-size: 22px;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


#map-search-clear:hover {
    background: rgba(0, 0, 0, 0.08);

    color: #222;
}


/* ==========================================
   RESULTADOS
   ========================================== */

.map-search-results {
    display: none;

    width: 100%;

    margin-top: 8px;

    max-height: 350px;

    overflow-y: auto;

    background: rgba(255, 255, 255, 0.97);

    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);

    backdrop-filter: blur(12px);

    overflow-x: hidden;
}


.map-search-results.visible {
    display: block;
}


/* ==========================================
   ELEMENTO DE RESULTADO
   ========================================== */

.map-search-result {
    display: flex;

    flex-direction: column;

    gap: 3px;

    width: 100%;

    padding: 12px 16px;

    border: none;

    border-bottom: 1px solid rgba(0, 0, 0, 0.08);

    background: transparent;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        padding-left 0.2s ease;
}


.map-search-result:hover {
    background: rgba(24, 153, 132, 0.10);

    padding-left: 20px;
}


.map-search-result:last-child {
    border-bottom: none;
}


/* Nombre */

.map-search-result-name {
    font-size: 15px;

    font-weight: 600;

    color: #222;
}


/* Tipo */

.map-search-result-type {
    font-size: 12px;

    color: #777;
}


/* Información adicional */

.map-search-result-info {
    font-size: 12px;

    color: #555;
}


/* ==========================================
   SIN RESULTADOS
   ========================================== */

.map-search-empty {
    padding: 20px;

    text-align: center;

    font-size: 14px;

    color: #777;
}


/* ==========================================
   MÓVILES
   ========================================== */

@media (max-width: 768px) {

    #map-search-container {
        top: 12px;

        width: calc(100vw - 24px);
    }

    #map-search-box {
        height: 48px;

        border-radius: 14px;
    }

    #map-search-input {
        font-size: 14px;
    }

    .map-search-results {
        max-height: 280px;
    }
}


































/* =========================================================
   MÓVIL
   Buscador arriba
   Volver + Ubicación debajo del buscador
   Explorar debajo de Ubicación
   ========================================================= */

@media (max-width: 768px) {

    /* -----------------------------------------------------
       BUSCADOR
       ----------------------------------------------------- */

    #map-search-container {
        position: fixed;

        top: 12px;
        left: 12px;
        right: 12px;

        width: auto;
        max-width: none;

        transform: none;

        z-index: 1000;
    }

    #map-search-box {
        width: 100%;
        height: 48px;
        box-sizing: border-box;
    }


    /* -----------------------------------------------------
       BOTÓN VOLVER
       Debajo del buscador, a la izquierda
       ----------------------------------------------------- */

    .back-button-overlay {
        position: fixed;

        top: 68px;
        left: 12px;

        bottom: auto;

        z-index: 100;
    }

    .back-button-overlay .btn-secondary {
        height: 46px;
        padding: 0 15px;

        font-size: 13px;
    }


    /* -----------------------------------------------------
       UBICACIÓN + EXPLORAR
       Debajo del buscador, a la derecha
       ----------------------------------------------------- */

    .map-explore-overlay {
        position: fixed;

        top: 68px;
        right: 12px;

        bottom: auto;

        display: flex;
        flex-direction: column;
        align-items: flex-end;

        gap: 7px;

        width: auto;

        z-index: 100;
    }


    /* -----------------------------------------------------
       BOTÓN MI UBICACIÓN
       ----------------------------------------------------- */

    .location-button {
        width: 165px;
        min-width: 165px;

        height: 46px;

        padding: 0 15px;

        font-size: 13px;

        border-radius: 14px;

        box-sizing: border-box;
    }


    /* -----------------------------------------------------
       BOTÓN EXPLORAR
       Debajo de ubicación
       ----------------------------------------------------- */

    .explore-wrapper {
        width: 165px;
    }

    .explore-button {
        width: 100%;
        height: 46px;

        font-size: 13px;
    }


    /* -----------------------------------------------------
       MENÚ EXPLORAR
       ----------------------------------------------------- */

    .explore-menu {
        top: calc(100% + 7px);

        bottom: auto;
        right: 0;

        width: 235px;

        transform-origin: top right;
    }

    .explore-menu.open {
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   CELULARES PEQUEÑOS
   ========================================================= */

@media (max-width: 480px) {

    /* Buscador */
    #map-search-container {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    #map-search-box {
        height: 45px;
        border-radius: 13px;
    }

    #map-search-input {
        font-size: 13px;
    }


    /* Volver */
    .back-button-overlay {
        top: 65px;
        left: 10px;
    }

    .back-button-overlay .btn-secondary {
        height: 44px;
        padding: 0 13px;

        font-size: 12px;
    }


    /* Ubicación + Explorar */
    .map-explore-overlay {
        top: 65px;
        right: 10px;

        gap: 6px;
    }

    .location-button {
        width: 150px;
        min-width: 150px;

        height: 44px;

        font-size: 12px;
    }

    .explore-wrapper {
        width: 150px;
    }

    .explore-button {
        height: 44px;
        font-size: 12px;
    }

    .explore-menu {
        width: min(225px, calc(50vw - 20px));
        padding: 6px;
    }

    .explore-option {
        gap: 4px;
        padding: 6px 4px;
        font-size: 11px;
    }

    .explore-option-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .explore-option-text {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .explore-check {
        width: 16px;
        height: 16px;
    }
}
/* Public view for the interior floors and room locations. */
.indoor-card-section {
    margin-top: 1.1rem;
    padding-top: .9rem;
    border-top: 1px solid rgba(22, 101, 52, .18);
}

.indoor-card-section h4 { margin: 0 0 .65rem; color: #14532d; font-size: .95rem; }
.indoor-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.indoor-card-actions button {
    display: inline-flex;
    width: auto;
    min-width: 0;
    min-height: 2.75rem;
    height: auto;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .55rem .8rem;
    border: 1px solid rgba(22, 101, 52, .28);
    border-radius: 9px;
    background: #f5faf5;
    color: #14532d;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
}
.indoor-card-actions button:last-child { border-color: #e7842c; background: #fff7ed; color: #8a4310; }
.indoor-card-actions button:disabled { opacity: .55; cursor: not-allowed; }
.indoor-card-actions button:focus-visible,
.indoor-spaces-item:focus-visible,
.indoor-dialog-close:focus-visible,
.indoor-dialog-floor-label select:focus-visible {
    outline: 3px solid rgba(237, 125, 34, .55);
    outline-offset: 2px;
}
.indoor-card-actions svg {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.indoor-plan-dialog,
.indoor-spaces-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: 0;
    color: #1d3124;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 70px #0005;
    transform: translate(-50%, -50%);
}

.indoor-plan-dialog {
    width: min(94vw, 880px);
    max-width: 880px;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: auto;
    padding: 1rem;
}
.indoor-plan-dialog::backdrop,
.indoor-spaces-dialog::backdrop { background: rgba(15, 35, 22, .62); }
.indoor-plan-dialog-header,
.indoor-spaces-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.indoor-plan-dialog-header h2,
.indoor-spaces-dialog-header h2 { margin: .2rem 0 .45rem; color: #14532d; font-size: 1.2rem; }
.indoor-plan-eyebrow { color: #d66b19; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.indoor-dialog-context { margin: 0 0 .8rem; color: #53625a; font-size: .86rem; }
.indoor-dialog-close {
    display: grid;
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f4f0;
    color: #263b2d;
    font-size: 1.5rem;
    cursor: pointer;
}
.indoor-dialog-floor-label { display: grid; gap: .35rem; max-width: 22rem; margin-bottom: .8rem; font-size: .82rem; font-weight: 700; }
.indoor-dialog-floor-label select { min-height: 2.75rem; padding: .4rem .6rem; border: 1px solid #cbd5ce; border-radius: 8px; background: #fff; }
.indoor-public-plan {
    position: relative;
    display: grid;
    min-height: 5rem;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2ee;
    text-align: center;
}
.indoor-public-plan > img { display: block; width: auto; max-width: 100%; max-height: min(58dvh, 620px); height: auto; margin: 0 auto; object-fit: contain; }
.indoor-public-plan > img[hidden],
.indoor-public-markers[hidden],
.indoor-public-plan > p[hidden] { display: none; }
.indoor-public-markers { position: absolute; inset: 0; pointer-events: none; }
.indoor-public-marker { position: absolute; transform: translate(-50%, -50%); max-width: 10rem; padding: .35rem .55rem; overflow: hidden; border: 2px solid #fff; border-radius: 999px; background: #16834a; color: #fff; font-size: .75rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 8px #0006; pointer-events: auto; cursor: pointer; }
.indoor-public-marker.is-highlighted { background: #ed7d22; transform: translate(-50%, -50%) scale(1.12); }
.indoor-public-plan > p:not([hidden]) { position: absolute; inset: 50% auto auto 50%; width: calc(100% - 2rem); margin: 0; padding: 1rem; color: #53625a; transform: translate(-50%, -50%); }
.indoor-dialog-status.is-error { color: #a32626; }
.indoor-dialog-space-detail { padding-top: .75rem; }
.indoor-dialog-space-detail p { margin: .3rem 0; }
.indoor-space-photo { display: block; width: min(100%, 28rem); max-height: 18rem; margin-top: .65rem; object-fit: cover; border-radius: 10px; }

.indoor-spaces-dialog {
    width: min(92vw, 540px);
    max-width: 540px;
    max-height: 84vh;
    max-height: 84dvh;
    overflow: hidden;
    padding: 1rem;
}
.indoor-spaces-dialog:not([open]) { display: none; }
.indoor-spaces-list { max-height: min(62vh, 34rem); max-height: min(62dvh, 34rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.indoor-spaces-items { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.indoor-spaces-item {
    display: flex;
    width: 100%;
    min-height: 3.25rem;
    height: auto;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .75rem;
    border: 1px solid #dfe8e1;
    border-radius: 10px;
    background: #f8fbf8;
    color: #173c26;
    font: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
}
.indoor-spaces-item:hover { border-color: #82b997; background: #eff8f1; }
.indoor-spaces-item-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.indoor-spaces-item-floor { max-width: 42%; flex: 0 1 auto; color: #65756a; font-size: .78rem; text-align: right; overflow-wrap: anywhere; }
.indoor-spaces-empty { margin: .4rem 0 0; padding: 1rem; border-radius: 10px; background: #f5f8f5; color: #53625a; text-align: center; }

@media (max-width: 640px) {
    .indoor-plan-dialog { width: calc(100vw - 1rem); max-height: 94vh; max-height: 94dvh; padding: .8rem; }
    .indoor-spaces-dialog { width: calc(100vw - 1rem); max-height: 90vh; max-height: 90dvh; padding: .8rem; }
    .indoor-spaces-list { max-height: min(68vh, 34rem); max-height: min(68dvh, 34rem); }
    .indoor-public-plan > img { max-height: min(54dvh, 520px); }
    .indoor-public-marker { max-width: 7rem; padding: .3rem .4rem; font-size: .68rem; }
    .indoor-card-actions button { flex: 1 1 9rem; }
}