:root {
    /* Colors Palette */
    --bg-main: #0A192F;
    /* Deep dark technical bg (Azul Noche Profundo) */
    --bg-surface: #112240;
    --bg-surface-glass: rgba(17, 34, 64, 0.75);

    --steel-gray: #8892B0;
    /* Gris Platino oscuro para texto secundario */
    --steel-light: #CBD5E1;
    /* Gris Platino */
    --blue-radio: #0077FF;
    /* Azul Radioeléctrico */
    --blue-radio-glow: rgba(0, 119, 255, 0.4);
    --green-valdivia: #2DBE60;
    /* Verde Bosque Valdiviano */
    --green-glow: rgba(45, 190, 96, 0.3);

    --text-primary: #CCD6F6;
    /* Gris Platino brillante */
    --text-muted: #8892B0;

    --border-subtle: rgba(255, 255, 255, 0.08);

    /* Fonts */
    --font-ui: 'Roboto', sans-serif;
    --font-head: 'Montserrat', sans-serif;
    --font-tech: 'JetBrains Mono', monospace;

    /* Layout */
    --nav-height: 100px;
    --container-w: 1200px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Utility */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

.tech-font {
    font-family: var(--font-tech);
    color: var(--blue-radio);
    letter-spacing: 1px;
}

.highlight {
    color: var(--blue-radio);
}

.highlight-green {
    color: var(--green-valdivia);
}

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

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section.dark-bg {
    background-color: #060F1E;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-family: var(--font-ui);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    gap: 0.5rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--blue-radio);
    color: white;
    box-shadow: 0 4px 15px var(--blue-radio-glow);
}

.btn-primary:hover {
    background: #0088D6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--blue-radio-glow);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--blue-radio), #0059B3);
    color: white;
    position: relative;
    z-index: 1;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0059B3, var(--blue-radio));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: var(--transition-smooth);
}

.btn-gradient:hover::before {
    opacity: 1;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--blue-radio-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--steel-gray);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.btn-outline-green {
    background: transparent;
    border: 2px solid var(--green-valdivia);
    color: var(--green-valdivia);
}

.btn-outline-green:hover {
    background: var(--green-glow);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--green-glow);
}

.btn-block {
    width: 100%;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--bg-main);
    background-image: linear-gradient(rgba(10, 25, 47, 0.85), rgba(10, 25, 47, 0.95)), url('1_inicio/valdivia.png');
    background-size: cover;
    background-position: center top;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    transition: var(--transition-fast);
}

.navbar.scrolled {
    background-image: linear-gradient(rgba(10, 25, 47, 0.95), rgba(10, 25, 47, 0.98)), url('1_inicio/valdivia.png');
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 75px;
    width: auto;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.callsign {
    font-family: var(--font-tech);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.location {
    font-size: 0.75rem;
    color: var(--steel-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 0.9rem;
}

.nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--steel-light);
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--blue-radio);
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-intranet {
    display: flex;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile Nav */
.mobile-nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(-150%);
    transition: var(--transition-smooth);
    z-index: 999;
}

.mobile-nav.active {
    transform: translateY(0);
}

.mobile-link {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    background-image: url('1_inicio/valdivia.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(0, 119, 255, 0.3) 0%, rgba(10, 25, 47, 0.9) 60%),
        radial-gradient(circle at 20% 80%, rgba(45, 190, 96, 0.15) 0%, rgba(10, 25, 47, 0.85) 50%);
    z-index: -1;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(45, 190, 96, 0.1);
    border: 1px solid rgba(45, 190, 96, 0.3);
    border-radius: 50px;
    color: var(--green-valdivia);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--green-valdivia);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(45, 190, 96, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(45, 190, 96, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(45, 190, 96, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(45, 190, 96, 0);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--steel-light);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* Hero Carousel */
.hero-carousel-wrapper {
    position: relative;
    width: 85%;
    margin: 0 auto;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-carousel-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.hero-carousel-media.active {
    opacity: 1;
    z-index: 2;
}

/* Slider Track */
.hero-slider-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem 0;
    overflow: hidden;
}

.slider-track {
    display: flex;
    gap: 3rem;
    width: calc(200px * 8);
    /* approximate */
    animation: slide-left 30s linear infinite;
}

.slide-item {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-tech);
    color: var(--steel-light);
}

.slide-item i {
    color: var(--blue-radio);
    font-size: 1.2rem;
}

@keyframes slide-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Sections Global */
.section-badge {
    font-family: var(--font-tech);
    color: var(--blue-radio);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Quiénes Somos */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.lead-text {
    font-size: 1.25rem;
    font-family: var(--font-head);
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-text p {
    color: var(--steel-light);
    margin-bottom: 1.5rem;
}

.features-list {
    list-style: none;
    margin-top: 2rem;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.features-list i {
    color: var(--blue-radio);
    font-size: 1.25rem;
    background: rgba(0, 162, 255, 0.1);
    padding: 0.4rem;
    border-radius: 50%;
}

.about-gallery {
    position: relative;
    height: 480px;
}

.historical-card {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-smooth);
}

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

.card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 1.5rem 1rem 1rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-tech);
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.card-1 {
    width: 55%;
    height: 210px;
    top: 0;
    left: 0;
    z-index: 2;
}

.card-2 {
    width: 55%;
    height: 210px;
    top: 100px;
    right: 0;
    z-index: 3;
}

.card-3 {
    width: 65%;
    height: 190px;
    bottom: 0;
    left: 10%;
    z-index: 4;
}

.historical-card:hover {
    z-index: 10;
    transform: scale(1.05);
}

/* CB6MAR Section */
.technical-bg {
    background-color: var(--bg-surface);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--green-valdivia);
    font-family: var(--font-tech);
    font-weight: 700;
    background: rgba(45, 190, 96, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid rgba(45, 190, 96, 0.3);
    margin-bottom: 1rem;
}

.blinking-dot {
    width: 10px;
    height: 10px;
    background: var(--green-valdivia);
    border-radius: 50%;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.tag-combo {
    font-family: var(--font-tech);
    color: var(--steel-light);
    margin-bottom: 3rem;
}

.tag-combo strong {
    color: var(--text-primary);
}

.diploma-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
}

.hierarchical-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.list-group-title {
    font-size: 1.2rem;
    color: var(--blue-radio);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-subtle);
}

.list-items span,
.list-items .item-with-desc {
    color: var(--text-primary);
    position: relative;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition-fast);
    cursor: default;
}

.list-items span:hover,
.list-items .item-with-desc:hover {
    background: rgba(0, 119, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.list-items span::before,
.item-with-desc::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 12px;
    width: 10px;
    height: 2px;
    background: var(--border-subtle);
    transition: var(--transition-fast);
}

.list-items span:hover::before,
.item-with-desc:hover::before {
    background: var(--blue-radio);
}

.desc-micro {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.map-card {
    border-radius: 12px;
    overflow: hidden;
}

.map-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    font-family: var(--font-tech);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.map-container {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.map-container img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Frecuencias - Modern LCD Cards */
.freq-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.freq-card {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.freq-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 162, 255, 0.4);
    box-shadow: 0 15px 40px rgba(0, 162, 255, 0.15);
}

.freq-screen {
    background: #000;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--blue-radio);
}

.freq-screen img {
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 120, 0, 0.3));
    /* Naranja suave típico de LCD */
}

.freq-details {
    padding: 2rem;
}

.freq-details h3 {
    color: var(--text-primary);
    font-size: 1.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.freq-details p {
    color: var(--steel-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.freq-specs {
    list-style: none;
}

.freq-specs li {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
}

.freq-specs li strong {
    color: var(--blue-radio);
    margin-right: 0.5rem;
}

/* Actividades / Masonry */
.masonry-gallery {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.masonry-item img {
    width: 100%;
    display: block;
    transition: var(--transition-smooth);
}

.masonry-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 162, 255, 0.2);
    opacity: 0;
    transition: var(--transition-fast);
}

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

.masonry-item:hover::after {
    opacity: 1;
}

/* Contacto */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 2rem;
    color: var(--blue-radio);
    background: rgba(0, 162, 255, 0.1);
    height: max-content;
    padding: 0.8rem;
    border-radius: 12px;
}

.contact-item h4 {
    margin-bottom: 0.25rem;
}

.contact-form {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--steel-light);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-radio);
    background: rgba(0, 0, 0, 0.4);
}

.map-full {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Footer */
.site-footer {
    background: #05080C;
    padding: 4rem 0 0 0;
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--blue-radio);
    margin-bottom: 1rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--blue-radio);
    color: #fff;
    transform: translateY(-3px);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--steel-light);
}

.footer-links a:hover {
    color: var(--blue-radio);
    padding-left: 0.5rem;
}

.affiliate-logos {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.partner-logo {
    height: 40px;
    filter: grayscale(100%) opacity(0.7);
    transition: var(--transition-fast);
}

.partner-logo:hover {
    filter: grayscale(0%) opacity(1);
}

.footer-bottom {
    background: #030508;
    padding: 1.5rem 0;
    color: var(--text-muted);
}

.micro-text {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Oculta los campos del detector de autocompletado de contraseñas del navegador cuando el modal está cerrado */
    transition: var(--transition-fast);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible; /* Permite visualizar e interactuar con los campos al abrir el modal */
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 3rem 2rem;
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: #fff;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--steel-light);
}

.input-with-icon .form-control {
    padding-left: 2.5rem;
}

.text-link {
    color: var(--blue-radio);
    text-decoration: underline;
}

/* Enlaces Destacados - Home */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.25rem;
    width: 170px;
    transition: var(--transition-smooth);
}

.link-img-wrapper {
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 12px;
    transition: var(--transition-fast);
}

.link-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.link-card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--steel-light);
    text-align: center;
}

.link-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 162, 255, 0.15);
    border-color: rgba(0, 162, 255, 0.4);
}

.link-card:hover .link-img-wrapper {
    background: rgba(255, 255, 255, 0.1);
}

.link-card:hover span {
    color: var(--text-primary);
}

/* Inner Pages Header */
.page-content {
    padding-top: var(--nav-height);
    min-height: calc(100vh - 200px);
}

.page-header {
    position: relative;
    padding: 8rem 0 4rem;
    text-align: center;
    background-color: var(--bg-main);
    background-image: linear-gradient(rgba(10, 25, 47, 0.4), rgba(10, 25, 47, 0.98)), url('1_inicio/valdivia.png');
    background-size: cover;
    background-position: center 30%;
    border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* Responsive */
@media (max-width: 1150px) {

    .hero-content,
    .about-grid,
    .diploma-grid,
    .contact-wrapper,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .nav-links,
    .btn-intranet {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .masonry-gallery {
        column-count: 2;
    }

    .about-gallery {
        height: 350px;
        margin-top: 3rem;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .masonry-gallery {
        column-count: 1;
    }

    .historical-card {
        position: relative;
        width: 100%;
        height: 200px;
        inset: auto;
        margin-bottom: 1rem;
    }

    .about-gallery {
        height: auto;
        display: flex;
        flex-direction: column;
    }
}

/* ==========================================
   SECCIÓN DE EMERGENCIAS (LOS RÍOS)
   ========================================== */

:root {
    --red-emerg: #E63946;
    --red-emerg-glow: rgba(230, 57, 70, 0.4);
    --yellow-warning: #FFB703;
    --yellow-warning-glow: rgba(255, 183, 3, 0.3);
    --bg-card-emerg: #112240;
    --bg-card-emerg-hover: #1b305a;
    --text-tech: #00A2FF;
}

/* Banner de Alerta Superior Compacto */
.alert-header-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.2rem;
    background: rgba(230, 57, 70, 0.08);
    border: 1px dashed var(--red-emerg);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    text-align: left;
    box-shadow: 0 2px 10px rgba(230, 57, 70, 0.05);
}

.alert-banner-icon {
    font-size: 1.3rem;
    color: var(--red-emerg);
    animation: alert-pulse 1.5s infinite alternate;
    flex-shrink: 0;
}

.alert-banner-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.alert-banner-text h3 {
    color: #FFF;
    font-size: 0.85rem;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.alert-banner-text p {
    color: var(--steel-light);
    font-size: 0.82rem;
    margin: 0;
}

.alert-pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(230, 57, 70, 0.15);
    color: var(--red-emerg);
    padding: 0.2rem 0.6rem;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Grilla de Números Críticos 24 Horas */
.emergency-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.emerg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.emerg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--steel-gray);
    transition: var(--transition-fast);
}

.emerg-card.critical::before {
    background: var(--red-emerg);
}

.emerg-card.utility::before {
    background: var(--blue-radio);
}

.emerg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: var(--bg-card-emerg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.emerg-card.critical:hover {
    box-shadow: 0 8px 20px var(--red-emerg-glow);
}

.emerg-card.utility:hover {
    box-shadow: 0 8px 20px var(--blue-radio-glow);
}

.emerg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.emerg-card-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.emerg-card-badge {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transition: transform 0.25s ease;
}

.emerg-card:hover .emerg-card-badge-wrapper {
    transform: translateY(-1px) scale(1.06);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

.emerg-card.critical:hover .emerg-card-badge-wrapper {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 3px 12px rgba(220, 38, 38, 0.35);
}

.emerg-card.utility:hover .emerg-card-badge-wrapper {
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 3px 12px rgba(14, 165, 233, 0.35);
}

.emerg-card-icon {
    font-size: 1.6rem;
    color: var(--steel-light);
    transition: var(--transition-fast);
}

.emerg-card.critical .emerg-card-icon {
    color: var(--red-emerg);
}

.emerg-card.utility .emerg-card-icon {
    color: var(--blue-radio);
}

.emerg-number-display {
    font-family: var(--font-tech);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1;
    color: #FFF;
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.emerg-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.emerg-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    line-height: 1.25;
}

/* Botones de acción dentro de tarjetas */
.emerg-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.btn-emerg {
    flex: 1;
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-weight: 600;
}

.btn-emerg-call {
    background: var(--green-valdivia);
    color: #FFF;
}

.btn-emerg-call:hover {
    background: var(--green-valdivia-glow);
    transform: translateY(-2px);
}

.btn-emerg-copy {
    background: var(--bg-card-emerg);
    color: var(--steel-light);
    border: 1px solid var(--border-subtle);
    position: relative;
}

.btn-emerg-copy:hover {
    background: var(--border-subtle);
    color: #FFF;
}

/* Tooltip para botón copiar */
.clipboard-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green-valdivia);
    color: #FFF;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    pointer-events: none;
}

.clipboard-tooltip.show {
    opacity: 1;
    visibility: visible;
    top: -35px;
}

/* Pestañas Interactivas (Tabs) - Rediseño Compacto y Botones Tácticos */
.emerg-tabs-container {
    margin-bottom: 1rem;
}

.emerg-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.emerg-tab-btn {
    background: rgba(19, 28, 49, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--steel-light);
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.emerg-tab-btn i {
    font-size: 0.95rem;
    color: var(--blue-radio);
    transition: transform 0.2s ease, color 0.2s ease;
}

.emerg-tab-btn:hover {
    color: #FFF;
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(14, 165, 233, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.emerg-tab-btn:hover i {
    transform: scale(1.15);
    color: #38bdf8;
}

.emerg-tab-btn.active {
    color: #FFF;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(2, 132, 199, 0.45));
    border-color: #0ea5e9;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.emerg-tab-btn.active i {
    color: #38bdf8;
    filter: drop-shadow(0 0 4px #0ea5e9);
}

/* Filtro por Comunas - Rediseño Compacto */
.commune-filter-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.35rem 0.9rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(8px);
}

.commune-filter-label {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--steel-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.commune-select {
    background: #0f172a;
    color: #FFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.3rem 1.8rem 0.3rem 0.65rem;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2338bdf8'%3E%3Cpath d='M12 16L6 10H18L12 16Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 16px;
    min-width: 140px;
}

.commune-select:focus, .commune-select:hover {
    border-color: #0ea5e9;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
}

/* Contenido de Pestañas */
.emerg-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.emerg-tab-content.active {
    display: block;
}

/* Directorio de Salud y Red de Urgencia - Rediseño 2 Columnas */
.health-directory-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
    align-items: start;
}

.directory-list-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.35rem;
    align-content: start;
}
.directory-list-wrapper::-webkit-scrollbar {
    width: 5px;
}
.directory-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.4);
    border-radius: 4px;
}

.directory-detail-card {
    height: 100%;
}

.directory-info-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(17, 28, 49, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition-fast);
    cursor: pointer;
}

.directory-info-item:hover,
.directory-info-item.selected {
    background: rgba(14, 165, 233, 0.12);
    border-color: #0ea5e9;
    transform: translateX(3px);
}

.directory-info-item-icon {
    font-size: 1.2rem;
    color: #0ea5e9;
    margin-right: 0.75rem;
}

.directory-info-item-content {
    flex: 1;
    text-align: left;
}

.directory-info-item-title {
    font-weight: 700;
    color: #FFF;
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.directory-info-item-commune {
    font-size: 0.7rem;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.directory-info-item-phone {
    font-family: var(--font-tech);
    color: #38bdf8;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Detalle del Item de Salud Seleccionado */
.detail-view-container {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    background: rgba(17, 28, 49, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.detail-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
}

.detail-badge-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid #0ea5e9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.detail-badge-type.hospital {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-color: #dc2626;
}

.detail-badge-type.primary-care {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: #10b981;
}

.detail-title {
    font-size: 1.15rem;
    color: #FFF;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.detail-location-badge {
    color: #94a3b8;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-info-row i {
    font-size: 1rem;
    color: #0ea5e9;
}

.detail-info-row span {
    color: #e2e8f0;
    font-size: 0.82rem;
}

.detail-info-row .detail-phone-val {
    font-family: var(--font-tech);
    color: #FFF;
    font-weight: 700;
    font-size: 0.95rem;
}

.detail-map-wrapper {
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.detail-btn {
    flex: 1;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Farmacias de Turno - Rediseño Compacto */
.pharmacy-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.pharmacy-main-card {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(17, 34, 64, 0.85) 0%, rgba(10, 25, 47, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.pharmacy-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pharmacy-icon-main {
    font-size: 1.8rem;
    color: #10b981;
}

.pharmacy-header-text h3 {
    font-size: 1.1rem;
    color: #FFF;
    font-weight: 700;
    margin: 0;
}

.pharmacy-header-text p {
    color: #94a3b8;
    font-size: 0.78rem;
    margin: 0;
}

.pharmacy-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pharmacy-step-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pharmacy-step-num {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 1px solid #0ea5e9;
}

.pharmacy-step-text {
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.2;
}

.pharmacy-list-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pharmacy-sidebar-title {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pharmacies-phones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.65rem;
}

.pharmacy-contact-card {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    background: rgba(17, 28, 49, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pharmacy-contact-name {
    font-weight: 700;
    color: #FFF;
    font-size: 0.85rem;
}

.pharmacy-contact-info {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pharmacy-contact-phone {
    font-family: var(--font-tech);
    color: #38bdf8;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.2rem;
}
    margin-top: 0.25rem;
}

/* Servicios Básicos & Otros Contactos */
.services-utilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.utility-service-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.utility-service-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 0.75rem;
}

.utility-service-icon {
    font-size: 1.5rem;
    color: var(--blue-radio);
}

.utility-service-name {
    font-family: var(--font-head);
    font-weight: 700;
    color: #FFF;
    font-size: 1.05rem;
}

.utility-contact-row {
    margin-bottom: 1rem;
}

.utility-provider-name {
    font-size: 0.85rem;
    color: var(--green-valdivia);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.utility-provider-phone {
    font-family: var(--font-tech);
    color: #FFF;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.utility-provider-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Animaciones y Clases Auxiliares */
@keyframes alert-pulse {
    from {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(230, 57, 70, 0.2));
    }
    to {
        transform: scale(1.1);
        filter: drop-shadow(0 0 10px rgba(230, 57, 70, 0.6));
    }
}

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

/* Tooltip de portapapeles */
.clipboard-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--blue-radio);
    color: #FFF;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
    white-space: nowrap;
}

.clipboard-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--blue-radio);
}

.btn-emerg-copy.copied .clipboard-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Punto de Pulso Rojo */
.pulse-dot-red {
    width: 8px;
    height: 8px;
    background: var(--red-emerg);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7);
    animation: dot-pulse-red 1.6s infinite;
}

@keyframes dot-pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(230, 57, 70, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
    }
}

/* Adaptabilidad para Dispositivos Móviles */
@media (max-width: 992px) {
    .health-directory-grid {
        grid-template-columns: 1fr;
    }
    
    .directory-list-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .directory-detail-card {
        order: -1; /* Muestra el detalle primero en tablets/móviles para mejor flujo */
    }
    
    .pharmacy-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .directory-list-wrapper {
        grid-template-columns: 1fr;
    }
    .alert-header-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }
    
    .alert-pulse-badge {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .emerg-tabs {
        flex-direction: column;
        width: 100%;
        border-bottom: none;
    }
    
    .emerg-tab-btn {
        width: 100%;
        justify-content: center;
        border: 1px solid var(--border-subtle);
        border-radius: 6px;
        margin-bottom: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .emerg-tab-btn::after {
        display: none; /* Ocultar línea en móvil y usar fondo en su lugar */
    }
    
    .emerg-tab-btn.active {
        background: var(--blue-radio-glow);
        border-color: var(--blue-radio);
    }
    
    .commune-filter-wrapper {
        flex-direction: column;
        border-radius: 12px;
        padding: 1rem;
        gap: 0.75rem;
        width: 100%;
    }
    
    .commune-select {
        width: 100%;
    }
    
    .emerg-number-display {
        font-size: 2.2rem;
    }
    
    .detail-title {
        font-size: 1.3rem;
    }
    
    .pharmacy-main-card {
        padding: 1.5rem;
    }
}

/* Contenedor del Mapa del Centro de Salud */
.detail-map-wrapper {
    margin-top: 1.25rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    height: 200px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: var(--transition-smooth);
}

.detail-map-wrapper iframe {
    filter: grayscale(1) invert(0.9) contrast(1.2) opacity(0.85);
    border: 0;
    transition: var(--transition-smooth);
}

.detail-map-wrapper:hover {
    border-color: var(--blue-radio);
    box-shadow: 0 4px 20px var(--blue-radio-glow);
}

.detail-map-wrapper:hover iframe {
    filter: grayscale(0) invert(0) contrast(1) opacity(1);
}

/* Enlace de Emergencias en Rojo */
.nav-link.link-emerg-red,
.mobile-link.link-emerg-red {
    color: var(--red-emerg) !important;
}

.nav-link.link-emerg-red:hover,
.mobile-link.link-emerg-red:hover {
    text-shadow: 0 0 10px var(--red-emerg-glow);
    filter: brightness(1.2);
}

.nav-link.link-emerg-red.active,
.mobile-link.link-emerg-red.active {
    border-color: var(--red-emerg) !important;
}

.nav-link.link-emerg-red.active::after {
    background: var(--red-emerg) !important;
}

/* Barra Informativa Desplazable - Enlaces Destacados */
.info-slider-container {
    width: 100%;
    max-width: 1000px;
    margin: 1.5rem auto 0;
    background: rgba(17, 34, 64, 0.4);
    border: 1px solid rgba(0, 162, 255, 0.15);
    border-radius: 30px;
    padding: 0.75rem 1.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Difuminado en los bordes para un look premium */
.info-slider-container::before,
.info-slider-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 2;
    pointer-events: none;
}
.info-slider-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(10, 17, 28, 0.9), transparent);
}
.info-slider-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(10, 17, 28, 0.9), transparent);
}

.info-slider-track {
    display: flex;
    gap: 4rem;
    animation: info-slide-left 45s linear infinite;
    width: max-content;
}

/* Detener el scroll cuando el mouse está encima para que el usuario pueda leer con calma */
.info-slider-container:hover .info-slider-track {
    animation-play-state: paused;
}

.info-slide-item {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: var(--steel-light);
}

.info-slide-item i {
    color: var(--blue-radio);
    font-size: 1.1rem;
}

.info-slide-item strong {
    color: var(--text-primary);
}

@keyframes info-slide-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}