﻿/* Reset & Variables */
:root {
    color-scheme: dark;
    --surface-page: #0b1112;
    --surface-panel: #121a1b;
    --surface-raised: #182223;
    --surface-control: #1d292a;
    --surface-overlay: rgba(7, 13, 14, 0.78);
    --border-subtle: #2b3937;
    --shadow-color: rgba(0, 0, 0, 0.42);
    --brand-primary: #19766f;
    --brand-primary-hover: #21877f;
    --brand-secondary: #477582;
    --brand-sand: #ad8b63;
    --status-success: #168467;
    --status-warning: #b8872f;
    --status-danger: #c65359;
    --focus-ring: #72b7c0;

    --bg-dark: var(--surface-page);
    --bg-card: rgba(18, 26, 27, 0.94);
    --border-glass: rgba(169, 190, 186, 0.18);
    
    --accent-purple: var(--brand-primary);
    --accent-blue: var(--brand-secondary);
    --accent-emerald: #0ea678;
    --accent-sand: var(--brand-sand);
    --accent-sky: #9bcad3;
    --accent-purple-glow: rgba(15, 118, 110, 0.4);
    
    --text-primary: #f2f5f4;
    --text-muted: #aab6b3;
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
    color-scheme: light;
    --surface-page: #f3f6f5;
    --surface-panel: #ffffff;
    --surface-raised: #f8faf9;
    --surface-control: #e8efed;
    --surface-overlay: rgba(31, 43, 40, 0.48);
    --border-subtle: #d1dcda;
    --shadow-color: rgba(35, 54, 50, 0.16);
    --brand-primary: #116a64;
    --brand-primary-hover: #0d5b56;
    --brand-secondary: #3f6e7b;
    --brand-sand: #98744f;
    --status-success: #08765b;
    --status-warning: #976c19;
    --status-danger: #b43f48;
    --focus-ring: #256f7b;

    --bg-dark: var(--surface-page);
    --bg-card: rgba(255, 255, 255, 0.96);
    --border-glass: rgba(50, 73, 68, 0.18);
    --accent-purple: var(--brand-primary);
    --accent-blue: var(--brand-secondary);
    --accent-sand: var(--brand-sand);
    --accent-purple-glow: rgba(17, 106, 100, 0.2);
    --text-primary: #17211f;
    --text-muted: #596763;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-main);
    color: var(--text-primary);
}

.home-intro {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 12;
    width: 100%;
    height: 50vh;
    overflow: hidden;
    background: #071312;
}

.home-intro.hidden {
    display: none;
}

.home-slides,
.home-slide {
    position: absolute;
    inset: 0;
}

.home-slide {
    visibility: hidden;
    opacity: 0;
    background-color: #142725;
    background-image: var(--home-slide-image-desktop);
    background-position: var(--home-slide-position-desktop, center center);
    background-repeat: no-repeat;
    background-size: cover;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.home-slide.active {
    visibility: visible;
    opacity: 1;
}

.home-slide-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3, 12, 12, 0.93) 0%, rgba(3, 12, 12, 0.72) 50%, rgba(3, 12, 12, 0.16) 100%);
}

.home-slide-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 84px 28px 62px;
}

.home-slide-eyebrow {
    margin: 0 0 6px;
    color: #5eead4;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-slide-copy h1 {
    max-width: 690px;
    margin: 0;
    color: #fff;
    font-size: 2rem;
    line-height: 1.08;
}

.home-slide-description {
    max-width: 650px;
    margin: 9px 0 0;
    color: #d8e2e0;
    font-size: 0.95rem;
    line-height: 1.42;
}

.home-enter-map {
    position: absolute;
    right: 22px;
    bottom: 17px;
    min-height: 42px;
    padding: 9px 17px;
    border: 1px solid #5eead4;
    border-radius: 6px;
    background: #0f766e;
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
}

.home-enter-map:hover,
.home-enter-map:focus-visible {
    background: #14877d;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.home-slide-navigation {
    position: absolute;
    z-index: 3;
    left: 22px;
    bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-slide-arrow {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 50%;
    background: rgba(7, 19, 18, 0.78);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.home-slide-dots {
    display: flex;
    gap: 7px;
}

.home-slide-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.home-slide-dot.active {
    background: #5eead4;
    border-color: #5eead4;
}

body.home-intro-visible .map-location-controls {
    display: none;
}

@media (max-width: 640px) {
    .home-slide {
        background-image: var(--home-slide-image-mobile);
        background-position: var(--home-slide-position-mobile, center center);
    }

    .home-slide-shade {
        background: linear-gradient(0deg, rgba(3, 12, 12, 0.95) 0%, rgba(3, 12, 12, 0.7) 62%, rgba(3, 12, 12, 0.18) 100%);
    }

    .home-slide-copy {
        width: 100%;
        padding: 74px 18px 64px;
    }

    .home-slide-copy h1 {
        max-width: 100%;
        font-size: 1.45rem;
        line-height: 1.12;
    }

    .home-slide-description {
        max-width: 100%;
        margin-top: 7px;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .home-slide-eyebrow {
        font-size: 0.68rem;
    }

    .home-enter-map {
        right: 14px;
        bottom: 14px;
        min-height: 38px;
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .home-slide-navigation {
        left: 14px;
        bottom: 16px;
        gap: 6px;
    }

    .home-slide-arrow {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
}

.location-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 12, 12, 0.76);
    backdrop-filter: blur(8px);
}

.location-welcome-dialog {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid rgba(94, 234, 212, 0.28);
    border-radius: 8px;
    background: #0b1f1d;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
    text-align: center;
}

.location-welcome-header {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 62px;
    align-items: center;
    width: 100%;
    min-height: 64px;
}

.location-language-select {
    position: static;
    grid-column: 3;
    justify-self: end;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    height: 40px;
    margin: 0 !important;
    padding: 8px 9px;
    border: 1px solid #3c5552;
    border-radius: 6px;
    background: #142725;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.location-language-select option {
    background: #142725;
    color: #fff;
}

html[data-theme="light"] .location-language-select {
    border-color: #cbd8d5;
    background: #f4f7f6;
    color: #17211f;
    color-scheme: light;
}

html[data-theme="light"] .location-language-select option {
    background: #fff;
    color: #17211f;
}

.location-welcome-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.location-welcome-eyebrow {
    margin: 14px 0 5px;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.location-welcome-dialog h1 {
    margin: 0;
    color: #fff;
    font-size: 1.65rem;
    line-height: 1.15;
}

.location-welcome-dialog > p:not(.location-welcome-eyebrow) {
    color: #c4cfcd;
    line-height: 1.5;
}

.location-welcome-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.location-choice-btn {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.location-choice-btn img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.location-choice-btn span {
    min-width: 0;
}

.location-choice-btn strong,
.location-choice-btn small {
    display: block;
}

.location-choice-btn strong {
    font-size: 1rem;
}

.location-choice-btn small {
    margin-top: 3px;
    color: #d5dfdd;
    font-size: 0.78rem;
    line-height: 1.35;
}

.location-choice-primary {
    background: #0f766e;
    border-color: #2dd4bf;
}

.location-choice-secondary {
    background: #182826;
    border-color: #3c5552;
}

.location-choice-btn:hover,
.location-choice-btn:focus-visible {
    border-color: #99f6e4;
    outline: 2px solid transparent;
    filter: brightness(1.08);
}

.location-welcome-privacy {
    margin: 16px 0 0;
    font-size: 0.78rem;
}

.location-welcome-status {
    margin: 12px 0 0;
    padding: 9px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 6px;
    background: rgba(127, 29, 29, 0.2);
    color: #fecaca !important;
    font-size: 0.82rem;
}

@media (max-width: 480px) {
    .location-welcome-overlay {
        align-items: end;
        padding: 12px;
    }

    .location-welcome-dialog {
        padding: 20px 16px;
    }

    .location-welcome-dialog h1 {
        font-size: 1.45rem;
    }
}

/* Pantalla de Bienvenida */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: radial-gradient(circle at center, #1e1b4b 0%, #090a0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

.welcome-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.welcome-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 40px 30px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
                0 0 40px rgba(139, 92, 246, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-card.wide {
    max-width: 580px;
    padding: 42px 30px 30px 30px;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.brand {
    margin-bottom: 12px;
}

.logo-icon {
    position: relative;
    width: 52px;
    height: 52px;
    background: rgba(139, 92, 246, 0.1);
    border: 1.5px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
}

.logo-icon svg {
    width: 26px;
    height: 26px;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
    animation: welcomePulse 2.5s infinite;
}

@keyframes welcomePulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.welcome-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.setup-controls {
    width: 100%;
    text-align: left;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

select {
    width: 100%;
    background: #14151e; /* Fondo oscuro sólido para evitar que el navegador use blanco */
    border: 1.5px solid var(--border-glass);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}

select:focus {
    border-color: var(--accent-purple);
    background: #1c1d29;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

select option {
    background-color: #14151e; /* Fondo oscuro para las opciones */
    color: var(--text-primary); /* Texto claro para legibilidad */
}

/* Sección de Selección de Rutas */
.routes-selection-section {
    width: 100%;
    text-align: left;
    margin-top: 15px;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.routes-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Tarjeta de Ruta */
.route-card {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid var(--border-glass);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    align-items: center;
}

.route-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.route-card.selected {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.route-thumbnail {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.route-info {
    flex-grow: 1;
}

.route-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.route-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 6px;
}

.route-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.badge.cat {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

.badge.difficulty {
    color: #c084fc;
    background: rgba(167, 139, 250, 0.1);
}

.badge.duration {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}

.cta-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-family: var(--font-main);
    font-size: 1.05rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px -5px var(--accent-purple-glow);
    transition: all 0.3s;
}

.cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px var(--accent-purple-glow);
}

.cta-button:active:not(:disabled) {
    transform: translateY(1px);
}

.cta-button:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    border: 1px dashed var(--border-glass);
}

.cta-button svg {
    width: 16px;
    height: 16px;
}

/* Mapa */
#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.leaflet-container {
    background: var(--bg-dark);
}

.leaflet-top.leaflet-left {
    top: 15px;
    left: 15px;
}

.leaflet-bar {
    border: 1px solid var(--border-glass) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-glass) !important;
}

.leaflet-bar a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dashboard Panel */
.dashboard-panel {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 90%;
    max-width: 480px;
    z-index: 999;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 
                inset 0 1px 0 rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 520px;
    max-height: 520px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.4s, 
                max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-panel.hidden {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
}

.dashboard-panel.collapsed {
    max-height: 48px !important;
    height: 48px !important;
    padding: 6px 16px !important;
    gap: 0 !important;
}

.drag-handle {
    width: 40px;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    align-self: center;
    margin-bottom: -5px;
    cursor: pointer;
    transition: background 0.3s;
}

.drag-handle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.gps-status-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-indicator.live {
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
    animation: gpsPulse 2s infinite;
}

.status-indicator.simulating {
    background-color: var(--accent-purple);
    box-shadow: 0 0 8px var(--accent-purple);
}

.status-indicator.error {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes gpsPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.simulation-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-badge {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
}

.sim-badge.active {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border-color: rgba(139, 92, 246, 0.3);
}

/* Interruptor Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--accent-purple);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Tarjeta de Progreso de la Ruta */
.route-progress-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.route-progress-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.route-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.route-active-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.route-active-steps {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.route-progress-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Reproductor de Audio Card */
.audio-player-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.poi-info h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.poi-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.media-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.media-badges.hidden {
    display: none !important;
}

.media-access-link {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.08);
    color: #dbeafe;
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.media-access-link:hover,
.media-access-link:focus-visible {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.42);
}

.media-access-label {
    font-weight: 800;
    white-space: nowrap;
}

.media-access-arrow {
    margin-left: auto;
    font-size: 1rem;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.055);
    color: #e5e7eb;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.media-badge .media-badge-icon {
    font-size: 0.84rem;
    line-height: 1;
}

.media-badge.photo {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.24);
}

.media-badge.video {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(251, 113, 133, 0.24);
}

.media-badge.panorama {
    color: #ddd6fe;
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(167, 139, 250, 0.28);
}

.media-badge.audio {
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.24);
}

.media-badges.compact {
    margin-top: 2px;
    gap: 5px;
}

.media-badges.compact .media-badge {
    min-height: 21px;
    padding: 3px 7px;
    font-size: 0.68rem;
}

.media-strip {
    margin-top: 0;
    margin-bottom: 2px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    flex-shrink: 0;
}

.route-start-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.route-start-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.route-view-map-btn {
    min-width: 112px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(45, 212, 191, 0.42);
    border-radius: 10px;
    background: var(--accent-teal, #0f766e);
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.route-view-map-btn:hover,
.route-view-map-btn:focus-visible {
    filter: brightness(1.08);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.route-view-map-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.dashboard-panel.route-guidance-mode .dashboard-tabs {
    display: none !important;
}

.dashboard-panel.route-guidance-mode .dashboard-tabs-content {
    overflow-y: auto;
}

@media (max-width: 380px) {
    .route-start-actions {
        grid-template-columns: 1fr;
    }

    .route-view-map-btn {
        width: 100%;
    }
}

.route-start-image {
    width: 112px;
    height: 132px;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.route-start-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.route-start-kicker {
    color: var(--accent-purple);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.route-start-card h3 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    line-height: 1.15;
}

.route-start-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.route-auto-narration {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    background: rgba(20, 184, 166, 0.09);
    border-radius: 10px;
    padding: 7px 9px;
    cursor: pointer;
}

.route-auto-narration-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.route-auto-narration-copy strong {
    color: #e6fffb;
    font-size: 0.8rem;
}

.route-auto-narration-copy small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.route-auto-narration input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.route-auto-narration-switch {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #4b5563;
    transition: background 0.2s ease;
}

.route-auto-narration-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.route-auto-narration input:checked + .route-auto-narration-switch {
    background: #14b8a6;
}

.route-auto-narration input:checked + .route-auto-narration-switch::after {
    transform: translateX(16px);
}

.route-auto-narration input:focus-visible + .route-auto-narration-switch {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.audio-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    height: 50px;
}

/* Ondas de Audio */
.audio-waves {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.audio-waves span {
    display: block;
    width: 3px;
    height: 4px;
    background: linear-gradient(to top, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
    transition: height 0.2s ease;
}

.audio-waves.playing span {
    animation: waveMotion 1.2s ease infinite;
}

.audio-waves.playing span:nth-child(1) { animation-delay: 0.1s; }
.audio-waves.playing span:nth-child(2) { animation-delay: 0.4s; }
.audio-waves.playing span:nth-child(3) { animation-delay: 0.2s; }
.audio-waves.playing span:nth-child(4) { animation-delay: 0.5s; }
.audio-waves.playing span:nth-child(5) { animation-delay: 0.3s; }

@keyframes waveMotion {
    0%, 100% { height: 4px; }
    50% { height: 24px; }
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.play {
    background: white;
    color: black;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.action-btn.play:hover:not(:disabled) {
    transform: scale(1.08);
}

.action-btn.generate-audio {
    width: min(230px, 58vw);
    min-width: 178px;
    height: 44px;
    border-radius: 12px;
    padding: 0 14px;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.1;
    box-shadow: 0 5px 18px rgba(139, 92, 246, 0.32);
}

.action-btn.generate-audio:hover:not(:disabled) {
    transform: translateY(-1px);
}

.action-btn.generate-audio .generate-audio-label {
    display: inline-block;
    white-space: normal;
}

.action-btn.generate-audio svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.action-btn.stop {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1.5px solid rgba(239, 68, 68, 0.35);
}

.action-btn.stop:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.08);
}

.action-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
    cursor: not-allowed;
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.hidden {
    display: none !important;
}

/* Caja de Narración Colapsable */
.narration-box {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    margin-top: 4px;
}

.narration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.narration-header svg {
    transition: transform 0.3s;
}

.narration-header.open svg {
    transform: rotate(180deg);
}

.narration-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #d1d5db;
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.narration-header.open + .narration-content {
    max-height: 150px;
    overflow-y: auto;
}

/* Footer del Dashboard */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.mini-control {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.mini-control select {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    width: auto;
}

.premium-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-switch span {
    font-weight: 500;
}

/* Switch Pequeño */
.switch-small {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.switch-small input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-small {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border: 1px solid var(--border-glass);
}

.slider-small:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}

input:checked + .slider-small {
    background-color: var(--accent-emerald);
}

input:checked + .slider-small:before {
    transform: translateX(14px);
}

.slider-small.round {
    border-radius: 18px;
}

.slider-small.round:before {
    border-radius: 50%;
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.btn-text-link:hover {
    color: var(--accent-purple);
}

.mobile-simulation-slot {
    display: none;
}

/* Banner de Simulación */
.sim-banner {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    background: rgba(139, 92, 246, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    max-width: min(78vw, 360px);
    pointer-events: none;
    text-align: center;
    backdrop-filter: blur(8px);
    animation: fadeInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Marcadores personalizados */
.user-marker {
    background: radial-gradient(circle, #3b82f6 30%, rgba(59, 130, 246, 0.2) 70%);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

.user-marker.simulating {
    background: radial-gradient(circle, #8b5cf6 30%, rgba(139, 92, 246, 0.2) 70%);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
}

/* Enlace al Panel Admin */
#admin-panel-link {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 997;
    background: rgba(20, 21, 30, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s;
}

#admin-panel-link:hover {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Ajustes responsivos */
@media (max-width: 480px), (max-height: 850px) {
    .welcome-card {
        padding: 25px 20px;
    }
    .welcome-card.wide {
        padding: 20px;
    }
    .dashboard-panel {
        bottom: 12px;
        width: 92%;
        padding: 14px 16px;
        gap: 10px;
    }
    .dashboard-panel:not(.collapsed) {
        height: 60vh;
        max-height: 60vh;
        overflow-y: hidden;
    }
    .audio-player-card {
        padding: 12px;
        gap: 8px;
    }
    .poi-info h2 {
        font-size: 1.05rem;
    }
    .poi-info p {
        font-size: 0.9rem;
    }
    .poi-gallery {
        min-height: 180px;
        max-height: 220px;
    }
    .gallery-slide {
        height: 100% !important;
    }
    .gallery-nav-btn {
        opacity: 1;
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
        background: rgba(7, 19, 18, 0.78);
        border-color: rgba(255, 255, 255, 0.24);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }
    .gallery-nav-btn.prev {
        left: 10px;
    }
    .gallery-nav-btn.next {
        right: 10px;
    }
    .chat-close-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    #poi-chat-window {
        height: 100% !important;
        max-height: none !important;
        min-height: 0;
    }
    .dashboard-footer {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px 8px !important;
        align-items: center;
    }
    .dashboard-footer .mini-control {
        width: 100%;
        justify-content: flex-start;
    }
    .dashboard-footer #btn-change-route {
        text-align: right;
        display: block;
        margin-left: auto;
    }
    .routes-grid {
        max-height: 260px;
    }
    .route-card {
        padding: 8px;
        gap: 10px;
    }
    .route-thumbnail {
        width: 50px;
        height: 50px;
    }
}

/* Chips de Filtro de Rutas */
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--border-glass);
    border-radius: 20px;
    padding: 5px 14px;
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: rgba(139, 92, 246, 0.5);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.filter-chip.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Galería de imágenes del POI */
.poi-gallery {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    /* Altura dinámica: ocupa el espacio disponible */
    flex: 1;
    min-height: 200px;
    max-height: 340px;
}

.poi-gallery.hidden {
    display: none !important;
}

.media-gallery-toolbar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.media-gallery-toolbar.hidden {
    display: none !important;
}

.media-gallery-toolbar .media-strip {
    min-width: 0;
}

.media-position-status {
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 750;
    text-align: center;
    text-transform: capitalize;
}

.media-position-status.hidden {
    display: none !important;
}

.media-step-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(7, 19, 18, 0.72);
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.media-step-btn:hover {
    background: var(--accent-purple);
    border-color: rgba(255, 255, 255, 0.28);
}

.gallery-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 100%;
    flex: 1; /* Fill parent flex container */
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-track img {
    width: 100%;
    min-width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    scroll-snap-align: start;
    flex-shrink: 0;
    display: block;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    z-index: 10;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: background 0.3s, transform 0.2s;
    cursor: pointer;
}

.gallery-dot:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.3);
}

.gallery-dot.active {
    background: white;
    transform: scale(1.1);
}

/* Botones de navegación del slideshow (Desktop) */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
    outline: none;
    padding: 0;
    opacity: 0;
}

.poi-gallery:hover .gallery-nav-btn {
    opacity: 1;
}

.gallery-nav-btn:hover {
    background: var(--accent-purple);
    transform: translateY(-50%) scale(1.1);
    color: white;
}

.gallery-nav-btn.prev {
    left: 8px;
}

.gallery-nav-btn.next {
    right: 8px;
}

/* Soporte Drag-and-drop en administración */
.preview-thumb {
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.preview-thumb.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 1px dashed var(--accent-purple) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Estilos de audio embebido */
.audio-slide audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.85);
}

.audio-slide audio {
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Tarjeta de Bienvenida al POI */
.poi-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.4s, visibility 0.4s;
    /* Pasar los clics del fondo al mapa (importante para modo simulador) */
    pointer-events: none;
}

/* Campañas contextuales: aviso no bloqueante que desciende desde arriba. */
.geo-campaign-popup {
    position:fixed;
    top:max(14px, env(safe-area-inset-top));
    right:18px;
    z-index:12500;
    width:min(440px, calc(100vw - 28px));
    max-height:min(33vh, 300px);
    display:grid;
    grid-template-columns:118px minmax(0,1fr);
    overflow:hidden;
    border:1px solid rgba(45,212,191,.42);
    border-radius:8px;
    background:#0b201e;
    color:#f8fafc;
    box-shadow:0 18px 44px rgba(0,0,0,.42);
    opacity:0;
    transform:translateY(calc(-100% - 24px));
    transition:transform .34s ease, opacity .25s ease;
}
.geo-campaign-popup[hidden] { display:none; }
.geo-campaign-popup.is-visible { opacity:1;transform:translateY(0); }
.geo-campaign-image { width:118px;height:100%;min-height:148px;object-fit:cover;background:#15312e; }
.geo-campaign-image.is-empty { display:none; }
.geo-campaign-image.is-empty + .geo-campaign-content { grid-column:1 / -1; }
.geo-campaign-content { min-width:0;padding:17px 42px 16px 16px;overflow:auto; }
.geo-campaign-label {
    display:block;margin-bottom:5px;color:#5eead4;
    font-size:.68rem;font-weight:800;text-transform:uppercase;
}
.geo-campaign-content h2 { margin:0 0 6px;font-size:1.08rem;line-height:1.2;letter-spacing:0; }
.geo-campaign-content p { margin:0 0 12px;color:#cbd5e1;font-size:.84rem;line-height:1.45; }
.geo-campaign-link {
    display:inline-flex;align-items:center;justify-content:center;
    min-height:38px;padding:0 15px;border-radius:7px;
    background:#178c82;color:#fff;text-decoration:none;font-size:.82rem;font-weight:800;
}
.geo-campaign-close {
    position:absolute;top:8px;right:8px;width:34px;height:34px;
    display:grid;place-items:center;border:1px solid rgba(255,255,255,.14);
    border-radius:50%;background:rgba(0,0,0,.28);color:#fff;cursor:pointer;
}
.geo-campaign-close svg { fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round; }
@media (max-width:600px) {
    .geo-campaign-popup {
        top:max(8px, env(safe-area-inset-top));right:8px;
        width:calc(100vw - 16px);max-height:33vh;
        grid-template-columns:92px minmax(0,1fr);
    }
    .geo-campaign-image { width:92px;min-height:132px; }
    .geo-campaign-content { padding:14px 39px 13px 13px; }
    .geo-campaign-content h2 { font-size:1rem; }
    .geo-campaign-content p { font-size:.8rem; }
}

/* Encuesta breve: comparte el lenguaje de las campañas, sin bloquear el mapa. */
.experience-survey-popup {
    position:fixed;
    top:max(14px, env(safe-area-inset-top));
    right:18px;
    z-index:12600;
    width:min(430px, calc(100vw - 28px));
    padding:18px;
    border:1px solid rgba(45,212,191,.42);
    border-radius:8px;
    background:#0b201e;
    color:#f8fafc;
    box-shadow:0 18px 44px rgba(0,0,0,.42);
    opacity:0;
    transform:translateY(calc(-100% - 24px));
    transition:transform .3s ease, opacity .24s ease;
}
.experience-survey-popup[hidden] { display:none; }
.experience-survey-popup.is-visible { opacity:1;transform:translateY(0); }
.experience-survey-head { display:flex;align-items:center;justify-content:space-between;margin-bottom:3px; }
.experience-survey-progress {
    color:#5eead4;font-size:.72rem;font-weight:800;text-transform:uppercase;
}
.experience-survey-close {
    width:32px;height:32px;display:grid;place-items:center;
    border:1px solid rgba(255,255,255,.14);border-radius:50%;
    background:rgba(0,0,0,.24);color:#fff;cursor:pointer;
}
.experience-survey-close svg { fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round; }
.experience-survey-popup h2 { margin:0 0 5px;font-size:1.12rem;line-height:1.2;letter-spacing:0; }
.experience-survey-intro { margin:0 0 14px;color:#aabbb8;font-size:.78rem;line-height:1.4; }
.experience-survey-question { margin:0 0 10px;color:#f8fafc;font-size:.94rem;font-weight:750;line-height:1.35; }
.experience-survey-options { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px; }
.experience-survey-option {
    min-height:44px;padding:7px;border:1px solid rgba(255,255,255,.16);
    border-radius:7px;background:#15312e;color:#e7efed;
    font:inherit;font-size:.75rem;font-weight:700;line-height:1.2;cursor:pointer;
}
.experience-survey-option[aria-pressed="true"] {
    border-color:#5eead4;background:#167f76;color:#fff;
}
.experience-survey-status { min-height:20px;padding-top:7px;color:#5eead4;font-size:.76rem;font-weight:700; }
.experience-survey-status.error { color:#fca5a5; }
.experience-survey-actions { display:flex;justify-content:flex-end;gap:8px;margin-top:4px; }
.experience-survey-later,.experience-survey-next {
    min-height:38px;padding:0 14px;border-radius:7px;font:inherit;font-size:.78rem;font-weight:800;cursor:pointer;
}
.experience-survey-later { border:1px solid rgba(255,255,255,.14);background:transparent;color:#cbd5e1; }
.experience-survey-next { border:0;background:#178c82;color:#fff; }
.experience-survey-next:disabled { opacity:.42;cursor:not-allowed; }
html[data-theme="light"] .experience-survey-popup {
    background:#ffffff;
    color:#172321;
    border-color:#9ecbc5;
    box-shadow:0 18px 44px rgba(30,50,47,.2);
}
html[data-theme="light"] .experience-survey-popup h2,
html[data-theme="light"] .experience-survey-question { color:#172321; }
html[data-theme="light"] .experience-survey-intro { color:#5f6f6c; }
html[data-theme="light"] .experience-survey-close {
    background:#f4f7f6;
    color:#172321;
    border-color:#cfdad8;
}
html[data-theme="light"] .experience-survey-option {
    background:#f5f8f7;
    color:#243330;
    border-color:#cbd8d5;
}
html[data-theme="light"] .experience-survey-option:hover,
html[data-theme="light"] .experience-survey-option[aria-pressed="true"] {
    color:#075f57;
    background:#dff5f1;
    border-color:#178c82;
}
html[data-theme="light"] .experience-survey-later {
    color:#43524f;
    border-color:#cbd8d5;
}
@media (max-width:600px) {
    .experience-survey-popup {
        top:max(8px, env(safe-area-inset-top));right:8px;
        width:calc(100vw - 16px);padding:15px;
    }
    .experience-survey-options { grid-template-columns:1fr; }
    .experience-survey-option { min-height:40px;text-align:left;padding:9px 11px; }
}

.poi-welcome-card {
    /* Restaurar interacción en la tarjeta en sí */
    pointer-events: auto;
}

.poi-welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.poi-welcome-card {
    background: #14151e;
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(139,92,246,0.2);
    animation: slideUpCard 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpCard {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.welcome-poi-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.welcome-card-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: rgba(139, 92, 246, 0.15);
}

.welcome-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, #14151e, transparent);
}

.welcome-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.3s;
}

.welcome-close-btn:hover {
    background: rgba(0,0,0,0.8);
}

.welcome-card-body {
    padding: 16px 20px 22px;
}

.welcome-card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-purple);
    margin-bottom: 6px;
}

.welcome-card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.welcome-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.welcome-card-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 13px 20px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.35);
}

.welcome-card-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

/* Botón de Chat en Controles de Audio */
.action-btn.chat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--accent-purple);
    box-shadow: none;
}

.action-btn.chat:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    transform: scale(1.05);
}

.dashboard-panel.chat-open {
    z-index: 2000 !important;
}

/* Ventana de Chat Integrada en Lengüetas */
.poi-chat-window {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Cabecera del Chat */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.chat-header-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.chat-status {
    font-size: 0.72rem;
    color: var(--accent-emerald);
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.chat-status::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-emerald);
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* Contenedor de Mensajes */
.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar para el Chat */
.chat-messages-container::-webkit-scrollbar {
    width: 4px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Burbujas de Chat */
.chat-bubble {
    max-width: 82%;
    padding: 12px 16px;
    font-size: 1.05rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-bubble.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7c3aed 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.chat-bubble-text {
    display: block;
    white-space: pre-wrap;
}

.chat-source-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid rgba(45, 212, 191, 0.38);
    border-radius: 6px;
    color: #7dd3c7;
    background: rgba(15, 118, 110, 0.16);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.chat-source-link:hover,
.chat-source-link:focus-visible {
    color: #fff;
    border-color: #2dd4bf;
    background: rgba(15, 118, 110, 0.3);
}

/* Área de Entrada del Chat */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-area input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.chat-input-area input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.chat-input-area button {
    background: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 14px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

.chat-input-area button:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.35);
}

/* Indicador de Escritura de la IA */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 18px 10px;
    color: var(--text-muted);
}

.chat-typing-indicator p {
    font-size: 0.72rem;
    margin: 0 0 0 6px;
    font-weight: 500;
}

.chat-typing-indicator span {
    display: block;
    width: 5px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ==========================================================================
   Nuevas Funcionalidades: Favoritos, Logros, Mini-Mapa y Estadísticas Admin
   ========================================================================== */

/* Botón de Logros */
#btn-open-achievements:hover {
    transform: scale(1.1) rotate(5deg);
    background: rgba(245, 158, 11, 0.25) !important;
}

/* Botón de Favoritos en Ruta */
.fav-route-btn:hover {
    transform: scale(1.15) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fbbf24 !important;
}

.fav-route-btn.active {
    animation: favPulse 0.3s ease-out;
}

@keyframes favPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Contenedor del Mini-Mapa Activo */
#active-minimap-container:not(.hidden) {
    animation: slideDownFade 0.3s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Marcadores del Mini-Mapa Activo */
.active-poi-marker {
    transition: transform 0.2s;
}

.route-number-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--route-marker-color, #8b5cf6);
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

/* Grid de Estadísticas Admin */
.stats-grid {
    margin-bottom: 20px;
}

.stats-card {
    transition: transform 0.2s, border-color 0.2s;
}

.stats-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.3) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* Controles flotantes de ubicación y caminata virtual */
.map-location-controls {
    position: fixed;
    right: 16px;
    bottom: calc(50vh + 16px);
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1), right 0.3s ease;
}

.map-location-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 24, 27, 0.9);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-glass);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease-in-out, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    padding: 2px;
    overflow: hidden;
}

.map-location-btn img {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    pointer-events: none;
}

.map-location-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.map-location-btn:active {
    transform: scale(0.95);
}

.map-location-btn.hidden {
    display: none;
}

.virtual-walk-control {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.simulation-map-btn {
    font-size: 0;
}

.simulation-map-btn.active {
    background: #0f9f91;
    border-color: #75e2d7;
    box-shadow: 0 0 0 4px rgba(15, 159, 145, 0.18), 0 5px 18px rgba(0, 0, 0, 0.4);
}

.recenter-map-btn.active {
    background: #1976d2;
    border-color: #90caf9;
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.18), 0 5px 18px rgba(0, 0, 0, 0.4);
}

.simulation-map-btn.active img {
    filter: saturate(1.12) brightness(1.08);
}

.virtual-walk-coachmark {
    position: absolute;
    right: 54px;
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: min(210px, calc(100vw - 92px));
    padding: 8px 11px;
    border-radius: 7px;
    background: #0f9f91;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    animation: virtualWalkHintIn 0.3s ease both;
}

.virtual-walk-coachmark::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #0f9f91;
    transform: translateY(-50%) rotate(45deg);
}

.virtual-walk-coachmark.hidden {
    display: none;
}

@keyframes virtualWalkHintIn {
    from { opacity: 0; transform: translate(-8px, -50%); }
    to { opacity: 1; transform: translate(0, -50%); }
}

/* Modificación de comportamiento cuando la ruta está activa */
body.route-active .map-location-controls {
    bottom: 220px;
}

/* Rediseño del Layout General Split (50/50) */
.map-floating-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.header-logo {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-actions {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.compact-select {
    background: var(--bg-card) !important;
    backdrop-filter: blur(16px) !important;
    border: 1.5px solid var(--border-glass) !important;
    border-radius: 12px !important;
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
    color: white !important;
    width: auto !important;
    min-width: 60px !important;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hamburger-btn {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1.5px solid var(--border-glass);
    border-radius: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: all 0.2s;
    outline: none;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Modificación de comportamiento de mapa Leaflet (#map) */
#map {
    width: 100%;
    height: 50vh !important; /* Inicia en el 50% */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), height 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.route-active #map {
    height: 100vh !important; /* Se expande a pantalla completa */
}

body.route-active .home-intro {
    display: none !important;
}

@media (min-width: 1024px) and (min-height: 700px) {
    :root {
        --desktop-route-panel-width: clamp(400px, 31vw, 520px);
        --desktop-route-panel-gap: 18px;
    }

    body.route-active #map {
        width: calc(100% - var(--desktop-route-panel-width) - var(--desktop-route-panel-gap) * 2) !important;
        height: 100vh !important;
    }

    body.route-active .dashboard-panel {
        top: var(--desktop-route-panel-gap);
        right: var(--desktop-route-panel-gap);
        bottom: var(--desktop-route-panel-gap);
        left: auto;
        transform: none;
        width: var(--desktop-route-panel-width);
        max-width: none;
        height: auto;
        max-height: none;
        padding: 18px;
        border-radius: 18px;
        gap: 12px;
    }

    body.route-active .dashboard-panel.hidden {
        transform: translateX(calc(100% + var(--desktop-route-panel-gap)));
    }

    body.route-active .dashboard-panel.collapsed {
        top: auto;
        height: 50px !important;
        max-height: 50px !important;
    }

    body.route-active .map-floating-header {
        width: calc(100% - var(--desktop-route-panel-width) - var(--desktop-route-panel-gap) * 2);
    }

    body.route-active .map-location-controls {
        right: calc(var(--desktop-route-panel-width) + var(--desktop-route-panel-gap) * 2);
        bottom: 22px;
    }

    body.route-active .dashboard-tabs {
        flex-wrap: wrap;
        overflow: visible;
        padding-right: 0;
        -webkit-mask-image: none;
        mask-image: none;
    }

    body.route-active .tab-btn {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
        padding: 8px 10px;
    }

    body.route-active .route-start-card {
        grid-template-columns: 128px 1fr;
    }

    body.route-active .route-start-image {
        width: 128px;
        height: 150px;
    }

    body.route-active #tab-chat {
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    body.route-active #poi-chat-window {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0;
        overflow: hidden;
    }

    body.route-active #poi-chat-window .chat-header,
    body.route-active #poi-chat-window .chat-input-area,
    body.route-active #poi-chat-window .chat-typing-indicator {
        flex-shrink: 0;
    }

    body.route-active #poi-chat-window .chat-messages-container {
        flex: 1 1 auto;
        min-height: 0;
    }
}

/* Panel inferior del catálogo */
.catalog-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50vh;
    background: #090a0f; /* Color sólido ultra oscuro premium */
    border-top: 1.5px solid var(--border-glass);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.route-active .catalog-panel {
    transform: translateY(100%) !important;
    visibility: hidden;
    pointer-events: none;
}

/* Grid de 2 columnas */
.routes-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}


@media (max-width: 480px) {
    .routes-grid-2col {
        gap: 8px;
    }
}

/* Tarjeta Vertical Premium de Ruta */
.route-card-vertical {
    background: #12131b;
    border: 1.5px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
    text-align: left;
}

.route-card-vertical:hover {
    transform: translateY(-2px);
    border-color: var(--accent-purple);
    box-shadow: 0 4px 15px rgba(139,92,246,0.15);
}

.route-card-vertical.selected {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139,92,246,0.25);
    background: rgba(139, 92, 246, 0.04);
}

.route-card-img-container {
    position: relative;
    width: 100%;
    height: 100px;
    background: #0d0e13;
    flex-shrink: 0;
}

.route-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.route-card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 8px;
}

.route-card-badge-top {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.route-card-badge-bottom {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.route-card-badge {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1.5px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.route-card-badge.price {
    background: var(--accent-purple);
    border-color: rgba(255, 255, 255, 0.15);
}

.route-card-badge.unlocked {
    background: var(--accent-emerald);
    border-color: rgba(255, 255, 255, 0.15);
}

.route-card-title-area {
    padding: 8px 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.route-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(980px, 100%);
    margin: 0 auto;
}

.route-card-horizontal {
    display: grid;
    grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
    grid-template-rows: 138px;
    height: 138px;
    min-height: 138px;
    border-radius: 8px;
    background: #101a1a;
}

.route-card-horizontal:hover {
    transform: translateY(-1px);
    border-color: rgba(94, 234, 212, 0.55);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.24);
}

.route-card-horizontal .route-card-img-container {
    width: 100%;
    height: 138px;
    min-height: 0;
    overflow: hidden;
    border-right: 1px solid var(--border-glass);
}

.route-card-horizontal .route-card-img {
    display: block;
}

.route-card-recommended {
    position: absolute;
    top: 8px;
    left: 8px;
}

.route-card-horizontal .route-card-badge.recommended {
    background: #f5c451;
    border-color: #ffe19a;
    color: #1b170c;
}

.route-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    padding: 14px 15px;
}

.route-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    align-items: start;
    gap: 8px;
}

.route-card-horizontal .route-card-title {
    font-size: 1rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
}

.route-card-horizontal .fav-route-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #b7c1bf;
    font-size: 1.15rem;
    cursor: pointer;
}

.route-card-horizontal .fav-route-btn.active {
    color: #f5c451;
    background: rgba(245, 196, 81, 0.12);
    border-color: rgba(245, 196, 81, 0.42);
}

.route-card-access {
    min-height: 29px;
    display: flex;
    align-items: center;
}

.route-card-horizontal .route-card-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.84rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.route-card-horizontal .route-card-badge.price {
    background: #7c3aed;
    border-color: rgba(216, 180, 254, 0.55);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25);
}

.route-card-horizontal .route-card-badge.free {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(94, 234, 212, 0.48);
    color: #99f6e4;
}

.route-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.route-card-stats span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid rgba(176, 143, 104, 0.28);
    border-radius: 5px;
    background: rgba(176, 143, 104, 0.1);
    color: #dbc9b3;
    font-size: 0.72rem;
    font-weight: 700;
}

@media (max-width: 540px) {
    .route-card-horizontal {
        grid-template-columns: minmax(112px, 37%) minmax(0, 1fr);
        grid-template-rows: 134px;
        height: 134px;
        min-height: 134px;
    }

    .route-card-horizontal .route-card-img-container {
        height: 134px;
        min-height: 0;
    }

    .route-card-body {
        gap: 7px;
        padding: 10px;
    }

    .route-card-horizontal .route-card-title {
        font-size: 0.9rem;
    }

    .route-card-heading {
        grid-template-columns: minmax(0, 1fr) 32px;
        gap: 5px;
    }

    .route-card-horizontal .fav-route-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .route-card-stats {
        gap: 4px;
    }

    .route-card-stats span {
        min-height: 21px;
        padding: 2px 5px;
        font-size: 0.64rem;
    }

    .route-card-access {
        min-height: 27px;
    }

    .route-card-horizontal .route-card-badge {
        min-height: 27px;
        padding: 4px 9px;
        font-size: 0.78rem;
    }
}


/* Cajón del Menú Hamburguesa Deslizable */
.hamburger-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(304px, calc(100vw - 16px));
    height: 100%;
    box-sizing: border-box;
    background: var(--surface-panel);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-subtle);
    z-index: 1100;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px var(--shadow-color);
}

.hamburger-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    min-height: 40px;
    padding-bottom: 8px;
    flex: 0 0 auto;
}

.drawer-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0;
}

.drawer-header-actions,
.theme-icon-switcher {
    display: flex;
    align-items: center;
}

.drawer-header-actions {
    gap: 8px;
}

.theme-icon-switcher {
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    background: var(--surface-raised);
}

.drawer-icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.drawer-icon-btn:hover {
    background: var(--surface-control);
    color: var(--text-primary);
}

.theme-choice-btn.active,
.theme-choice-btn[aria-pressed="true"] {
    background: var(--brand-primary);
    color: #ffffff;
}

.drawer-close-btn {
    border: 1px solid var(--border-subtle);
    background: var(--surface-raised);
}

.drawer-action-icon,
.menu-item-icon {
    display: inline-block;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask-image: var(--menu-icon);
    mask-image: var(--menu-icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.drawer-action-icon {
    width: 17px;
    height: 17px;
}

.drawer-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px 0 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Detalle de Recorrido (Bottom Sheet Drawer) */
.route-detail-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 580px;
    height: min(80vh, 760px);
    background: linear-gradient(180deg, rgba(12, 24, 25, 0.98) 0%, rgba(7, 19, 18, 0.98) 100%);
    border-top: 2px solid var(--accent-sand);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1050;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
}

.route-detail-drawer.open {
    transform: translateX(-50%) translateY(0);
}

.detail-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.15);
}

.detail-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: white;
    margin: 0 0 5px 0;
}

.detail-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.detail-description {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.25);
}

.route-detail-gallery {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-glass);
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
}

.route-detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.route-gallery-dots {
    position: absolute;
    left: 12px;
    bottom: 10px;
    display: flex;
    gap: 5px;
}

.route-gallery-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.route-gallery-dots span.active {
    width: 18px;
    border-radius: 999px;
    background: white;
}

.route-social-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
}

.route-mini-btn {
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    border-radius: 9px;
    padding: 8px 10px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    min-height: 36px;
}

.route-mini-btn.active {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

.route-rating-pill {
    border: 1px solid rgba(251,191,36,0.28);
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
    border-radius: 9px;
    padding: 8px 10px;
    min-height: 36px;
    font-size: 0.78rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.route-taxonomy-block,
.route-practical-block,
.route-pois-block,
.route-reviews-block {
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.025);
    border-radius: 10px;
    padding: 9px 10px;
}

.route-practical-block {
    border-color: rgba(45, 212, 191, 0.2);
    background: rgba(45, 212, 191, 0.045);
}

.route-requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
}

.route-requirements span {
    min-width: 0;
    color: #e5e7eb;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.25;
}

.route-confidence {
    display: grid;
    gap: 3px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(45, 212, 191, 0.13);
}

.route-confidence p {
    margin: 0;
    color: #b9c9c7;
    font-size: 0.69rem;
    line-height: 1.3;
}

.route-confidence strong {
    color: #5eead4;
}

.route-block-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 7px;
}

.route-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.route-tax-chip {
    font-size: 0.7rem;
    color: #d8b4fe;
    background: rgba(139,92,246,0.13);
    border: 1px solid rgba(139,92,246,0.24);
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 800;
}

.route-pois-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.route-poi-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 7px;
    align-items: center;
    min-width: 0;
    color: #e5e7eb;
    font-size: 0.74rem;
    line-height: 1.15;
}

.route-poi-item img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 7px;
    background: rgba(255,255,255,0.06);
}

.route-poi-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-reviews-grid {
    display: grid;
    gap: 6px;
}

.route-review-item {
    font-size: 0.72rem;
    color: #d1d5db;
    line-height: 1.25;
}

.route-review-item strong {
    color: #fff;
    font-weight: 900;
}

.visitor-reviews-section {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--border-glass);
}

.route-review-empty {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.visitor-review-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.visitor-review-summary strong,
.visitor-review-stars {
    color: #fbbf24;
}

.visitor-review-list {
    display: grid;
    gap: 7px;
}

.visitor-review-item {
    padding: 7px 8px;
    border-radius: 7px;
    background: rgba(255,255,255,0.035);
}

.visitor-review-item p {
    margin: 3px 0 0;
    color: #d1d5db;
    font-size: 0.72rem;
    line-height: 1.3;
}

.route-review-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 8, 0.82);
    backdrop-filter: blur(12px);
}

.route-review-overlay.hidden {
    display: none;
}

.route-review-card {
    position: relative;
    width: min(420px, 100%);
    padding: 27px 24px 22px;
    border: 1px solid rgba(94, 234, 212, 0.3);
    border-radius: 12px;
    background: #0b1d1c;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    text-align: center;
}

.route-review-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    font-size: 1rem;
    cursor: pointer;
}

.route-review-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.15);
    color: #5eead4;
    border: 1px solid rgba(94, 234, 212, 0.35);
    font-size: 1.4rem;
    font-weight: 900;
}

.route-review-eyebrow {
    color: #5eead4;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.route-review-card h2 {
    margin: 5px 0 7px;
    color: #fff;
    font-size: 1.35rem;
}

.route-review-card > p {
    margin: 0 auto 16px;
    max-width: 340px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.route-review-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
}

.route-review-stars button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.route-review-stars button.active {
    color: #fbbf24;
}

#route-review-comment {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 84px;
    padding: 11px 12px;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: rgba(0,0,0,0.22);
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
}

.route-review-status {
    min-height: 20px;
    margin: 8px 0 2px;
    color: #5eead4;
    font-size: 0.76rem;
}

.route-review-status.error {
    color: #f87171;
}

.route-review-submit,
.route-review-later {
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.route-review-submit {
    border: 0;
    background: #14b8a6;
    color: #fff;
}

.route-review-submit:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.route-review-later {
    margin-top: 7px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
}

@media (max-width: 480px) {
    .route-review-card {
        padding: 24px 17px 17px;
    }

    .route-review-stars button {
        width: 38px;
        height: 38px;
        font-size: 1.8rem;
    }
}

@media (max-height: 740px) {
    .route-detail-drawer {
        height: 84vh;
    }

    .route-detail-gallery {
        height: 120px;
    }

    .route-reviews-block {
        display: none;
    }
}

/* Desktop: detalle de ruta/compra en panel derecho, mapa a la izquierda */
@media (min-width: 1024px) and (min-height: 700px) {
    :root {
        --desktop-detail-panel-width: clamp(430px, 34vw, 560px);
        --desktop-detail-panel-gap: 18px;
    }

    body.route-detail-open:not(.route-active) #map {
        width: calc(100% - var(--desktop-detail-panel-width) - var(--desktop-detail-panel-gap) * 2) !important;
        height: 100vh !important;
    }

    body.route-detail-open:not(.route-active) .catalog-panel {
        width: calc(100% - var(--desktop-detail-panel-width) - var(--desktop-detail-panel-gap) * 2);
    }

    body.route-detail-open:not(.route-active) .map-floating-header {
        width: calc(100% - var(--desktop-detail-panel-width) - var(--desktop-detail-panel-gap) * 2);
    }

    body.route-detail-open:not(.route-active) .route-detail-drawer {
        top: var(--desktop-detail-panel-gap);
        right: var(--desktop-detail-panel-gap);
        bottom: var(--desktop-detail-panel-gap);
        left: auto;
        width: var(--desktop-detail-panel-width);
        max-width: none;
        height: auto;
        max-height: none;
        border: 1.5px solid rgba(176, 143, 104, 0.42);
        border-radius: 22px;
        transform: translateX(calc(100% + var(--desktop-detail-panel-gap)));
        box-shadow: 0 22px 60px rgba(0,0,0,0.48);
    }

    body.route-detail-open:not(.route-active) .route-detail-drawer.open {
        transform: translateX(0);
    }

    body.route-detail-open:not(.route-active) .route-detail-gallery {
        height: 190px;
    }

    body.route-detail-open:not(.route-active) .detail-content {
        padding: 14px 18px;
    }

    body.route-detail-open:not(.route-active) .detail-actions {
        padding: 14px 18px;
    }
}

/* Palette refinement inspired by deep coast, sand and sky tones */
.welcome-overlay {
    background: radial-gradient(circle at center, #123b3b 0%, var(--bg-dark) 72%);
}

.welcome-card,
.dashboard-panel,
.hamburger-drawer,
.catalog-panel,
.custom-route-landing .landing-card {
    background-color: rgba(10, 25, 26, 0.94);
}

.catalog-panel {
    background: #071312;
}

.route-tax-chip {
    color: #d9c3a5;
    background: rgba(176, 143, 104, 0.16);
    border-color: rgba(176, 143, 104, 0.32);
}

.route-mini-btn:hover,
.hamburger-btn:hover {
    background: rgba(155, 202, 211, 0.12);
}

.route-rating-pill,
.route-mini-btn.active {
    color: #f1d6ad;
    background: rgba(176, 143, 104, 0.18);
    border-color: rgba(176, 143, 104, 0.38);
}

.cta-button,
.welcome-card-cta,
.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, #3f6672 100%);
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.24);
}

.badge.cat {
    background: rgba(63, 102, 114, 0.22) !important;
    color: #bfe4ea !important;
}

.badge.difficulty {
    background: rgba(176, 143, 104, 0.18) !important;
    color: #f1d6ad !important;
}

.badge.duration {
    background: rgba(14, 166, 120, 0.16) !important;
    color: #8ee6c5 !important;
}

.activation-pass-content {
    max-width: 440px;
    width: 100%;
    margin: auto;
    padding-top: 4vh;
}

.activation-pass-card {
    width: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    border: 1.5px solid rgba(155, 202, 211, 0.2);
    background: rgba(10, 25, 26, 0.96);
    box-shadow: 0 22px 60px rgba(0,0,0,0.5);
    text-align: left;
}

.activation-pass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-glass);
}

.activation-pass-header h2 {
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1.12;
    color: #fff;
    margin: 0;
}

.activation-pass-hero {
    width: 100%;
    height: 145px;
    overflow: hidden;
    background: #102526;
}

.activation-pass-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.activation-pass-copy {
    padding: 18px 20px 8px;
    color: #f6f7f2;
    font-size: 1.04rem;
    line-height: 1.42;
    font-weight: 700;
    margin: 0;
}

.activation-pass-includes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px 16px;
}

.activation-pass-includes span {
    background: rgba(176, 143, 104, 0.18);
    border: 1px solid rgba(176, 143, 104, 0.34);
    color: #f1d6ad;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 900;
}

.activation-pass-note {
    margin: -6px 20px 16px;
    color: #f1d6ad;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.3;
}

.activation-pass-buy {
    width: calc(100% - 40px);
    margin: 0 20px 14px;
    min-height: 50px;
    border: none;
    border-radius: 13px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
}

.activation-code-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0 20px;
    margin-bottom: 12px;
}

.activation-code-divider::before,
.activation-code-divider::after {
    content: "";
    height: 1px;
    background: var(--border-glass);
    flex: 1;
}

#activation-form {
    padding: 0 20px 20px;
    display: grid;
    gap: 10px;
}

.activation-protection-copy {
    padding: 13px 14px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.08);
}

.activation-protection-copy strong {
    display: block;
    margin-bottom: 5px;
    color: #99f6e4;
    font-size: 1rem;
}

.activation-protection-copy p {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.84rem;
    line-height: 1.45;
}

.activation-without-email {
    width: 100%;
    padding: 10px;
    border: 0;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

#activation-overlay.qr-protection-mode .activation-pass-hero,
#activation-overlay.qr-protection-mode .activation-pass-copy,
#activation-overlay.qr-protection-mode .activation-pass-includes,
#activation-overlay.qr-protection-mode .activation-pass-note,
#activation-overlay.qr-protection-mode .activation-pass-buy,
#activation-overlay.qr-protection-mode .activation-code-divider {
    display: none;
}

#activation-overlay.qr-protection-mode #activation-form {
    padding-top: 18px;
}

#activation-code-input {
    width: 100%;
    padding: 13px 14px;
    background: rgba(0,0,0,0.24);
    border: 1.5px solid var(--border-glass);
    border-radius: 12px;
    color: #fff;
    font-size: 1.06rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.activation-code-row {
    grid-template-columns: minmax(0, 1fr) 58px;
}

.activation-code-row .voucher-icon-btn {
    width: 58px;
    height: 100%;
    min-height: 50px;
}

.activation-pass-activate {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
}

.payment-voucher-panel {
    background: rgba(16, 185, 129, 0.05);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: left;
    color: #fff;
}

.voucher-panel-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-emerald);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.voucher-back-paypal {
    width: 100%;
    min-height: 34px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 800;
    cursor: pointer;
}

.voucher-redemption-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
}

.voucher-redemption-card.disabled {
    opacity: 0.52;
}

.voucher-plus-cross-sell {
    color: var(--text-muted);
    background: rgba(176, 143, 104, 0.12);
    border: 1px solid rgba(176, 143, 104, 0.22);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: center;
}

.voucher-plus-cross-sell.hidden {
    display: none !important;
}

.voucher-redemption-card strong {
    font-size: 0.95rem;
}

.voucher-redemption-card p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.voucher-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px;
}

.voucher-code-row input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: #fff;
    font-family: monospace;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}

.voucher-icon-btn {
    width: 54px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 118, 110, 0.25);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-weight: 900;
}

.voucher-icon-btn span {
    font-size: 0.62rem;
    letter-spacing: 0;
}

.voucher-code-row input:disabled,
.voucher-icon-btn:disabled,
.voucher-activate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.voucher-activate-btn {
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: var(--accent-emerald);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.voucher-activate-btn.plus {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.voucher-qr-scanner {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.38);
}

.voucher-qr-scanner.hidden {
    display: none !important;
}

.voucher-qr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.voucher-qr-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

.voucher-qr-video {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    display: block;
    background: #000;
}

.voucher-qr-status {
    margin: 0;
    padding: 8px 10px 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.payment-card {
    max-height: min(92vh, 760px);
    overflow-y: auto;
}

@media (max-width: 520px) {
    #payment-selection-overlay {
        align-items: flex-start !important;
        padding: 10px 0;
        overflow-y: auto;
    }

    .payment-card {
        padding: 18px !important;
        max-height: none;
        border-radius: 16px !important;
    }

    .payment-card h2 {
        font-size: 1.18rem !important;
        margin-bottom: 6px !important;
    }

    #payment-overlay-plan-title {
        font-size: 0.96rem !important;
        margin-bottom: 12px !important;
    }

    .voucher-redemption-card strong {
        font-size: 0.88rem;
    }

    .voucher-redemption-card p {
        font-size: 0.74rem;
    }
}

/* Efectos interactivos del botón del mini-mapa activo */
.btn-minimap-toggle {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-minimap-toggle:hover {
    background: rgba(139, 92, 246, 0.22) !important;
    border-color: rgba(139, 92, 246, 0.5) !important;
    transform: translateY(-1px);
}

.btn-minimap-toggle:active {
    transform: translateY(0) scale(0.98);
}

/* Estilos para el sistema de lengüetas del Dashboard */
.dashboard-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    padding-right: 12px; /* Permite ver el último tab al deslizar */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
    scrollbar-width: none;
    flex-shrink: 0;
    /* Indicador de scroll: sombra derecha cuando hay más contenido */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
}
.dashboard-tabs::-webkit-scrollbar {
    display: none;
}
/* Cuando está al final del scroll, quitar el fade */
.dashboard-tabs.scrolled-end {
    -webkit-mask-image: none;
    mask-image: none;
}
.tab-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    white-space: nowrap;
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}
.dashboard-tabs-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 2px;
    min-height: 0; /* Necesario para que flex-child scroll funcione */
}
.tab-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}
.tab-content.hidden {
    display: none !important;
}

/* Encabezado e interruptor de colapso de Dashboard */
.dashboard-toggle-header {
    width: 100%;
    text-align: center;
    padding: 8px 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
    flex-shrink: 0;
}
.dashboard-toggle-header:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 480px) {
    .dashboard-panel:not(.collapsed) {
        height: min(80vh, calc(100dvh - 120px));
        max-height: min(80vh, calc(100dvh - 120px));
    }

    #tab-multimedia {
        min-height: 0;
    }

    #tab-multimedia .poi-gallery-wrapper {
        min-height: 0;
    }

    #tab-multimedia .poi-gallery {
        min-height: 280px !important;
        max-height: none !important;
    }
}

/* Banner de IA traduciendo */
.ai-translating-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(59, 130, 246, 0.12) 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c084fc;
    animation: bannerPulse 2s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

.ai-generation-content {
    flex: 1;
    min-width: 0;
}

.ai-generation-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.3;
}

#ai-translating-text {
    min-width: 0;
}

#ai-generation-percent {
    flex: 0 0 auto;
    color: #e9d5ff;
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

.ai-generation-track {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.09);
}

.ai-generation-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #8b5cf6, #60a5fa);
    transition: width 0.35s ease;
}

.ai-translating-banner.complete {
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.55);
    animation: none;
}

.ai-translating-banner.complete .ai-generation-fill {
    background: #34d399;
}

.ai-translating-banner.error {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.55);
    animation: none;
}

.ai-translating-banner.error .ai-generation-fill {
    background: #ef4444;
}

@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255,255,255,0.06); }
    50% { box-shadow: 0 0 26px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255,255,255,0.1); }
}

.ai-translating-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ai-translating-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-translating-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-translating-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-translating-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes aiBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* Estilos para la Landing de Recorrido a Medida */
.custom-route-landing {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(16, 17, 24, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.custom-route-landing.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.landing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 860px);
}
.landing-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}
.landing-heading-icon {
    font-size: 1.5rem;
}
.landing-heading h2 {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}
.landing-heading p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}
.landing-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.landing-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.landing-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 2px;
    gap: 12px;
}
.custom-route-step {
    padding: 12px;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}
.custom-route-step-heading {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 10px;
}
.custom-route-step-number {
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    background: #0f766e;
    font-size: 0.75rem;
    font-weight: 800;
}
.custom-route-step-heading h3 {
    margin: 1px 0 2px;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.2;
}
.custom-route-step-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}
.custom-route-field-label {
    display: block;
    margin: 0 0 5px 33px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}
.custom-route-select {
    width: calc(100% - 33px);
    min-height: 42px;
    margin-left: 33px;
    padding: 9px 11px;
    box-sizing: border-box;
    border: 1px solid var(--border-glass);
    border-radius: 7px;
    color: #fff;
    background: #101b1c;
    font-size: 0.84rem;
}
.custom-route-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-left: 33px;
}
.custom-route-filter-chip {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid rgba(155, 202, 211, 0.23);
    border-radius: 17px;
    color: #c7d0d0;
    background: #142223;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.custom-route-filter-chip.selected {
    color: #fff;
    border-color: #2dd4bf;
    background: #0f766e;
}
.custom-route-no-options {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.custom-route-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #3f6672);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}
.pois-selection-container {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.custom-route-results-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.custom-route-results-heading > div {
    display: flex;
    align-items: center;
    gap: 7px;
}
#landing-pois-found-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
#landing-results-count {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    color: #baf8ec;
    background: rgba(15, 118, 110, 0.35);
    font-size: 0.73rem;
}
#btn-landing-select-all {
    padding: 5px;
    border: 0;
    color: #7dd3c7;
    background: transparent;
    font: inherit;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
}
.landing-pois-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 30vh;
    overflow-y: auto;
    padding-right: 2px;
}
.custom-route-empty-state {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 24px 12px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.8rem;
}
.custom-route-empty-state strong {
    color: #fff;
    font-size: 0.86rem;
}
.poi-select-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border: 1px solid var(--border-glass);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}
.poi-select-item.selected {
    border-color: rgba(45, 212, 191, 0.5);
    background: rgba(15, 118, 110, 0.16);
}
.poi-select-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #14b8a6;
}
.poi-select-info {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}
.poi-select-title {
    overflow: hidden;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.poi-select-meta {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.landing-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
#landing-selection-summary {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: center;
}
#btn-landing-start-route {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #3f6672);
    font-size: 0.9rem;
    font-weight: 800;
}
#btn-landing-start-route:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}
@media (max-width: 600px) {
    .custom-route-landing {
        align-items: flex-end;
        padding: 8px;
    }
    .landing-card {
        max-height: 94dvh;
        padding: 15px;
        border-radius: 12px 12px 0 0;
    }
    .landing-header {
        padding-bottom: 11px;
        margin-bottom: 11px;
    }
    .custom-route-step {
        padding: 10px;
    }
    .custom-route-chip-list {
        padding-left: 0;
    }
    .custom-route-field-label {
        margin-left: 0;
    }
    .custom-route-select {
        width: 100%;
        margin-left: 0;
    }
    .landing-pois-list {
        max-height: 27vh;
    }
}
.landing-pois-list::-webkit-scrollbar {
    width: 4px;
}
.landing-pois-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
.poi-select-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255,255,255,0.15);
}

/* Paginación en Admin */
#pois-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
#pois-pagination .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#pois-pagination .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}
#pois-pagination span {
    font-size: 0.85rem;
    color: var(--text-muted);
}
#pois-pagination strong {
    color: #fff;
}

/* Custom Heading & Title Fonts (Trebuchet MS) */
h1, h2, h3, h4, h5, h6,
.logo-text,
.route-active-title,
.welcome-card-title,
.detail-title,
.poi-info h2,
.landing-header h2,
.poi-select-title,
.route-card-title,
.drawer-title,
.chat-poi-name {
    font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif !important;
}

/* Compact drawer navigation */
.menu-item-btn {
    width: 100%;
    min-height: 40px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-align: left;
    outline: none;
}
.menu-item-btn:hover {
    background: var(--surface-raised);
    color: var(--text-primary);
}
.menu-item-btn:active {
    background: var(--surface-control);
}
.menu-item-btn .menu-item-icon {
    width: 19px;
    height: 19px;
    color: var(--text-muted);
}
.menu-item-btn:hover .menu-item-icon {
    color: var(--text-primary);
}
.menu-item-text {
    min-width: 0;
    line-height: 1.15;
}
.menu-item-btn.hidden {
    display: none !important;
}
.menu-item-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-toggle-row {
    justify-content: space-between;
    cursor: default;
}
.menu-item-danger {
    color: #ef6b72;
}
.menu-item-danger .menu-item-icon {
    color: currentColor;
}
#menu-btn-free-walk-container .switch,
#menu-auto-narration-container .switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 19px;
    flex: 0 0 36px;
    margin: 0;
}
#menu-btn-free-walk-container .switch input,
#menu-auto-narration-container .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
#menu-btn-free-walk-container .slider,
#menu-auto-narration-container .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-control);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
}
#menu-btn-free-walk-container .slider:before,
#menu-auto-narration-container .slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
#menu-btn-free-walk-container input:checked + .slider,
#menu-auto-narration-container input:checked + .slider {
    background-color: #0f9f87;
}
#menu-btn-free-walk-container input:checked + .slider:before,
#menu-auto-narration-container input:checked + .slider:before {
    transform: translateX(17px);
}
#menu-auto-narration-container {
    cursor: default;
    gap: 9px;
    min-height: 46px;
}
#menu-auto-narration-container:hover {
    transform: none;
}
.menu-setting-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}
.menu-setting-copy strong {
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.15;
}
.menu-setting-copy small {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.2;
}
#menu-auto-narration-container input:focus-visible + .slider {
    outline: 2px solid #5eead4;
    outline-offset: 3px;
}

.icon-home { --menu-icon: url("assets/icons/menu/home.svg"); }
.icon-tours { --menu-icon: url("assets/icons/menu/ticket-check.svg"); }
.icon-near-me { --menu-icon: url("assets/icons/menu/map-pin.svg"); }
.icon-route { --menu-icon: url("assets/icons/menu/route.svg"); }
.icon-free-walk { --menu-icon: url("assets/icons/menu/footprints.svg"); }
.icon-narration { --menu-icon: url("assets/icons/menu/volume-2.svg"); }
.icon-key { --menu-icon: url("assets/icons/menu/key-round.svg"); }
.icon-refresh { --menu-icon: url("assets/icons/menu/refresh-cw.svg"); }
.icon-favorite { --menu-icon: url("assets/icons/menu/star.svg"); }
.icon-search { --menu-icon: url("assets/icons/menu/search.svg"); }
.icon-achievements { --menu-icon: url("assets/icons/menu/medal.svg"); }
.icon-install { --menu-icon: url("assets/icons/menu/smartphone.svg"); }
.icon-help { --menu-icon: url("assets/icons/menu/circle-help.svg"); }
.icon-sun { --menu-icon: url("assets/icons/menu/sun.svg"); }
.icon-moon { --menu-icon: url("assets/icons/menu/moon.svg"); }
.icon-close { --menu-icon: url("assets/icons/menu/x.svg"); }

@media (max-height: 620px) {
    .hamburger-drawer {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .menu-item-btn {
        min-height: 36px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    #menu-auto-narration-container {
        min-height: 42px;
    }
}

.license-email-input {
    width: 100%;
    min-height: 42px;
    margin: 0 0 10px;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    outline: none;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font: inherit;
    font-size: 0.86rem;
}

.license-email-input:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

.license-recovery-open {
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    border: 0;
    background: transparent;
    color: #99f6e4;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.license-recovery-panel {
    margin-top: 8px;
    padding: 14px;
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.08);
    text-align: left;
}

.license-recovery-panel h3 {
    margin: 0 0 6px;
    color: #f4f4f5;
    font-size: 1rem;
}

.license-recovery-panel p {
    margin: 0 0 12px;
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.4;
}

.license-recovery-action {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(94, 234, 212, 0.32);
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.license-recovery-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.license-code-input {
    margin-top: 10px;
    text-align: center;
    letter-spacing: 0.16em;
    font-weight: 800;
}

.license-recovery-status {
    min-height: 18px;
    margin-top: 10px;
    color: #a7f3d0;
    font-size: 0.76rem;
    line-height: 1.4;
}

.license-recovery-status.error {
    color: #fca5a5;
}

.license-recovery-result {
    display: block;
    margin-top: 4px;
    color: #f4f4f5;
    font-weight: 700;
}
.near-me-card, .favorite-card {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.near-me-card:hover, .favorite-card:hover {
    background: #27272a;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.near-me-card strong, .favorite-card strong {
    font-size: 1.05rem !important;
}
.near-me-card p, .favorite-card p {
    font-size: 0.92rem !important;
    line-height: 1.5;
}
.near-me-card span, .favorite-card span {
    font-size: 0.85rem !important;
}

.my-tours-card {
    max-width: 620px !important;
    max-height: 84vh;
    padding: 24px !important;
    overflow: hidden;
    align-items: stretch !important;
    text-align: left !important;
    border-radius: 8px !important;
}

.my-tours-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-glass);
}

.my-tours-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
}

.my-tours-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.my-tours-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.my-tours-pass {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid rgba(20, 184, 166, 0.42);
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
}

.my-tours-pass.hidden {
    display: none;
}

.my-tours-pass div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.my-tours-pass strong {
    color: #f4f4f5;
    font-size: 0.95rem;
}

.my-tours-pass span {
    color: #a1a1aa;
    font-size: 0.76rem;
}

.my-tours-pass .my-tours-status {
    color: #5eead4;
    font-weight: 800;
}

.my-tours-list {
    flex: 1 1 auto;
    min-height: 90px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-right: 3px;
}

.my-tour-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    background: #18181b;
}

.my-tour-item > img {
    width: 96px;
    height: 96px;
    border-radius: 6px;
    object-fit: cover;
}

.my-tour-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.my-tour-heading {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.my-tour-heading strong {
    min-width: 0;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.25;
}

.my-tour-heading span {
    flex: 0 0 auto;
    color: #5eead4;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.my-tour-content small {
    color: #a1a1aa;
    font-size: 0.72rem;
}

.my-tour-progress-copy {
    display: flex;
    justify-content: space-between;
    color: #d4d4d8;
    font-size: 0.72rem;
}

.my-tour-progress {
    height: 5px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.my-tour-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #14b8a6;
}

.my-tour-content button,
.my-tours-recovery {
    min-height: 36px;
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 7px;
    background: rgba(13, 148, 136, 0.16);
    color: #ccfbf1;
    font-weight: 800;
    cursor: pointer;
}

.my-tours-recovery {
    width: 100%;
    margin-top: 14px;
    flex: 0 0 auto;
    border-color: rgba(255, 255, 255, 0.1);
    background: #27272a;
    color: #f4f4f5;
}

.my-tours-empty {
    padding: 24px 16px;
    text-align: center;
    color: #f4f4f5;
}

.my-tours-empty p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.app-catalog-footer {
    width: 100%;
    margin-top: 40px;
    padding: 20px 0 10px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: center;
}

.app-catalog-footer p {
    margin: 2px 0;
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 10px;
}

.app-footer-links a {
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.app-footer-links a:hover,
.app-footer-links a:focus-visible {
    color: var(--brand-primary-hover);
    text-decoration: underline;
}

html[data-theme="light"] .my-tours-header h2 {
    color: var(--text-primary);
}

html[data-theme="light"] .my-tours-header p,
html[data-theme="light"] .my-tour-content small,
html[data-theme="light"] .my-tour-progress-copy,
html[data-theme="light"] .my-tours-pass span,
html[data-theme="light"] .my-tours-empty p {
    color: var(--text-muted);
}

html[data-theme="light"] .my-tours-close {
    border-color: var(--border-subtle);
    background: var(--surface-control);
    color: var(--text-primary);
}

html[data-theme="light"] .my-tours-pass {
    border-color: rgba(15, 118, 110, 0.3);
    background: #eaf6f3;
}

html[data-theme="light"] .my-tours-pass strong,
html[data-theme="light"] .my-tour-heading strong,
html[data-theme="light"] .my-tours-empty {
    color: var(--text-primary);
}

html[data-theme="light"] .my-tours-pass .my-tours-status,
html[data-theme="light"] .my-tour-heading span {
    color: #08765b;
}

html[data-theme="light"] .my-tour-item {
    border-color: var(--border-subtle);
    background: var(--surface-raised);
}

html[data-theme="light"] .my-tour-progress {
    background: #dce6e3;
}

html[data-theme="light"] .my-tour-content button {
    border-color: rgba(15, 118, 110, 0.34);
    background: #e7f4f1;
    color: #0b625c;
}

html[data-theme="light"] .my-tour-content button:hover {
    border-color: rgba(15, 118, 110, 0.52);
    background: #d8eee9;
}

html[data-theme="light"] .my-tours-recovery {
    border-color: var(--border-subtle);
    background: var(--surface-control);
    color: var(--text-primary);
}

html[data-theme="light"] .my-tours-recovery:hover {
    background: #e8efed;
}

@media (max-width: 520px) {
    .my-tours-card {
        width: calc(100% - 24px) !important;
        max-height: 86vh;
        padding: 18px !important;
    }

    .my-tour-item {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px;
    }

    .my-tour-item > img {
        width: 76px;
        height: 76px;
    }
}

#help-content-list p {
    font-size: 0.98rem !important;
    line-height: 1.6;
}
#help-content-list strong {
    font-size: 1.02rem;
}
#search-overlay label {
    font-size: 0.9rem !important;
}
#search-overlay input, #search-overlay select {
    font-size: 0.95rem !important;
    padding: 12px 16px !important;
}
#search-route-difficulty option {
    background: var(--surface-control);
    color: var(--text-primary);
}
#search-overlay-results-notice {
    font-size: 0.82rem !important;
    color: var(--text-muted);
}
.search-results-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    text-align: left;
    flex-shrink: 0;
}
#search-overlay-results-count {
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
}
.search-overlay-results {
    min-height: 84px;
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1px 4px 2px 0;
    scrollbar-width: thin;
}
.search-result-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}
.search-result-card:hover,
.search-result-card:focus-visible {
    border-color: rgba(45, 212, 191, 0.62);
    background: rgba(45, 212, 191, 0.09);
    outline: none;
}
.search-result-image {
    width: 76px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: #171820;
}
.search-result-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.search-result-title {
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-meta {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-access {
    width: max-content;
    max-width: 100%;
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 700;
}
.search-result-access.unlocked {
    color: #34d399;
}
.search-result-arrow {
    color: #8fd6cf;
    font-size: 1.55rem;
    line-height: 1;
}
.search-result-empty {
    margin: auto 0;
    padding: 22px 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

html[data-theme="light"] .search-result-card {
    border-color: #d3ddda;
    background: #ffffff;
}

html[data-theme="light"] .search-result-card:hover,
html[data-theme="light"] .search-result-card:focus-visible {
    border-color: #4ba99f;
    background: #eaf7f5;
}

html[data-theme="light"] .search-result-image {
    background: #e8eeec;
}

html[data-theme="light"] .search-result-access {
    color: #9b6500;
}

html[data-theme="light"] .search-result-access.unlocked {
    color: #087f5b;
}

html[data-theme="light"] .search-result-arrow {
    color: #218b82;
}

.help-contact-container {
    flex-shrink: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.help-contact-container > strong {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-size: 0.95rem;
}

.help-contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.help-contact-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.help-contact-link.whatsapp {
    border-color: rgba(52, 211, 153, 0.38);
    background: rgba(16, 185, 129, 0.11);
    color: #d1fae5;
}

.help-contact-link:hover,
.help-contact-link:focus-visible {
    border-color: currentColor;
    outline: none;
}

@media (max-width: 768px) {
    .search-overlay-card {
        width: calc(100vw - 28px) !important;
        height: 80vh;
        max-height: 80vh !important;
        padding: 18px !important;
    }
    .search-results-header {
        display: block;
    }
    #search-overlay-results-notice {
        display: block;
        margin-top: 2px;
    }

    .help-contact-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-tabs .tab-btn[data-tab="simulacion"] {
        display: none;
    }

    .mobile-simulation-slot {
        display: block;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    #mobile-simulation-slot #simulation-controls {
        gap: 10px !important;
        padding: 0 !important;
    }
}
/* Idiomas RTL: la interfaz invierte lectura, pero el mapa conserva sus ejes y controles. */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .chat-message,
html[dir="rtl"] .route-detail-content {
    text-align: right;
}

html[dir="rtl"] .leaflet-container,
html[dir="rtl"] .leaflet-control-container {
    direction: ltr;
}

/* ============================================================
   THEMES
   Semantic theme layer. Media heroes keep a dark overlay so text
   remains legible in both appearances.
   ============================================================ */

body,
html {
    background: var(--surface-page);
    color: var(--text-primary);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.theme-setting-row {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 3px 10px !important;
    align-items: center !important;
    min-height: 64px;
}

.theme-setting-row .menu-item-icon {
    grid-row: 1 / span 2;
}

#theme-setting-label {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.theme-select {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 3px 28px 3px 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--surface-control);
    color: var(--text-primary);
    font-size: 0.74rem;
    cursor: pointer;
}

.catalog-panel,
.dashboard-panel,
.hamburger-drawer,
.welcome-card,
.landing-card,
.activation-pass-card,
.payment-card,
.search-overlay-card,
.location-welcome-dialog,
.route-detail-drawer {
    color: var(--text-primary);
    border-color: var(--border-subtle);
    box-shadow: 0 18px 46px var(--shadow-color);
}

.catalog-panel,
.dashboard-panel,
.hamburger-drawer,
.welcome-card,
.landing-card,
.activation-pass-card,
.location-welcome-dialog {
    background: var(--surface-panel);
}

.route-card,
.route-card-vertical,
.route-card-horizontal,
.route-info-card,
.route-detail-section,
.detail-info-block,
.detail-requirements,
.detail-editorial-reviews,
.custom-route-step,
.voucher-redemption-card,
.license-recovery-panel,
.poi-info,
.progress-route-card {
    color: var(--text-primary);
    background-color: var(--surface-raised);
    border-color: var(--border-subtle);
}

.route-card-title,
.route-card-heading,
.detail-title,
.drawer-title,
.landing-heading h2,
.custom-route-step-heading h3,
.activation-pass-header h2,
.welcome-card-title,
.poi-info h2,
.chat-header-info h3 {
    color: var(--text-primary);
}

.route-card-stats,
.route-card-access,
.detail-description,
.landing-heading p,
.custom-route-step-heading p,
.custom-route-field-label,
.welcome-card-desc,
.poi-info p {
    color: var(--text-muted);
}

.tab-btn,
.route-mini-btn,
.detail-close-btn,
.drawer-close-btn,
.landing-close-btn,
.gallery-nav-btn,
.voucher-back-paypal {
    border-color: var(--border-subtle);
    background: var(--surface-raised);
    color: var(--text-primary);
}

.tab-btn:hover,
.route-mini-btn:hover,
.detail-close-btn:hover,
.drawer-close-btn:hover,
.landing-close-btn:hover,
.gallery-nav-btn:hover {
    background: var(--surface-control);
    color: var(--text-primary);
}

.tab-btn.active,
.custom-route-filter-chip.selected,
.route-mini-btn.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #ffffff;
}

.cta-button,
.welcome-card-cta,
.btn-primary,
.custom-route-search-btn,
.voucher-activate-btn,
.chat-input-area button {
    border-color: transparent;
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(17, 106, 100, 0.2);
}

.cta-button:hover,
.welcome-card-cta:hover,
.btn-primary:hover,
.custom-route-search-btn:hover,
.voucher-activate-btn:hover,
.chat-input-area button:hover {
    background: var(--brand-primary-hover);
}

.compact-select,
.location-language-select,
.custom-route-select,
.chat-input-area input,
.license-email-input,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select {
    border-color: var(--border-subtle);
    background-color: var(--surface-control);
    color: var(--text-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.82;
}

.drawer-backdrop,
.overlay,
.welcome-overlay,
.custom-route-landing,
.poi-welcome-overlay,
.location-welcome-overlay {
    background-color: var(--surface-overlay);
}

.home-slide,
.home-slide-copy,
.route-card-img-container,
.route-detail-gallery,
.welcome-card-image-container {
    color-scheme: dark;
}

html[data-theme="light"] .map-floating-header {
    color: var(--text-primary);
}

html[data-theme="light"] .hamburger-btn,
html[data-theme="light"] .compact-select {
    border-color: rgba(23, 33, 31, 0.18) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #17211f !important;
    box-shadow: 0 6px 18px rgba(35, 54, 50, 0.14);
}

html[data-theme="light"] .compact-select option {
    background: #ffffff;
    color: #17211f;
}

html[data-theme="light"] #hamburger-drawer {
    background: var(--surface-panel) !important;
    border-left-color: var(--border-subtle) !important;
    box-shadow: -8px 0 28px var(--shadow-color) !important;
}

html[data-theme="light"] #hamburger-drawer .drawer-header {
    border-bottom-color: var(--border-subtle) !important;
}

html[data-theme="light"] #hamburger-drawer .drawer-title,
html[data-theme="light"] #hamburger-drawer .drawer-close-btn {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .catalog-panel {
    background: var(--surface-page);
}

html[data-theme="light"] .catalog-header {
    background: var(--surface-panel) !important;
    border-bottom-color: var(--border-subtle) !important;
}

html[data-theme="light"] #catalog-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] #btn-view-general-map {
    border-color: rgba(17, 106, 100, 0.28) !important;
    background: rgba(17, 106, 100, 0.09) !important;
    color: var(--brand-primary) !important;
}

html[data-theme="light"] .route-card-horizontal,
html[data-theme="light"] .route-card-vertical {
    background: var(--surface-panel);
    border-color: var(--border-subtle);
    box-shadow: 0 8px 22px rgba(35, 54, 50, 0.1);
}

html[data-theme="light"] .route-card-horizontal:hover,
html[data-theme="light"] .route-card-vertical:hover {
    border-color: rgba(17, 106, 100, 0.42);
    box-shadow: 0 12px 28px rgba(35, 54, 50, 0.15);
}

html[data-theme="light"] .route-card-horizontal .route-card-badge.free {
    border-color: rgba(8, 118, 91, 0.35);
    background: rgba(8, 118, 91, 0.1);
    color: #08765b;
}

html[data-theme="light"] .route-card-stats span {
    border-color: rgba(120, 88, 53, 0.25);
    background: rgba(152, 116, 79, 0.09);
    color: #73583b;
}

html[data-theme="light"] .detail-meta .badge.cat {
    background: #e5f0f1 !important;
    color: #285e68 !important;
}

html[data-theme="light"] .detail-meta .badge.difficulty {
    background: #f5ead7 !important;
    color: #76531f !important;
}

html[data-theme="light"] .detail-meta .badge.duration {
    background: #e3f4ee !important;
    color: #08765b !important;
}

html[data-theme="light"] .route-pois-block,
html[data-theme="light"] .route-taxonomy-block,
html[data-theme="light"] .route-practical-block,
html[data-theme="light"] .route-reviews-block {
    border-color: var(--border-subtle);
    background: #ffffff;
}

html[data-theme="light"] .route-block-title {
    color: #4e5f5b;
}

html[data-theme="light"] .route-poi-item {
    color: #33413e;
}

html[data-theme="light"] .route-tax-chip {
    border-color: rgba(120, 88, 53, 0.3);
    background: #f4eee7;
    color: #73583b;
}

html[data-theme="light"] .route-rating-pill,
html[data-theme="light"] .route-mini-btn.active {
    border-color: rgba(138, 92, 8, 0.28);
    background: #fff6df;
    color: #805407;
}

html[data-theme="light"] .route-requirements span {
    color: #33413e;
}

html[data-theme="light"] .route-confidence p {
    color: #52635f;
}

html[data-theme="light"] .route-confidence strong {
    color: #08765b;
}

html[data-theme="light"] .route-review-item {
    color: #465652;
}

html[data-theme="light"] .route-review-item strong {
    color: #24322f;
}

html[data-theme="light"] .visitor-reviews-section {
    border-top-color: var(--border-subtle);
}

html[data-theme="light"] .route-review-empty,
html[data-theme="light"] .visitor-review-summary {
    color: #596763;
}

html[data-theme="light"] .visitor-review-item {
    background: var(--surface-raised);
}

html[data-theme="light"] .visitor-review-item p {
    color: #465652;
}

html[data-theme="light"] .route-detail-drawer {
    background: var(--surface-panel);
    border-color: rgba(152, 116, 79, 0.55);
}

html[data-theme="light"] .detail-header,
html[data-theme="light"] .detail-actions,
html[data-theme="light"] .dashboard-header,
html[data-theme="light"] .dashboard-footer,
html[data-theme="light"] .chat-input-area {
    background: var(--surface-panel);
    border-color: var(--border-subtle);
}

html[data-theme="light"] .dashboard-panel {
    background: rgba(255, 255, 255, 0.97);
}

html[data-theme="light"] .dashboard-toggle-header,
html[data-theme="light"] .dashboard-tabs {
    border-color: var(--border-subtle);
    background: var(--surface-panel);
    color: var(--text-primary);
}

html[data-theme="light"] .poi-chat-window,
html[data-theme="light"] .chat-messages-container {
    background: var(--surface-panel);
}

html[data-theme="light"] .chat-bubble.bot {
    background: var(--surface-control);
    color: var(--text-primary);
}

html[data-theme="light"] .chat-bubble.user {
    background: var(--brand-primary);
    color: #ffffff;
}

html[data-theme="light"] .custom-route-landing {
    background: rgba(35, 54, 50, 0.48);
}

html[data-theme="light"] .custom-route-filter-chip {
    border-color: var(--border-subtle);
    background: var(--surface-control);
    color: var(--text-primary);
}

html[data-theme="light"] .custom-route-filter-chip.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: #ffffff;
}

html[data-theme="light"] .payment-card {
    background: var(--surface-panel) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: 0 20px 55px var(--shadow-color) !important;
}

html[data-theme="light"] .payment-card h2,
html[data-theme="light"] #btn-close-payment-overlay {
    color: var(--text-primary) !important;
}

html[data-theme="light"] #payment-overlay-email {
    background: var(--surface-control) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] #btn-close-payment-overlay {
    background: var(--surface-control) !important;
    border-color: var(--border-subtle) !important;
}

html[data-theme="light"] .activation-pass-card,
html[data-theme="light"] .welcome-card-body,
html[data-theme="light"] .poi-welcome-card {
    background: var(--surface-panel);
}

html[data-theme="light"] .activation-pass-copy {
    color: #263a36;
}

html[data-theme="light"] .activation-pass-includes span {
    background: #f5efe7;
    border-color: #d8c8b4;
    color: #604a2f;
}

html[data-theme="light"] .activation-pass-note {
    color: #6b5131;
}

html[data-theme="light"] .activation-code-divider {
    color: #536660;
}

html[data-theme="light"] .activation-code-divider::before,
html[data-theme="light"] .activation-code-divider::after {
    background: #ced9d6;
}

html[data-theme="light"] #activation-code-input,
html[data-theme="light"] #activation-email-input {
    background: #edf3f1;
    border-color: #cbd8d5;
    color: #20332f;
}

html[data-theme="light"] #activation-code-input::placeholder,
html[data-theme="light"] #activation-email-input::placeholder {
    color: #667773;
    opacity: 1;
}

html[data-theme="light"] #activation-code-input:disabled {
    background: #e2e6e5;
    border-color: #c5ccca;
    color: #566560;
    opacity: 1;
}

html[data-theme="light"] #activation-code-input:disabled::placeholder {
    color: #687570;
}

html[data-theme="light"] .activation-code-row .voucher-icon-btn {
    background: #dcefed;
    border-color: #b7d7d2;
    color: #214b45;
}

html[data-theme="light"] .activation-code-row .voucher-icon-btn:disabled {
    opacity: 0.72;
}

html[data-theme="light"] .activation-protection-copy strong {
    color: #126b61;
}

html[data-theme="light"] .activation-protection-copy p,
html[data-theme="light"] .activation-without-email {
    color: #425752;
}

html[data-theme="light"] .license-recovery-open {
    color: #126b61;
}

html[data-theme="light"] #btn-close-activation {
    color: #253733 !important;
}

html[data-theme="light"] .activation-pass-header,
html[data-theme="light"] .landing-header,
html[data-theme="light"] footer {
    border-color: var(--border-subtle) !important;
}

html[data-theme="light"] .help-contact-link {
    color: #285b72;
    background: #edf6f8;
}

html[data-theme="light"] .help-contact-link.whatsapp {
    color: #126346;
    background: #edf8f3;
}

html[data-theme="light"] .media-access-link {
    border-color: rgba(40, 94, 104, 0.3);
    background: #edf5f6;
    color: #285e68;
}

html[data-theme="light"] .media-access-link:hover,
html[data-theme="light"] .media-access-link:focus-visible {
    border-color: rgba(40, 94, 104, 0.5);
    background: #e1eff0;
}

html[data-theme="light"] .media-access-label,
html[data-theme="light"] .media-access-arrow {
    color: #285e68;
}

html[data-theme="light"] .narration-box,
html[data-theme="light"] .dashboard-footer {
    border-color: var(--border-subtle);
}

html[data-theme="light"] .narration-header {
    color: #4e5f5b;
}

html[data-theme="light"] .narration-content {
    color: #3f4f4b;
}

html[data-theme="light"] .audio-waves span {
    background: var(--brand-primary);
}

html[data-theme="light"] .action-btn.stop {
    border-color: rgba(180, 63, 72, 0.38);
    background: #f9e9ea;
    color: #b43f48;
}

html[data-theme="light"] .action-btn.stop:hover:not(:disabled) {
    background: #f4d9dc;
}

html[data-theme="light"] .action-btn:disabled {
    border: 1px solid #cbd5d2;
    background: #edf1f0;
    color: #73817d;
    opacity: 0.65;
}

html[data-theme="light"] .action-btn.stop:disabled {
    border-color: rgba(180, 63, 72, 0.3);
    background: #f7eeee;
    color: #a8484e;
}

html[data-theme="light"] .route-auto-narration-copy strong {
    color: #164e4a;
}

html[data-theme="light"] .route-auto-narration-copy small {
    color: #52635f;
}

html[data-theme="light"] #simulation-controls > div:first-child {
    border-bottom-color: var(--border-subtle) !important;
}

html[data-theme="light"] #lbl-sim-gps-status-title,
html[data-theme="light"] #gps-status-text,
html[data-theme="light"] #lbl-sim-mode-desc {
    color: #24322f !important;
}

html[data-theme="light"] #lbl-sim-mode-help {
    color: #52635f !important;
}

html[data-theme="light"] #simulator-toggle:not(:checked) + .slider {
    border-color: #98a6a2;
    background: #d3dcda;
}

html[data-theme="light"] #simulator-toggle:not(:checked) + .slider::before {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(35, 50, 47, 0.35);
}

html[data-theme="light"] #simulator-toggle:focus-visible + .slider {
    outline: 2px solid #285e68;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
