/* =========================================================
   MAPA INTERACTIVO — Parque Miguel Angel de Quevedo
   Estilos del mapa interactivo embebido en /medioambiente/mapa
   ========================================================= */

.mapa-interactivo {
    background-color: var(--color-cream, #efe7d2);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mapa-interactivo__breadcrumb {
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 4px;
    margin-bottom: 6px;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 0.01em;
}

.mapa-interactivo__breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-primary, rgb(var(--brand-burgundy)));
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mapa-interactivo__breadcrumb-link i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.mapa-interactivo__breadcrumb-link:hover,
.mapa-interactivo__breadcrumb-link:focus-visible {
    color: var(--color-gold, rgb(var(--brand-gold)));
    border-bottom-color: var(--color-gold, rgb(var(--brand-gold)));
    outline: none;
}

.mapa-interactivo__breadcrumb-link:hover i,
.mapa-interactivo__breadcrumb-link:focus-visible i {
    transform: translateX(-2px);
}

.mapa-interactivo__breadcrumb-sep {
    color: #999;
    font-weight: 400;
    user-select: none;
}

.mapa-interactivo__breadcrumb-current {
    color: #777;
    font-weight: 500;
}

.mapa-interactivo__header {
    text-align: center;
    margin-bottom: 22px;
    max-width: 1100px;
}

.mapa-interactivo__header h1 {
    font-family: var(--font-accent, 'Playfair Display', serif);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--color-primary, rgb(var(--brand-burgundy)));
    letter-spacing: -0.02em;
    margin: 0;
}

.mapa-interactivo__header p {
    margin: 6px 0 0;
    color: #4b5563;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
    font-weight: 500;
}

.mapa-interactivo__wrapper {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid rgb(var(--brand-burgundy) / 0.10);
    border-radius: 18px;
    box-shadow: 0 30px 60px -25px rgb(var(--brand-burgundy) / 0.30), 0 8px 20px -10px rgba(0, 0, 0, 0.10);
    padding: 4px;
}

/* ===== Container with new aspect ratio ===== */
.mapa-interactivo__container {
    position: relative;
    width: 100%;
    aspect-ratio: 4582 / 2981;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    cursor: grab;
    touch-action: none; /* gestionamos touch con JS */
}

.mapa-interactivo__container.is-grabbing {
    cursor: grabbing;
}

/* Wrapper que rota TODO el contenido (fondo + sprites + servicios) como unidad */
.mapa-interactivo__content {
    --map-rotation: 0deg;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: scale(1) translate(0%, 0%);
    transform-origin: center center;
    transition: transform 0.2s ease;
    will-change: transform;
}

.mapa-interactivo__content.is-panning {
    transition: none; /* sin transición durante drag */
}

/* ===== Zoom controls ===== */
.mapa-zoom {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 45;
}

.mapa-zoom__btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.15s ease, transform 0.1s ease;
    line-height: 1;
    font-family: var(--font-main, 'Montserrat', sans-serif);
}

.mapa-zoom__btn:hover {
    background: #ffffff;
    transform: scale(1.08);
}

.mapa-zoom__btn:active {
    transform: scale(0.95);
}

.mapa-zoom__btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.mapa-interactivo__imagen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.mapa-interactivo__animals-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* =========================================================
   ANIMAL SPRITES — PNG images positioned with percentages
   ========================================================= */

.mapa-sprite {
    position: absolute;
    /* left/top/width set inline; height is auto from image */
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* translate handled on inner img, container just anchors */
    transform: translate(-50%, -50%);
    font-family: inherit;
    transform-style: flat;
}

.mapa-sprite__img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transform:
        rotate(var(--sprite-rotation, 0deg))
        scale(var(--sprite-flip-x, 1), var(--sprite-flip-y, 1))
        scale(var(--sprite-hover-scale, 1));
    transform-origin: center center;
    transition: transform 0.16s ease, filter 0.16s ease;
    image-rendering: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ===== Clickable animal ===== */
.mapa-sprite--animal {
    pointer-events: auto;
    cursor: pointer;
    transition: z-index 0s;
}

.mapa-sprite--animal:hover,
.mapa-sprite--animal:focus-visible {
    z-index: 50 !important;
    outline: none;
}

.mapa-sprite--animal:hover .mapa-sprite__img,
.mapa-sprite--animal:focus-visible .mapa-sprite__img {
    --sprite-hover-scale: 1.2;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.65))
            drop-shadow(0 3px 7px rgba(0, 0, 0, 0.22))
            brightness(1.04);
}

/* ===== Sprite label (name pill) ===== */
.mapa-sprite__label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%) rotate(calc(var(--map-rotation) * -1));
    transform-origin: center center;
    font-size: clamp(8px, 0.9vw, 11px);
    font-weight: 700;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
    letter-spacing: 0.01em;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.mapa-sprite--animal:hover .mapa-sprite__label,
.mapa-sprite--animal:focus-visible .mapa-sprite__label {
    opacity: 1;
}

/* ===== Decorative sprites (no interaction) ===== */
.mapa-sprite--decorative {
    pointer-events: none;
}

/* =========================================================
   SERVICE MARKERS — still Iconify icon circles
   ========================================================= */

.mapa-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: transform 0.18s ease, filter 0.18s ease;
    z-index: 150;
}

.mapa-marker:hover,
.mapa-marker:focus-visible {
    transform: translate(-50%, -50%) scale(1.08);
    z-index: 200;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
    outline: none;
}

.mapa-marker--service .mapa-marker__icon-circle {
    width: clamp(19px, 2.1vw, 29px);
    height: clamp(19px, 2.1vw, 29px);
    border-radius: 50%;
    background: var(--accent, #2563eb);
    box-shadow:
        0 4px 10px -3px rgba(0, 0, 0, 0.35),
        0 0 0 3px #ffffff,
        0 0 0 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mapa-marker__icon-circle::before,
.mapa-marker__icon-circle::after {
    content: "";
    position: absolute;
    display: block;
}

.mapa-marker__icon-circle--entrada::before {
    width: 38%;
    height: 50%;
    border: 1.5px solid #ffffff;
    border-radius: 2px;
    left: 25%;
    top: 24%;
}

.mapa-marker__icon-circle--entrada::after {
    width: 28%;
    height: 1.5px;
    background: #ffffff;
    right: 22%;
    top: 50%;
    box-shadow: 5px -5px 0 -3px #ffffff, 5px 5px 0 -3px #ffffff;
}

.mapa-marker__icon-circle--info::before {
    content: "i";
    position: static;
    color: #ffffff;
    font: 800 clamp(11px, 1.2vw, 17px)/1 var(--font-main, 'Montserrat', sans-serif);
}

.mapa-marker__icon-circle--banos::before {
    content: "WC";
    position: static;
    color: #ffffff;
    font: 800 clamp(7px, 0.72vw, 10px)/1 var(--font-main, 'Montserrat', sans-serif);
    letter-spacing: 0.02em;
}

.mapa-marker__icon-circle--lago::before {
    content: "≈";
    position: static;
    color: #ffffff;
    font: 800 clamp(13px, 1.4vw, 19px)/1 var(--font-main, 'Montserrat', sans-serif);
}

.mapa-marker__icon-circle--lago::after {
    display: none;
}

.mapa-marker__label {
    font-size: clamp(6px, 0.54vw, 7px);
    font-weight: 700;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.95);
    padding: 1px 4px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    line-height: 1.2;
    letter-spacing: 0.01em;
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapa-marker--service .mapa-marker__label {
    background: var(--accent, #2563eb);
    color: #ffffff;
}

/* =========================================================
   LEGEND
   ========================================================= */

.mapa-leyenda {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px 26px;
    justify-content: center;
    color: #374151;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: 0.92rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgb(var(--brand-burgundy) / 0.10);
    border-radius: 14px;
    padding: 12px 18px;
}

.mapa-leyenda__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mapa-leyenda__key-animal {
    width: 22px;
    height: 18px;
    border-radius: 4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235C113C' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.7;
}

.mapa-leyenda__key-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* =========================================================
   MODAL — Animal detail popup
   ========================================================= */

.mapa-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mapa-modal.is-open {
    display: flex;
    opacity: 1;
}

.mapa-modal__card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s ease;
    border-top: 5px solid var(--accent, var(--color-primary, rgb(var(--brand-burgundy))));
}

.mapa-modal.is-open .mapa-modal__card {
    transform: scale(1) translateY(0);
}

/* ── Variante con marco de hojas (animales) ── */
.mapa-modal__card--marco {
    position: relative;
    background: #ffffff url('../../images/medioambiente/mapa/marco_hojas.svg') no-repeat center / 100% 100%;
    border: none;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35));
    width: 100%;
    max-width: 620px;
    aspect-ratio: 2048 / 1274;
    max-height: calc(100vh - 40px);
    overflow: visible;
    display: block;
}

.mapa-modal__close {
    background: #f3f4f6;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background 0.15s ease;
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.mapa-modal__close:hover,
.mapa-modal__close:focus-visible {
    background: #e5e7eb;
    outline: none;
}

.mapa-modal__card--marco .mapa-modal__close {
    position: absolute;
    top: 7%;
    right: 6.5%;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.mapa-modal__card--marco .mapa-modal__body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3%;
    height: 100%;
    padding: 9% 7.5%;
    overflow: hidden;
}

.mapa-modal__card--marco .mapa-modal__image-wrap {
    flex: 0 0 34%;
    height: 100%;
    background: transparent;
    border-radius: 0;
    margin: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mapa-modal__image-bg {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
}

.mapa-modal__card--marco .mapa-modal__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 0;
    display: block;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
}

.mapa-modal__card--marco .mapa-modal__info {
    flex: 1;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.92);
}

.mapa-modal__card--marco .mapa-modal__title,
.mapa-modal__card--marco .mapa-modal__scientific,
.mapa-modal__card--marco .mapa-modal__subtitle {
    flex: 0 0 auto;
}

.mapa-modal__card--marco .mapa-modal__description {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.mapa-modal__title {
    font-family: var(--font-accent, 'Playfair Display', serif);
    font-size: 2rem;
    font-weight: 700;
    color: #1f7a3b;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.mapa-modal__subtitle {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent, #475569);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-main, 'Montserrat', sans-serif);
}

.mapa-modal__scientific {
    margin: 0 0 6px;
    font-family: var(--font-accent, 'Playfair Display', serif);
    font-style: italic;
    font-size: 1.05rem;
    font-weight: 500;
    color: #4b7d5c;
    line-height: 1.2;
}

.mapa-modal__image-fallback {
    color: #9ca3af;
    font-size: 0.78rem;
    text-align: center;
    padding: 12px;
}

.mapa-modal__description {
    color: #374151;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 500;
}

.mapa-modal__description strong {
    color: #1f2937;
    font-weight: 700;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {
    .mapa-sprite__label {
        font-size: 7px;
        padding: 1px 4px;
        max-width: 60px;
    }

    .mapa-marker__label {
        font-size: 8px;
        padding: 1px 4px;
        max-width: 72px;
    }

    /* Marco: apila imagen arriba e info abajo en pantallas chicas */
    .mapa-modal__card--marco {
        max-width: 380px;
        aspect-ratio: auto;
        min-height: 70vh;
    }

    .mapa-modal__card--marco .mapa-modal__body {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 13% 11%;
        overflow-y: auto;
    }

    .mapa-modal__card--marco .mapa-modal__image-wrap {
        flex: 0 0 auto;
        height: 38vw;
        max-height: 200px;
    }

    .mapa-modal__title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .mapa-sprite__label,
    .mapa-marker__label {
        display: none;
    }

    .mapa-sprite--animal:hover .mapa-sprite__label,
    .mapa-sprite--animal:focus-visible .mapa-sprite__label,
    .mapa-marker:hover .mapa-marker__label,
    .mapa-marker:focus-visible .mapa-marker__label {
        display: inline-block;
    }

    .mapa-modal__card {
        max-width: 320px;
        max-height: calc(100vh - 24px);
    }

    .mapa-modal__card--marco {
        max-width: 340px;
        max-height: calc(100vh - 24px);
    }

    .mapa-modal__title {
        font-size: 1.3rem;
    }

    .mapa-modal__scientific {
        font-size: 0.95rem;
    }

    .mapa-modal__card--marco .mapa-modal__description {
        font-size: 0.85rem;
    }
}

/* =========================================================
   AVISO CTRL + SCROLL
   ========================================================= */

.mapa-zoom-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    background: rgba(0, 0, 0, 0.70);
    color: #ffffff;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    white-space: nowrap;
}

.mapa-zoom-hint.is-visible {
    opacity: 1;
}

/* =========================================================
   TÍTULO SUPERPUESTO DEL MAPA
   ========================================================= */

.mapa-titulo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding: 32px 20px 0;
}

.mapa-titulo-overlay__text {
    font-family: var(--font-accent, 'Playfair Display', serif);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
    margin: 0;
    text-align: center;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.55),
        0 1px 3px rgba(0, 0, 0, 0.40);
    background: linear-gradient(135deg, rgb(var(--brand-burgundy) / 0.72) 0%, rgba(60, 10, 38, 0.68) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 8px 22px;
    border-radius: 0 0 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   EDITOR DE SPRITES — mover / escalar / girar
   ========================================================= */

.mapa-editor-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 70;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-family: var(--font-main, 'Montserrat', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.15s ease, transform 0.1s ease;
}

.mapa-editor-toggle:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.mapa-editor-toggle.is-active {
    background: var(--color-gold, rgb(var(--brand-gold)));
    color: #1f2937;
}

.mapa-editor-toggle__label {
    line-height: 1;
}

/* Panel lateral */
.mapa-editor {
    position: absolute;
    top: 58px;
    right: 14px;
    z-index: 65;
    width: 248px;
    max-width: calc(100% - 28px);
    max-height: calc(100% - 72px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgb(var(--brand-burgundy) / 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.35);
    font-family: var(--font-main, 'Montserrat', sans-serif);
    color: #1f2937;
}

.mapa-editor[hidden] {
    display: none;
}

.mapa-editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mapa-editor__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary, rgb(var(--brand-burgundy)));
}

.mapa-editor__close {
    background: #f3f4f6;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #374151;
    transition: background 0.15s ease;
}

.mapa-editor__close:hover {
    background: #e5e7eb;
}

.mapa-editor__hint {
    margin: 0;
    padding: 14px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #6b7280;
}

.mapa-editor__hint[hidden] {
    display: none;
}

.mapa-editor__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mapa-editor__body[hidden] {
    display: none;
}

.mapa-editor__selname {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary, rgb(var(--brand-burgundy)));
    padding: 6px 8px;
    background: rgb(var(--brand-burgundy) / 0.06);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapa-editor__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mapa-editor__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mapa-editor__val {
    color: var(--color-primary, rgb(var(--brand-burgundy)));
    font-weight: 800;
}

.mapa-editor__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mapa-editor__row input[type="range"] {
    flex: 1;
    accent-color: var(--color-primary, rgb(var(--brand-burgundy)));
    min-width: 0;
}

.mapa-editor__btn {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f9fafb;
    color: #1f2937;
    border-radius: 7px;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.mapa-editor__btn:hover {
    background: #eef0f2;
}

.mapa-editor__btn--wide {
    flex: 1;
    font-size: 0.78rem;
}

.mapa-editor__btn.is-on {
    background: var(--color-gold, rgb(var(--brand-gold)));
    border-color: var(--color-gold, rgb(var(--brand-gold)));
}

.mapa-editor__btn--ghost {
    width: 100%;
    background: transparent;
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.3);
    font-size: 0.76rem;
}

.mapa-editor__btn--ghost:hover {
    background: rgba(185, 28, 28, 0.06);
}

.mapa-editor__dpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        ".    up    ."
        "left right .";
    gap: 5px;
    max-width: 130px;
}

.mapa-editor__dpad [data-act="up"]    { grid-area: up; }
.mapa-editor__dpad [data-act="left"]  { grid-area: left; }
.mapa-editor__dpad [data-act="right"] { grid-area: right; }
.mapa-editor__dpad [data-act="down"]  { grid-column: 2; }

.mapa-editor__coords {
    font-size: 0.74rem;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.mapa-editor__foot {
    padding: 12px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mapa-editor__export {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 8px;
    background: var(--color-primary, rgb(var(--brand-burgundy)));
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mapa-editor__export:hover {
    background: #45102e;
}

.mapa-editor__output {
    width: 100%;
    height: 110px;
    font-family: ui-monospace, monospace;
    font-size: 0.68rem;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 8px;
    resize: vertical;
    color: #374151;
}

.mapa-editor__output[hidden] {
    display: none;
}

/* Sprites en modo edición: seleccionables y arrastrables */
.mapa-interactivo.is-editing .mapa-sprite {
    pointer-events: auto;
    cursor: move;
}

.mapa-interactivo.is-editing .mapa-sprite__img {
    pointer-events: none;
}

.mapa-sprite.is-selected {
    outline: 2px dashed var(--color-gold, rgb(var(--brand-gold)));
    outline-offset: 3px;
    z-index: 80 !important;
}

.mapa-sprite.is-dragging {
    opacity: 0.85;
}

/* Oculta la etiqueta hover/escala mientras se edita para no estorbar */
.mapa-interactivo.is-editing .mapa-sprite--animal:hover .mapa-sprite__img {
    --sprite-hover-scale: 1;
    filter: none;
}

/* Marcadores de servicio editables (Lago, Baños, Información) */
.mapa-interactivo.is-editing .mapa-marker--service {
    cursor: move;
}

.mapa-marker.is-selected {
    outline: 2px dashed var(--color-gold, rgb(var(--brand-gold)));
    outline-offset: 3px;
    z-index: 80 !important;
}

.mapa-marker.is-dragging {
    opacity: 0.85;
}
