/* CONFIGURACIÓN GENERAL Y VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
    --primary-color: #0f172a;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Layout Dashboard para evitar scroll */
.dashboard-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    padding: 0 20px 20px 20px;
    height: calc(100vh - 220px);
    min-height: 500px;
    overflow: hidden;
    max-width: 100% !important;
}

.full-width-layout {
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible !important;
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
}

.scroll-panel {
    height: 100%;
    overflow-y: auto;
    padding-right: 5px;
}

/* Sub-grid para resultados en paralelo */
.results-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr;
    gap: 20px;
    height: 100%;
    align-items: start;
}

@media (max-width: 1300px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

#mapa-destinos {
    height: 100% !important;
    min-height: 600px;
    width: 100%;
    border-radius: 20px;
    z-index: 1;
}

#hero.compact-hero {
    padding: 20px 5% !important;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
}

#hero.compact-hero h2 {
    font-size: 1.5rem !important;
    margin-bottom: 5px;
}

#hero.compact-hero p {
    font-size: 0.9rem !important;
    margin-bottom: 10px;
}

main.home-main {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0;
}

main {
    padding: 40px 5% 60px;
    max-width: 1300px;
    margin: 0 auto;
}

.home-main {
    padding: 0;
    max-width: none;
}

@media (max-width: 768px) {
    main {
        padding: 20px 5% 40px;
    }
}

/* NAVEGACIÓN - Efecto Glassmorphism */
header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.nav-global {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-global .logo h1 {
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
    line-height: 1;
}

.nav-global .logo h1 span {
    color: var(--accent-color);
}

.nav-global .logo {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex: 1;
}

.nav-global .logo::after {
    content: 'Donde tus estudios se deciden con mates.';
    margin: 0 auto;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

@media (max-width: 992px) {
    .nav-global .logo::after { display: none; }
}

.nav-global ul {
    display: flex;
    list-style: none;
    gap: 5px;
    align-items: center;
    margin: 0;
}

.nav-global li {
    position: relative;
    padding: 10px 15px;
}

.nav-global a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-global a:hover,
.nav-global li:hover>a {
    color: var(--accent-color);
}

/* DROPDOWN MENU */
.nav-global ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 260px;
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1050;
    gap: 0;
}

.nav-global li:hover>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-global ul ul li {
    padding: 0;
}

.nav-global ul ul a {
    padding: 12px 20px;
    display: block;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-global ul ul a:hover {
    background-color: var(--bg-light);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

.nav-global .btn-login {
    background-color: var(--accent-color);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
}

.nav-global .btn-login:hover {
    background-color: var(--accent-hover);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

/* HERO SECTION - Más vibrante y moderno */
#hero {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(59, 130, 246, 0.6) 100%),
        url('https://images.unsplash.com/photo-1523050853063-bd388f9c7d13?auto=format&fit=crop&w=1920&q=80') center/cover;
    color: var(--white);
    padding: 60px 5% 40px;
    text-align: center;
    border-radius: 0 0 40px 40px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

#hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
}

.search-container {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.search-container input {
    flex: 1;
    padding: 16px 24px;
    border-radius: 50px 0 0 50px;
    border: none;
    font-size: 1.1rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

.search-container button {
    padding: 16px 36px;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.search-container button:hover {
    background-color: var(--accent-hover);
    transform: scale(1.02);
}

/* DASHBOARD HEADER CONTROLS */
.dashboard-header-controls {
    background: var(--white);
    margin: 16px;
    padding: 18px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
}

.controls-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.controls-title h2 { font-size: 1.4rem; color: var(--primary-color); margin-bottom: 2px; }
.controls-title p { font-size: 0.85rem; color: var(--text-muted); }

.controls-actions { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 600px) {
    .controls-actions { gap: 8px; }
    .controls-actions .btn-buscar-main { width: 100%; max-width: 360px; justify-content: center; }
    .controls-actions a.btn-buscar-main, .controls-actions #btnGuardarBusquedaTop { width: auto; flex: 1 1 auto; min-width: 130px; }
}

.controls-grid-main {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 30px;
}

@media (max-width: 1200px) { .controls-grid-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .controls-grid-main { grid-template-columns: 1fr; } }

.control-group-box {
    background: #fcfcfd;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.control-group-box h4 {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* FILTROS COLAPSABLES */
.filtros-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: 'Inter', sans-serif;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.filtros-toggle span:first-child {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.filtros-arrow {
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

#btnToggleFiltros[aria-expanded="true"] #filtrosArrow {
    transform: rotate(-180deg);
}

.filtros-body {
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 10px;
}

.control-item { margin-bottom: 12px; }
.control-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.control-label label { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.control-label span { font-size: 0.82rem; font-weight: 700; color: var(--accent-color); background: #eff6ff; padding: 2px 8px; border-radius: 10px; }

.simple-label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 5px; }
.control-item select { width: 100%; padding: 8px 10px; border-radius: 12px; border: 1.5px solid #e2e8f0; font-size: 0.85rem; }

.geo-tools { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.geo-tools button { background: none; border: none; color: var(--accent-color); font-size: 0.75rem; text-decoration: underline; cursor: pointer; padding: 0; }
.geo-tools span { font-size: 0.7rem; color: var(--text-muted); }

.weights-grid-horizontal {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-tiny { background: #f1f5f9; border: 1px solid #e2e8f0; padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-tiny:hover { background: #e2e8f0; }

/* GUÍA DE PASOS */
.steps-guide {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-radius: 14px;
    padding: 10px 16px;
    margin-bottom: 14px;
    border: 1px solid #dbeafe;
    flex-wrap: wrap;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.45;
    transition: opacity 0.3s;
}

.step-item.step-active { opacity: 1; }

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.step-item.step-active .step-num {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 3px 10px rgba(59,130,246,0.4);
}

.step-text strong { display: block; font-size: 0.9rem; color: var(--primary-color); line-height: 1.2; font-weight: 700; }
.step-text span   { font-size: 0.75rem; color: var(--text-muted); }

.step-arrow { color: #94a3b8; font-size: 1.1rem; font-weight: 700; }

.btn-buscar-main {
    margin-left: auto;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(59,130,246,0.4);
    transition: all 0.2s;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.btn-buscar-main:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(59,130,246,0.5); }

@media (max-width: 800px) {
    .steps-guide { gap: 8px; padding: 12px 14px; }
    .step-arrow  { display: none; }
    .btn-buscar-main { margin-left: 0; width: 100%; justify-content: center; }
}

/* PERFILES RÁPIDOS */
.quick-profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

.qp-btn {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.qp-btn:hover   { background: var(--accent-color); color: white; border-color: var(--accent-color); transform: scale(1.04); }
.qp-btn.active  { background: var(--accent-color); color: white; border-color: var(--accent-color); }

.floating-matrix-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    background: white;
    box-shadow: var(--shadow-hover);
    border-radius: 16px;
    padding: 20px;
    z-index: 100;
    border: 1px solid #e2e8f0;
    margin-top: 10px;
}

.role-save-section { position: relative; }

.breadcrumbs {
    margin-top: 30px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* FILTROS Y GRID */
#comparador {
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

#comparador h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.filtros {
    background: var(--white);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 40px;
    display: flex;
    gap: 40px;
    box-shadow: var(--shadow-sm);
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filtros label {
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Custom Sliders Premium */
input[type=range] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    background: transparent;
    cursor: pointer;
}
/* Track WebKit (Chrome, Safari, Edge) */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 4px;
    border: 1px solid #94a3b8;
}
/* Thumb WebKit */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -8px;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(59,130,246,0.5), 0 0 0 1px rgba(0,0,0,0.1);
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* Track Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #cbd5e1;
    border: 1px solid #94a3b8;
    border-radius: 4px;
}
/* Thumb Firefox */
input[type=range]::-moz-range-thumb {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59,130,246,0.5), 0 0 0 1px rgba(0,0,0,0.1);
}
input[type=range]::-moz-range-thumb:hover { transform: scale(1.15); }
input[type=range]:focus { outline: none; }
input[type=range]:focus::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(59,130,246,0.25), 0 2px 6px rgba(59,130,246,0.5); }
input[type=range]:focus::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(59,130,246,0.25), 0 2px 6px rgba(59,130,246,0.5); }

select {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-dark);
    outline: none;
    background-color: var(--white);
    cursor: pointer;
}

#valorPresupuesto {
    font-weight: 800;
    color: var(--accent-color);
    background: #eff6ff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* CARDS */
.grid-ciudades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    min-height: 300px;
}

.card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-img-placeholder {
    width: 100%;
    height: 180px;
    background-color: #e2e8f0;
    background-position: center;
    background-size: cover;
}

.card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 800;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.card-info .pill {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.card a.btn-ver {
    margin-top: auto;
    background-color: transparent;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--accent-color);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.card a.btn-ver:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

/* FOOTER */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 5% 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

footer p.copyright {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

/* VISTA DETALLE */
.detalle-wrapper {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-volver:hover {
    color: var(--accent-color);
}

.ficha {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.ficha-img-header {
    width: calc(100% + 80px);
    margin: -40px -40px 30px -40px;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 24px 24px 0 0;
}

.ficha h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.grid-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.info-item .icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.info-item .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-item .value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.ficha hr {
    border: none;
    height: 1px;
    background: #e2e8f0;
    margin: 30px 0;
}

.ficha h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.texto-largo {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* SECCIÓN COMUNIDAD / FORMULARIO */
.seccion-comunidad {
    padding: 60px 5%;
    max-width: 1000px;
    margin: 0 auto 40px;
}

.comunidad-header {
    text-align: center;
    margin-bottom: 40px;
}

.comunidad-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.comunidad-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.form-moderno {
    background: var(--white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row>* {
    flex: 1;
    min-width: 250px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    width: 100%;
}

.form-moderno label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-moderno input,
.form-moderno select,
.form-moderno textarea {
    padding: 14px 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-moderno input:focus,
.form-moderno select:focus,
.form-moderno textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: var(--white);
}

.btn-submit {
    margin-top: 20px;
    width: 100%;
    padding: 16px;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.form-moderno input[type="number"] {
    max-width: 100%;
}

.feedback-msg {
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
    min-height: 24px;
}

.feedback-success {
    color: #10b981;
}

.feedback-error {
    color: #ef4444;
}

/* Ajustes para el formulario expandido */
.form-moderno textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="number"] {
    width: 100%;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* EXTRA: DISEÑO EDITORIAL PARA DETALLE.HTML (Ficha completa) */
.articulo-wiki {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .articulo-wiki {
        grid-template-columns: 1fr;
    }
}

.bloque-texto {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    border-left: 5px solid var(--accent-color);
}

.bloque-texto h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bloque-texto p {
    color: var(--text-dark);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Sidebar de la ficha */
.sidebar-ficha {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 100px;
}

.sidebar-ficha h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.dato-lista {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #cbd5e1;
}

.dato-lista:last-child {
    border-bottom: none;
}

.dato-lista strong {
    color: var(--text-muted);
}

.dato-lista span {
    font-weight: 700;
    color: var(--primary-color);
}

/* --- MEJORAS DE SESIÓN Y FAVORITOS RÁPIDOS --- */

.btn-logged {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
}

#globalLogout:hover {
    text-decoration: underline;
}

/* Icono favorito en tarjeta */
.fav-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    z-index: 10;
    border: none;
}

.fav-btn:hover {
    transform: scale(1.15);
    background: white;
}

.fav-btn.active {
    color: #ef4444;
}

/* Ajustes Área Personal */
.user-welcome {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
}

.fav-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.fav-card:hover {
    transform: translateY(-5px);
}

.fav-img {
    height: 150px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.fav-body {
    padding: 15px;
}

.fav-title {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.fav-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .nav-global ul {
        gap: 0;
    }
    
    #hero h2 {
        font-size: 2.5rem;
    }

    .articulo-wiki {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 5%;
    }

    .nav-global {
        flex-direction: column;
        gap: 15px;
    }

    .nav-global ul {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
    }

    .nav-global li {
        padding: 5px 10px;
    }

    #hero {
        padding: 60px 5% 40px;
        border-radius: 0 0 20px 20px;
    }

    #hero h2 {
        font-size: 2rem;
    }

    .criterios-grid {
        gap: 10px;
    }

    .criterio-chip {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .ranking-container {
        padding: 20px;
    }

    .ranking-table thead {
        display: none;
    }

    .ranking-table td {
        display: block;
        text-align: right;
        padding: 10px 5px;
        border-bottom: 1px solid #f1f5f9;
    }

    .ranking-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        color: var(--text-muted);
    }

    .rank-city {
        justify-content: flex-end;
    }

    .rank-score {
        text-align: right;
    }

    .filtros {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    input[type="range"] {
        width: 100%;
    }

    .seccion-destino {
        flex-direction: column !important;
        gap: 30px;
    }

    .seccion-img {
        height: 250px;
    }
}

@media (max-width: 480px) {
    #hero h2 {
        font-size: 1.6rem;
    }

    .nav-global .logo h1 {
        font-size: 1.5rem;
    }

    .btn-login {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* --- NOTIFICACIONES TOAST --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
    min-width: 200px;
    animation: slideIn 0.3s ease-out forwards;
    cursor: pointer;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.error {
    background: #ef4444;
}

.toast.success {
    background: #10b981;
}

/* ESTILOS PAGINA DESTINOS ACTUALIZADA (WIRE FRAME) */

.breadcrumbs-detalle {
    background: #f1f5f9;
    padding: 12px 5%;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.container-breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumbs-detalle a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.detalle-principal {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 5%;
}

#detalle-header-seccion {
    text-align: center;
    margin-bottom: 50px;
}

#detalle-header-seccion h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 30px;
    letter-spacing: -2px;
}

/* Tabs Estilo Premium */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
    margin-bottom: 40px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 15px 25px;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--accent-color);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px 3px 0 0;
}

/* Secciones Alternas (Zig-Zag) */
.seccion-destino {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
    opacity: 1;
    /* Cambiado a 1 para asegurar visibilidad inicial */
    transform: translateY(0);
}

.seccion-destino:nth-child(even) {
    flex-direction: row-reverse;
}

.seccion-img {
    flex: 1;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 400px;
}

.seccion-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.seccion-img:hover img {
    transform: scale(1.05);
}

.seccion-text {
    flex: 1.2;
}

.seccion-text h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.seccion-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* Skeleton animation */
.skeleton-title {
    height: 60px;
    background: #e2e8f0;
    width: 60%;
    margin: 0 auto 30px;
    border-radius: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@media (max-width: 900px) {

    .seccion-destino,
    .seccion-destino:nth-child(even) {
        flex-direction: column;
        gap: 30px;
    }

    .seccion-img {
        width: 100%;
        height: 300px;
    }

    #detalle-header-seccion h1 {
        font-size: 2.5rem;
    }
}

/* Animación de entrada para mini-páginas */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInSlide 0.4s ease-out forwards;
}

/* MEJORAS DE ESTILO BUSCADOR Y TABS PREMIUM */

.matrix-cell-medium {
    background: rgba(59, 130, 246, 0.05) !important;
}

/* --- MODAL COMPARADOR --- */
.modal-comparador {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content-comp {
    background: white;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease-out;
}

.modal-header-comp {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-comp h3 {
    margin: 0;
    color: var(--primary-color);
}

.comparador-grid {
    padding: 30px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.comp-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.comp-city-header {
    text-align: center;
    margin-bottom: 20px;
}

.comp-city-header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
}

.comp-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.comp-metric-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    width: 60%;
    overflow: hidden;
}

.comp-metric-fill {
    height: 100%;
    background: var(--accent-color);
}

.close-btn {
    background: #f1f5f9;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.header-search {
    background: rgba(241, 245, 249, 0.7) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(203, 213, 225, 0.5);
    padding: 2px 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search:focus-within {
    background: var(--white) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-color: var(--accent-color);
}

.header-search input {
    font-weight: 500;
    color: var(--primary-color);
}

.header-search span {
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-search:hover span {
    transform: scale(1.2) rotate(10deg);
}

/* Efectos en los Tabs */
.tab-btn {
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.tab-btn:hover::before {
    transform: translateY(0);
}

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

/* Mejoras en las mini-páginas */
.mini-pagina {
    padding-top: 20px;
}

.seccion-img {
    position: relative;
}

.seccion-img::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.seccion-text h2 {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- NUEVOS ESTILOS PARA RANKING Y CRITERIOS (AHP SORT II PREP) --- */

.ranking-section {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.ranking-container {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ranking-header {
    text-align: center;
    margin-bottom: 30px;
}

.ranking-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.criterios-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.criterio-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    user-select: none;
}

.criterio-chip:hover {
    border-color: var(--accent-color);
    background: #eff6ff;
}

.criterio-chip input {
    display: none;
}

.criterio-chip.active {
    background: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.near-threshold {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ranking-table th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--bg-light);
}

.ranking-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.ranking-row {
    transition: background 0.2s;
    cursor: pointer;
}

.ranking-row:hover {
    background: #f8fafc;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-muted);
    width: 50px;
}

.ranking-row:nth-child(1) .rank-number { color: #fbbf24; }
.ranking-row:nth-child(2) .rank-number { color: #94a3b8; }
.ranking-row:nth-child(3) .rank-number { color: #b45309; }

/* Resaltado de fila para el podio */
.ranking-row:nth-child(1) { background: linear-gradient(90deg, #fffbeb 0%, transparent 55%); }
.ranking-row:nth-child(2) { background: linear-gradient(90deg, #f1f5f9 0%, transparent 55%); }
.ranking-row:nth-child(3) { background: linear-gradient(90deg, #fef3c7 0%, transparent 55%); }
.ranking-row:nth-child(1):hover { background: linear-gradient(90deg, #fef9c3 0%, #f8fafc 100%); }
.ranking-row:nth-child(2):hover { background: linear-gradient(90deg, #e9eef4 0%, #f8fafc 100%); }
.ranking-row:nth-child(3):hover { background: linear-gradient(90deg, rgba(253,230,138,0.2) 0%, #f8fafc 100%); }

.rank-city {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

.rank-city img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.rank-score {
    font-weight: 800;
    color: var(--accent-color);
    text-align: right;
}

/* --- TABS GUÍA DE SUPERVIVENCIA --- */
.guide-content {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.guide-step {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.step-num {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

/* --- MEJORAS DE CRITERIOS Y RANKING --- */

/* Glassmorphism para Controles AHP */
#ahpControls {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.4s ease;
}

.weight-control input[type="range"] {
    accent-color: var(--primary-color);
    height: 6px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
}

/* Toasts */
.toast {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-left: 5px solid white;
    font-family: inherit;
}
.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
/* --- PANEL AHP DESTACADO --- */
.ahp-weights-section {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
}
.ahp-weights-section h4 {
    color: var(--accent-color);
}

/* --- MAPA STICKY EN DESKTOP ANCHO --- */
@media (min-width: 1300px) {
    .results-grid > div:last-child {
        position: sticky;
        top: 90px;
        align-self: start;
    }
}

/* --- BOTÓN ME GUSTA EN FILA RANKING --- */
.rank-fav-btn {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.rank-fav-btn:hover { background: #fef2f2; border-color: #fecaca; transform: scale(1.08); }
.rank-fav-btn.is-fav { background: #fef2f2; border-color: #fecaca; }


/* --- PILLS DE BÚSQUEDAS GUARDADAS --- */
.saved-search-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.saved-search-pill:hover {
    border-color: var(--accent-color);
    background: #eff6ff;
    transform: translateX(2px);
}
.pill-search-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}
.pill-search-meta {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.pill-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.pill-delete-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* --- SKELETON LOADING RANKING --- */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.skeleton-row td { padding: 16px 15px; border-bottom: 1px solid #f1f5f9; }
.skeleton-cell {
    height: 14px;
    border-radius: 6px;
    background: #e2e8f0;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

/* --- EXPANSIÓN: MAPA DE DESTINOS --- */
#mapa-destinos {
    z-index: 1;
    transition: transform 0.3s ease;
}

.leaflet-popup-content-wrapper {
    border-radius: 15px !important;
    padding: 10px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    border: none !important;
}

.leaflet-popup-content strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.leaflet-container a.leaflet-popup-close-button {
    padding: 8px 8px 0 0 !important;
}
/* --- RESPONSIVIDAD ADICIONAL --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1100;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .nav-global ul#navMenu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 80px 20px 40px;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        gap: 10px;
        align-items: stretch;
    }

    .nav-global ul#navMenu.active {
        right: 0;
    }

    .nav-global ul#navMenu li {
        padding: 0;
    }

    .nav-global ul#navMenu a {
        display: block;
        padding: 12px 15px;
        border-radius: 10px;
        font-size: 1.1rem;
    }

    .nav-global ul#navMenu .btn-login {
        margin-top: 20px;
        text-align: center;
        border-radius: 12px;
    }

    /* Dropdowns en móvil */
    .nav-global ul#navMenu ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        background: #f8fafc;
        margin-top: 5px;
        display: none; /* Se podría implementar toggle para estos también */
    }
    
    /* Mostrar submenús en móvil de forma sencilla */
    .nav-global ul#navMenu li:hover > ul {
        display: block;
    }
}

@media (max-width: 600px) {
    .dashboard-layout {
        padding: 0 10px 10px 10px;
    }

    #hero.compact-hero {
        border-radius: 0;
        margin-bottom: 10px;
    }

    .ranking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .ranking-table td {
        font-size: 0.9rem;
    }
}

/* --- FILTROS BÁSICOS: PILLS DE SEGURIDAD --- */
.filter-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}
.filter-pill {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.18s;
}
.filter-pill:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: #eff6ff;
}
.filter-pill.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ============================================================
   EFECTOS VISUALES DE BÚSQUEDA (Buscar Destinos → Ranking)
   ============================================================ */

/* Botón "Buscar Destinos" en estado de carga */
.btn-loading {
    pointer-events: none;
    opacity: 0.85;
    background: #6366f1 !important;
}
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Overlay con efecto radar mientras se calcula el ranking */
.ranking-container { position: relative; }
.ranking-container.searching {
    transition: filter 0.3s ease;
    filter: saturate(0.85);
}
.search-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(2px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 5;
}
.search-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.search-overlay-inner {
    text-align: center;
    color: var(--primary-color);
}
.search-overlay-text {
    margin-top: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
}
.search-overlay-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Radar animado */
.search-radar {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid rgba(59,130,246,0.3);
    position: relative;
    box-shadow: inset 0 0 30px rgba(59,130,246,0.15);
}
.search-radar::before,
.search-radar::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    animation: radar-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.search-radar::after { animation-delay: 0.8s; }
@keyframes radar-ping {
    0%   { transform: scale(0.4); opacity: 1; }
    80%  { opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Pulso suave en el mapa mientras se busca */
.searching-pulse {
    animation: map-pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(59,130,246,0.4);
}
@keyframes map-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50%  { box-shadow: 0 0 0 14px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* Entrada animada de las filas del ranking */
.row-fade-in {
    opacity: 0;
    transform: translateY(8px);
    animation: row-in 0.45s ease-out forwards;
}
@keyframes row-in {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   BOTÓN COMPARAR — más visible al seleccionar ciudades
   ============================================================ */
#btnComparar {
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
    border-radius: 50px !important;
    font-weight: 700;
}

/* Estado: 1 ciudad seleccionada (insuficiente, dale pista) */
#btnComparar.compare-hint {
    background: #f1f5f9 !important;
    color: var(--text-muted) !important;
    border: 1.5px dashed #cbd5e1 !important;
    box-shadow: none;
}

/* Estado: 2+ ciudades, listo para usar */
#btnComparar.compare-ready {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%) !important;
    color: white !important;
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45),
                0 0 0 4px rgba(239, 68, 68, 0.15);
    transform: scale(1.04);
}
#btnComparar.compare-ready:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.55),
                0 0 0 6px rgba(239, 68, 68, 0.18);
}

/* Pulso de aparición cuando alcanzas el mínimo de 2 */
#btnComparar.compare-pulse {
    animation: compare-pop 1.8s ease-out;
}
@keyframes compare-pop {
    0%   { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    25%  { transform: scale(1.15); }
    50%  { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0); }
    100% { transform: scale(1.04); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45), 0 0 0 4px rgba(239, 68, 68, 0.15); }
}

/* GRID DE DESTINOS */
.grid-ciudades {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* NUEVA CARD DE DESTINOS */
.destinos-card {
    background: var(--white);
    border-radius: 24px; /* Bordes más redondeados como en la imagen 'buscar' */
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.destinos-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.destinos-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: capitalize;
}

.destinos-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.destinos-card-body h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 800;
}

.destinos-card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.destinos-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.precio-tag {
    display: flex;
    flex-direction: column;
}

.precio-tag small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.precio-tag span {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
}

.btn-ver-new {
    background: #f1f5f9;
    color: var(--accent-color);
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.destinos-card:hover .btn-ver-new {
    background: var(--accent-color);
    color: white;
}