@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ── VARIABLES ──────────────────────────────────────────────────── */
:root {
    --color-primario:       #0D5963;
    --color-primario-dark:  #094550;
    --color-verde-claro:    #AECD61;
    --color-naranja:        #E26312;
    --color-rojo:           #CA3148;
    --color-amarillo:       #E9B02D;
    --color-gris:           #808080;
    --color-celeste:        #7ECCE1;

    --color-secundario:     #E9B02D;
    --color-acento:         #E26312;
    --color-fondo:          #f5f5f5;
    --color-texto:          #1a1a1a;
    --color-texto-suave:    #6c757d;
    --color-blanco:         #ffffff;
    --color-borde:          #dde3e0;

    --fuente:               'Montserrat', sans-serif;
    --radio-borde:          0.4rem;
    --sombra-card:          0 2px 12px rgba(0,0,0,0.09);
    --transicion:           0.22s ease;
}

/* ── BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--fuente); background: var(--color-fondo); color: var(--color-texto); margin: 0; }
h1,h2,h3,h4,h5,h6 { font-family: var(--fuente); font-weight: 700; }
a { color: var(--color-primario); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── TOPBAR ──────────────────────────────────────────────────────── */
.topbar {
    background-color: #3d3d3d;
    padding: 0.3rem 0;
    font-size: 0.72rem;
}

.topbar-inner {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
}

.topbar-link {
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 1.1rem;
    border-right: 1px solid rgba(255,255,255,0.12);
    transition: background var(--transicion);
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-link:first-child { padding-left: 0; }
.topbar-link:hover { background: rgba(255,255,255,0.05); color: var(--color-blanco); }

.topbar-link i {
    font-size: 1rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.topbar-link-texto { display: flex; flex-direction: column; gap: 0; }
.topbar-link-titulo {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
    color: var(--color-blanco);
}
.topbar-link-sub {
    font-size: 0.62rem;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    line-height: 1.2;
}

.topbar-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-badge {
    border-radius: 20px;
    padding: 0.2rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-blanco) !important;
    transition: opacity var(--transicion);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.topbar-badge:hover { opacity: 0.85; }
.topbar-badge--green  { background-color: #2e7d32; }
.topbar-badge--teal   { background-color: var(--color-primario); }

/* ── NAVBAR ──────────────────────────────────────────────────────── */
.site-header {
    background-color: #0a4952;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-header .navbar { padding: 0.4rem 0; }

.site-header .container {
    max-width: 100% !important;
    padding-left: 164px !important;
    padding-right: 164px !important;
}

.site-header .navbar-brand img {
    height: 54px;
    width: auto;
}

.site-header .nav-link {
    color: rgba(255,255,255,0.88) !important;
    font-size: 0.82rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.6rem !important;
    transition: color var(--transicion);
    white-space: nowrap;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: var(--color-blanco) !important;
    font-weight: 600;
}

.site-header .dropdown-menu {
    border: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    border-radius: var(--radio-borde);
    font-size: 0.82rem;
    min-width: 220px;
    border-top: 3px solid var(--color-amarillo);
    padding: 0.4rem 0;
    background-color: var(--color-blanco);
}

.site-header .dropdown-item {
    font-weight: 400;
    padding: 0.5rem 1.2rem;
    color: var(--color-texto);
    font-size: 0.8rem;
    transition: background var(--transicion), color var(--transicion);
}

.site-header .dropdown-item:hover {
    background-color: #f0f7f6;
    color: var(--color-primario);
}

/* Ocultar caret nativo de Bootstrap en nav — usamos BI chevron propio */
.site-header .nav-link.dropdown-toggle::after { display: none; }

/* Flecha chevron dentro del toggle */
.nav-dropdown-arrow {
    display: inline-block;
    font-size: 0.68rem;
    margin-left: 0.25rem;
    vertical-align: middle;
    transition: transform 0.25s ease;
    line-height: 1;
}

/* Hover dropdowns — desktop only */
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 992px) {
    .site-header .nav-item.dropdown:hover > .dropdown-menu {
        display: block !important;
        margin-top: 0;
        animation: dropdownFade 0.22s ease forwards;
    }
    .site-header .nav-item.dropdown:hover .nav-dropdown-arrow {
        transform: rotate(180deg);
    }
}

.navbar-toggler { border: none !important; padding: 0.3rem; }
.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler-icon { filter: invert(1); }

/* Botones teléfono / WhatsApp */
.btn-telefono {
    background-color: var(--color-rojo);
    color: var(--color-blanco) !important;
    border-radius: 30px;
    padding: 0.6rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background var(--transicion), transform var(--transicion);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.01em;
}
.btn-telefono i { font-size: 1rem; }
.btn-telefono:hover { background-color: #a52038; transform: translateY(-1px); }

.btn-whatsapp {
    background-color: #25d366;
    color: var(--color-blanco) !important;
    border-radius: 30px;
    padding: 0.6rem 1.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background var(--transicion), transform var(--transicion);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.01em;
}
.btn-whatsapp i { font-size: 1rem; }
.btn-whatsapp:hover { background-color: #1eb856; transform: translateY(-1px); }

/* ── HERO SECTION ────────────────────────────────────────────────── */
.hero-section {
    background-color: #f5f5f5;
    padding-bottom: 1.75rem;
}

/* ── HERO BANNER (164px márgenes, imagen completa) ───────────────── */
.hero-banner {
    padding: 0.35rem 164px 0;
}

.hero-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* ── BARRA DE EMERGENCIAS ────────────────────────────────────────── */
.emergencias-bar {
    background: transparent;
    padding: 1.5rem 0 0;
    margin-top: 0;
    box-shadow: none;
}

/* Centrado y más adentro que el banner */
.emergencias-inner {
    padding: 0 220px;
}

.emergencias-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: stretch;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.emergencias-grid::-webkit-scrollbar { display: none; }

.emergencia-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 10px;
    padding: 0 1rem;
    flex: 0 0 auto;
    min-width: 118px;
    min-height: 56px;
    transition: transform var(--transicion), box-shadow var(--transicion);
    cursor: default;
    white-space: nowrap;
}
a.emergencia-item { color: inherit; }
.emergencia-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    cursor: pointer;
}

.emergencia-item img {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

.emergencia-texto {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.emergencia-nombre {
    color: rgba(255,255,255,0.95);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.3;
}

.emergencia-numero {
    color: var(--color-blanco);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

/* ── SECCIONES GENÉRICAS ─────────────────────────────────────────── */
.seccion { padding: 3rem 0; }
.seccion--gris { background-color: #eef2f0; }

.seccion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seccion-titulo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-texto);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 3px solid var(--color-primario);
    padding-bottom: 0.35rem;
    margin-bottom: 0;
    display: inline-block;
}

.seccion-ver-mas {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primario);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.seccion-ver-mas:hover { color: var(--color-naranja); }

/* ── SLIDER DE NOTICIAS ──────────────────────────────────────────── */
.noticias-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.noticias-arrow {
    background: var(--color-blanco);
    color: var(--color-primario);
    border: 2px solid var(--color-primario);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transicion), color var(--transicion);
    padding: 0;
    line-height: 1;
}
.noticias-arrow:hover {
    background: var(--color-primario);
    color: var(--color-blanco);
}

.noticias-track-outer {
    overflow: hidden;
    width: 100%;
}

.noticias-track {
    display: flex;
    gap: 1.25rem;
    transition: transform 0.38s ease;
    width: max-content;
}

/* ── CARDS DE NOTICIAS ───────────────────────────────────────────── */
.card-noticia {
    width: 278px;
    flex-shrink: 0;
    border: none;
    border-radius: var(--radio-borde);
    overflow: hidden;
    background: var(--color-blanco);
    box-shadow: var(--sombra-card);
    transition: transform var(--transicion), box-shadow var(--transicion);
    display: flex;
    flex-direction: column;
}
.card-noticia:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.card-noticia img {
    width: 100%;
    height: 195px;
    object-fit: cover;
}

.card-noticia-placeholder {
    width: 100%;
    height: 195px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}

.card-noticia .card-body {
    padding: 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Tags de categoría */
.noticia-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.55rem;
    border-radius: 2px;
    width: fit-content;
    color: var(--color-blanco);
    background-color: var(--color-verde-claro);
}
.noticia-tag.tag--informativa  { background-color: #2e7d32; }
.noticia-tag.tag--actividad    { background-color: var(--color-naranja); }
.noticia-tag.tag--convocatoria { background-color: var(--color-primario); }
.noticia-tag.tag--urgente      { background-color: var(--color-rojo); }

.card-noticia .card-body h5 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-texto);
    line-height: 1.4;
    text-transform: uppercase;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-noticia .card-body p {
    font-size: 0.76rem;
    color: var(--color-texto-suave);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.noticia-ver-mas {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--color-primario);
    text-transform: uppercase;
    margin-top: auto;
    padding: 0.3rem 0 0;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
}
.noticia-ver-mas:hover { color: var(--color-naranja); }

/* ── BANNERS SERVICIOS ───────────────────────────────────────────── */
.seccion-servicios { padding: 0.75rem 0 2.5rem; }

/* Servicios: contenedor full-width, ambos items centrados */
.seccion-servicios .container {
    max-width: 100% !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
}

/* Carousel + video: centrados, columnas con ancho fijo explícito */
.servicios-wrapper {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
}

/* Columna carousel — ancho fijo 740px */
.servicios-carousel-col {
    width: 740px;
    flex-shrink: 0;
}

/* Columna video — mismo ancho fijo 740px */
.servicios-video-col {
    width: 740px;
    flex-shrink: 0;
}

/* ── CARRUSEL PERSONALIZADO (reemplaza Bootstrap carousel) ───────── */
.mi-carrusel {
    position: relative;
    width: 100%;
    height: 320px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #0d0d0d;
    box-shadow: 0 2px 14px rgba(0,0,0,0.14);
    user-select: none;
}

.mi-carrusel-track {
    display: flex;
    height: 100%;
    transition: transform 0.52s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.mi-carrusel-item {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    overflow: hidden;
}
.mi-carrusel-item a {
    display: block;
    height: 100%;
}
.mi-carrusel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Botones prev / next */
.mi-carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.48);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.mi-carrusel-btn:hover {
    background: rgba(0,0,0,0.75);
    transform: translateY(-50%) scale(1.08);
}
.mi-carrusel-prev { left: 10px; }
.mi-carrusel-next { right: 10px; }

/* Dots indicadores */
.mi-carrusel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 10;
}
.mi-carrusel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.22s, transform 0.22s;
}
.mi-carrusel-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* Imagen destacada derecha (fallback) */
.servicios-featured {
    display: block;
    border-radius: var(--radio-borde);
    overflow: hidden;
    height: 278px;
    box-shadow: var(--sombra-card);
}
.servicios-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.servicios-featured:hover img { transform: scale(1.03); }

/* Video derecha — 100% de su columna (740px), 320px de alto */
.servicios-video-wrapper {
    width: 100%;
    height: 320px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #0d0d0d;
    box-shadow: var(--sombra-card);
    position: relative;
}

/* Capa borrosa de fondo — thumbnail YT o video local escalado */
.video-blur-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(22px) brightness(0.52) saturate(1.35);
    transform: scale(1.18);
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* Wrapper clickeable para play/pause */
.servicios-video-wrapper { cursor: pointer; }

/* Video principal en primer plano */
.video-main {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    border: 0;
    background: transparent;
    pointer-events: none;   /* el wrapper captura los clicks */
}
video.video-main::-webkit-media-controls { display: none !important; }
video.video-main::-webkit-media-controls-enclosure { display: none !important; }

/* Ícono de play/pause superpuesto (inyectado por JS) */
.vid-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.vid-play-icon i {
    font-size: 3.8rem;
    color: rgba(255,255,255,0.88);
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.55));
}

/* ── Botón "Activar Sonido" (inyectado por JS) ── */
.vid-sound-btn {
    position: absolute;
    bottom: 0.85rem;
    right: 0.85rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.38rem 0.9rem;
    background: rgba(0,0,0,0.68);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.38);
    border-radius: 2rem;
    font-family: var(--fuente);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.35s ease, background 0.2s;
    animation: pulsoSonido 2.2s ease-in-out infinite;
}
.vid-sound-btn:hover {
    background: rgba(13,89,99,0.92);
    border-color: var(--color-primario);
    animation: none;
}
.vid-sound-btn i { font-size: 0.95rem; }
@keyframes pulsoSonido {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.28); }
    50%      { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
}

/* Iframe YT en primer plano */
.servicios-video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 1;
}

/* ── SECCIÓN SERVICIOS ICONOS (5 imágenes 1080×1080) ────────────── */
.seccion-servicios-iconos {
    padding: 2rem 0;
    background: var(--color-fondo);
}

.seccion-servicios-iconos .container {
    max-width: 100% !important;
    padding-left: 164px !important;
    padding-right: 164px !important;
}

.servicios-iconos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.servicios-iconos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.7rem;
}

.servicios-icono-item {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--radio-borde);
    overflow: hidden;
    box-shadow: var(--sombra-card);
    transition: transform var(--transicion), box-shadow var(--transicion);
}
.servicios-icono-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.servicios-icono-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.servicios-icono-item:hover img { transform: scale(1.03); }

.servicios-icono-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-fondo);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-texto-suave);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ── LINKS DE INTERÉS ────────────────────────────────────────────── */
.seccion-links-interes {
    background: var(--color-fondo);
    padding: 3rem 0;
    border-top: 1px solid var(--color-borde);
}
.seccion-links-interes .container {
    max-width: 100% !important;
    padding-left: 60px !important;
    padding-right: 60px !important;
}

.seccion-titulo--centrado {
    display: block;
    text-align: center;
    border-bottom: none;
    margin-bottom: 2rem;
    padding-bottom: 0;
    position: relative;
}
.seccion-titulo--centrado::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-primario);
    margin: 0.4rem auto 0;
    border-radius: 2px;
}

.links-interes-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem 0;
    justify-content: space-between;   /* logos de orilla a orilla */
}

.link-interes-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    padding: 0.5rem 1.5rem;
    opacity: 0.72;
    transition: opacity var(--transicion), transform var(--transicion);
}
.link-interes-item:hover { opacity: 1; transform: translateY(-4px); }

.link-interes-item img {
    height: 58px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

/* ── DOCUMENTOS ──────────────────────────────────────────────────── */
.doc-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-blanco);
    border: 1px solid var(--color-borde);
    border-left: 4px solid var(--color-primario);
    border-radius: var(--radio-borde);
    padding: 0.85rem 1.1rem;
    transition: background var(--transicion), box-shadow var(--transicion);
}
.doc-item:hover { background: #f0f7f5; box-shadow: 0 2px 10px rgba(0,0,0,0.07); }

.doc-icono { font-size: 1.75rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-info strong { display: block; font-size: 0.87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info small { color: var(--color-texto-suave); font-size: 0.73rem; }

.btn-descarga {
    background-color: var(--color-primario);
    color: var(--color-blanco) !important;
    border-radius: var(--radio-borde);
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background var(--transicion);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-descarga:hover { background-color: var(--color-primario-dark); }

/* ── VIDEOS ──────────────────────────────────────────────────────── */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radio-borde);
    background: #000;
    box-shadow: var(--sombra-card);
}
.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
    object-fit: contain;
}

/* .video-blur-bg y .video-main están definidos junto a .servicios-video-wrapper */

.video-titulo {
    margin-top: 0.6rem;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--color-texto);
}

/* Badge de categoría en la grilla de videos */
.video-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    margin-bottom: 0.3rem;
}
.video-badge--informativa { background: #e8f4fd; color: #0a6ebd; }
.video-badge--actividad   { background: #edf7ed; color: #2e7d32; }
.video-badge--evento      { background: #fef6e4; color: #b36200; }

/* ── POPUP DE INICIO ────────────────────────────────────────────── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;          /* margen del borde en móvil */
    animation: popupFadeIn 0.28s ease forwards;
    backdrop-filter: blur(3px);
    overflow-y: auto;       /* si la pantalla es muy baja */
}
.popup-overlay.popup-saliendo {
    animation: popupFadeOut 0.26s ease forwards;
}
@keyframes popupFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes popupFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.popup-overlay { cursor: pointer; }  /* click fuera = cierra */

.popup-caja {
    position: relative;
    width: 100%;
    max-width: 520px;           /* reducido de 820px */
    max-height: 90dvh;          /* no excede la pantalla en vertical */
    overflow-y: auto;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    animation: popupSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
    cursor: default;
}
.popup-overlay.popup-saliendo .popup-caja {
    animation: popupSlideDown 0.26s ease forwards;
}
@keyframes popupSlideUp {
    from { transform: translateY(30px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
@keyframes popupSlideDown {
    from { transform: translateY(0)    scale(1);    opacity: 1; }
    to   { transform: translateY(20px) scale(0.96); opacity: 0; }
}

.popup-caja img {
    display: block;
    width: 100%;
    height: auto;
}

.popup-cerrar {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.62);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    z-index: 1;
    transition: background 0.18s, transform 0.18s;
}
.popup-cerrar:hover { background: rgba(0,0,0,0.9); transform: scale(1.1); }

/* ── MODAL POPUP DE SERVICIO ─────────────────────────────────────── */
#modal-svc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
    z-index: 9100;
    padding: 1.5rem;
    backdrop-filter: blur(3px);
}
#modal-svc-caja {
    background: #fff;
    border-radius: 18px;
    padding: 2rem 2rem 1.75rem;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    animation: fadeInUp .22s ease;
}
#modal-svc-cerrar {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #bbb;
    transition: color .15s;
    padding: 0;
}
#modal-svc-cerrar:hover { color: #333; }
#modal-svc-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0D5963;
    margin: 0 2rem 1.5rem 0;
    line-height: 1.3;
}
#modal-svc-botones {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
#modal-svc-botones a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .9rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s;
    gap: .5rem;
}
#modal-svc-btn1 {
    background: #0D5963;
    color: #fff;
}
#modal-svc-btn1::before { content: '→'; }
#modal-svc-btn1:hover {
    background: #093f48;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13,89,99,.35);
}
#modal-svc-btn2 {
    background: #E9B02D;
    color: #fff;
}
#modal-svc-btn2::before { content: '📄'; font-style: normal; }
#modal-svc-btn2:hover {
    background: #d49a1e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233,176,45,.35);
}
/* Botón tipo icono en la grilla de servicios (sin estilos propios de <a>) */
.servicios-icono-popup {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
    width: 100%;
}

/* ── MODAL DETALLE DE NOTICIA ────────────────────────────────────── */
.modal-noticia-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.76);
    z-index: 9998;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    cursor: pointer;          /* click fuera = cierra */
}
.modal-noticia-overlay.abierto {
    display: flex;
    animation: popupFadeIn 0.25s ease forwards;
}
.modal-noticia-caja {
    position: relative;
    width: 92%;
    max-width: 740px;
    max-height: 88vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 28px 72px rgba(0,0,0,0.42);
    cursor: default;
    animation: popupSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.modal-noticia-inner {
    overflow-y: auto;
    flex: 1;
}
.modal-noticia-inner img {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    display: block;
}
.modal-noticia-body {
    padding: 1.6rem 2rem 2.2rem;
}
.modal-noticia-body .noticia-tag {
    font-size: 0.72rem;
}
.modal-noticia-fecha {
    font-size: 0.82rem;
    color: var(--color-texto-suave);
    margin: 0.45rem 0 0.1rem;
}
.modal-noticia-body h3 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-texto);
    margin: 0.4rem 0 1.1rem;
    line-height: 1.3;
}
.modal-noticia-body .modal-noticia-texto {
    font-size: 0.97rem;
    color: #444;
    line-height: 1.78;
    white-space: pre-line;
}
.modal-noticia-cerrar {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.58);
    color: #fff;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.18s, transform 0.18s;
}
.modal-noticia-cerrar:hover { background: rgba(0,0,0,0.88); transform: scale(1.1); }

/* ── FRANJA DE COLORES (encabezado del footer) ───────────────────── */
.footer-franja {
    display: flex;
    width: 100%;
    height: 8px;
    flex-shrink: 0;
}
.footer-franja span {
    flex: 1;
    display: block;
}

/* ── FOOTER ──────────────────────────────────────────────────────── */
.site-footer {
    background-color: var(--color-primario-dark);
    color: rgba(255,255,255,0.85);
    padding: 6rem 0 0;
    font-size: 0.9rem;
}

/* Contenedor interno full-width — más padding izquierdo para dar aire al alcalde */
.footer-inner {
    max-width: 100%;
    padding: 0 60px 0 100px;
    margin: 0 auto;
}

.site-footer h6 {
    color: var(--color-amarillo);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

/* ── Listas footer ── */
.footer-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-lista li { line-height: 1.3; margin-bottom: 0.7rem; }
.footer-lista a {
    color: rgba(255,255,255,0.82);
    font-size: 0.88rem;
    font-weight: 600;
    transition: color var(--transicion);
}
.footer-lista a:hover { color: var(--color-amarillo); }

/* Enlace "próximamente" — grisado */
.footer-link-proximamente {
    color: rgba(255,255,255,0.38) !important;
    pointer-events: none;
    cursor: default;
}

/* Badge Próximamente */
.badge-proximamente {
    display: inline-block;
    background: var(--color-naranja);
    color: var(--color-blanco);
    font-size: 0.54rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.35rem;
    letter-spacing: 0.05em;
}

/* ── Alcalde ── */
.footer-alcalde {
    display: flex;
    flex-direction: column;
    align-items: center;   /* foto + nombre + redes centrados entre sí */
    text-align: center;
    gap: 0.7rem;
}

.footer-alcalde-foto {
    width: 172px;
    height: 172px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid var(--color-amarillo);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.footer-alcalde-info strong {
    display: block;
    color: var(--color-blanco);
    font-size: 1.18rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.footer-alcalde-info span {
    color: var(--color-amarillo);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Redes sociales ── */
.footer-redes {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.footer-redes a {
    color: rgba(255,255,255,0.7);
    font-size: 1.15rem;
    transition: color var(--transicion), transform var(--transicion), border-color var(--transicion);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
}
.footer-redes a:hover {
    color: var(--color-amarillo);
    border-color: var(--color-amarillo);
    transform: translateY(-2px);
}

/* ── Contacto ── */
.footer-contacto { font-style: normal; }
.footer-contacto-item {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.78);
    font-size: 0.82rem;
    line-height: 1.5;
}
.footer-contacto-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
    margin-top: 1px;
}
.footer-contacto-icon i {
    color: var(--color-amarillo);
    font-size: 0.85rem;
}

/* ── Footer bottom ── */
.footer-bottom {
    background-color: rgba(0,0,0,0.3);
    margin-top: 2.5rem;
    padding: 1rem 0;
    font-size: 0.74rem;
    color: rgba(255,255,255,0.45);
}
.footer-bottom-inner {
    max-width: 100%;
    padding: 0 60px;
    margin: 0 auto;
}
.footer-bottom a { color: rgba(255,255,255,0.45); transition: color var(--transicion); }
.footer-bottom a:hover { color: var(--color-amarillo); }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1399px) {
    .site-header .container { padding-left: 80px !important; padding-right: 80px !important; }
    .hero-banner { padding: 0.35rem 80px 0; }
    .emergencias-inner { padding: 0 140px; }
    .seccion-servicios-iconos .container { padding-left: 80px !important; padding-right: 80px !important; }
    .footer-inner { padding: 0 40px 0 70px; }
    .footer-bottom-inner { padding: 0 40px; }
}

@media (max-width: 1199px) {
    .site-header .nav-link { font-size: 0.75rem; padding: 0.5rem 0.45rem !important; }
    .site-header .container { padding-left: 40px !important; padding-right: 40px !important; }
    .hero-banner { padding: 0.35rem 40px 0; }
    .emergencias-inner { padding: 0 80px; }
    .seccion-servicios-iconos .container { padding-left: 40px !important; padding-right: 40px !important; }
    .servicios-iconos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
    /* ── Collapse mobile: panel blanco con borde primario ── */
    .site-header .navbar-collapse {
        background: #fff;
        border-top: 3px solid var(--color-primario);
        border-radius: 0 0 .75rem .75rem;
        box-shadow: 0 8px 28px rgba(0,0,0,.18);
        padding: .75rem 1rem 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1050;
    }
    .site-header .navbar-nav { padding: 0; gap: 0; background: transparent; }
    .site-header .nav-link {
        color: #0D5963 !important;
        padding: .6rem .5rem !important;
        border-bottom: 1px solid #f0f0f0;
        font-size: .92rem !important;
    }
    .site-header .nav-link:hover { color: var(--color-naranja) !important; background: #f8fcfc; border-radius: .35rem; }
    .site-header .nav-dropdown-arrow { color: #0D5963 !important; }
    .site-header .dropdown-menu { position: static !important; box-shadow: none; border: none; background: #f4f9f9; border-radius: .5rem; padding: .25rem 0 .25rem .75rem; }
    .site-header .dropdown-item { color: #0D5963; font-size: .88rem; padding: .45rem 1rem; }
    .site-header .container { padding-left: 16px !important; padding-right: 16px !important; }
    .site-header { position: relative; }
    .navbar-contact { padding: .6rem 0 0; border-top: 1px solid #e9f0f0; margin-top: .3rem; display: flex; flex-direction: column; gap: .5rem; }
    .btn-telefono, .btn-whatsapp { display: flex; justify-content: center; width: 100%; border-radius: .5rem; padding: .6rem 1rem; font-size: .88rem; }
    .topbar-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* Carousel y video: apilar verticalmente en pantallas pequeñas */
    .servicios-wrapper { flex-direction: column; align-items: center; }
    .servicios-carousel-col,
    .servicios-video-col { width: 100%; max-width: 740px; }
    .mi-carrusel { height: 240px; }
    .servicios-video-wrapper { height: 240px; }
    .servicios-featured { height: 220px; }
    .hero-banner { padding: 0.5rem 16px 0; }
    .emergencias-inner { padding: 0 16px; }
    .seccion-servicios-iconos .container { padding-left: 16px !important; padding-right: 16px !important; }
    .servicios-iconos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hero-banner { padding: 0.5rem 10px 0; }
    .emergencias-inner { padding: 0 10px; }
    .hero-section { padding-bottom: 1.25rem; }
    .emergencia-item { min-width: 100px; min-height: 50px; padding: 0 0.65rem; gap: 0.5rem; }
    .emergencia-numero { font-size: 0.88rem; }
    .emergencia-nombre { font-size: 0.65rem; }
    .card-noticia { width: 248px; }
    .seccion { padding: 2rem 0; }
    .seccion-titulo { font-size: 1.1rem; }
    .links-interes-grid { gap: 1rem 1.5rem; }
    .link-interes-item img { height: 34px; }
    .footer-alcalde-foto { width: 110px; height: 110px; }
    .footer-inner { padding: 0 20px; }
    .footer-bottom-inner { padding: 0 20px; }
    .servicios-iconos-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

@media (max-width: 480px) {
    .topbar-link-sub { display: none; }
    .topbar-link { padding: 0.3rem 0.7rem; }
    .btn-telefono, .btn-whatsapp { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
    .hero-banner { padding: 0.4rem 8px 0; }
    .emergencias-inner { padding: 0 8px; }
    .servicios-iconos-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner, .footer-bottom-inner { padding: 0 16px; }
    .footer-alcalde-foto { width: 120px; height: 120px; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL — mejoras generales para móvil y tablet
══════════════════════════════════════════════════════════════════ */

/* ── Topbar: scroll horizontal en móvil ── */
@media (max-width: 768px) {
    .topbar-inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        scrollbar-width: none;
    }
    .topbar-inner::-webkit-scrollbar { display: none; }
    .topbar-badges { flex-shrink: 0; }
}

/* ── Navbar: logotipo más pequeño ── */
@media (max-width: 576px) {
    .navbar-brand img { height: 42px; }
    .navbar-contact { flex-direction: column; gap: .4rem; padding: .6rem 0 .8rem; }
    .btn-telefono, .btn-whatsapp { width: 100%; text-align: center; justify-content: center; }
}

/* ── Hero: altura adecuada en móvil ── */
@media (max-width: 576px) {
    .mi-carrusel { height: 190px; }
    .hero-slide-img { object-position: center; }
    .hero-slide-caption { font-size: .82rem; padding: .35rem .75rem; }
}

/* ── Emergencias: scroll horizontal en móvil ── */
@media (max-width: 576px) {
    .emergencias-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
        padding-bottom: .4rem;
    }
    .emergencias-inner::-webkit-scrollbar { display: none; }
    .emergencia-item { flex-shrink: 0; min-width: 90px; }
}

/* ── Sección: reducir padding general ── */
@media (max-width: 576px) {
    .seccion { padding: 1.5rem 0; }
    .seccion-titulo { font-size: 1.05rem; }
    .seccion-header { margin-bottom: 1rem !important; }
}

/* ── Servicios iconos: asegurar 2 columnas en muy pequeño ── */
@media (max-width: 360px) {
    .servicios-iconos-grid { grid-template-columns: repeat(2, 1fr); gap: .4rem; }
    .servicios-icono-item { padding: .65rem .3rem; }
}

/* ── Cards de noticias: ancho completo en móvil ── */
@media (max-width: 576px) {
    .card-noticia { width: 100%; min-width: unset; }
    .noticias-lista { display: flex; flex-direction: column; gap: 1rem; }
}

/* ── Links de interés: centrar en móvil ── */
@media (max-width: 576px) {
    .links-interes-grid { justify-content: center; gap: .75rem 1rem; }
    .link-interes-item img { height: 32px; }
}

/* ── Footer: apilar columnas en tablet/móvil ── */
@media (max-width: 991px) {
    .footer-inner > .row { flex-direction: column; }
    .footer-inner > .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    .footer-alcalde { flex-direction: row; text-align: left; align-items: center; gap: 1.2rem; }
    .footer-alcalde-foto { width: 90px; height: 90px; flex-shrink: 0; }
}
@media (max-width: 576px) {
    .footer-alcalde { flex-direction: column; text-align: center; }
    .footer-alcalde-foto { width: 110px; height: 110px; }
    .footer-inner { padding: 0 12px; }
    .site-footer { padding: 2rem 0 1rem; }
}

/* ── Alcalde: logros pills ── */
@media (max-width: 576px) {
    .logro-btn-pill { font-size: .78rem; padding: .3rem .7rem; }
}

/* ── Departamentos: grid ── */
@media (max-width: 576px) {
    .deptos-grid { grid-template-columns: 1fr !important; }
}

/* ── Utilidades globales ── */
@media (max-width: 576px) {
    /* Textos */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    /* Breadcrumb */
    .breadcrumb { font-size: .8rem; }
    /* Botones más pequeños en móvil */
    .btn { font-size: .88rem; }
    /* Tabla responsiva */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE COMPLETO — versión limpia y segura
══════════════════════════════════════════════════════════════════ */

/* Prevenir scroll horizontal global */
body { overflow-x: hidden; }
img, video, canvas { max-width: 100%; height: auto; }

/* ──────────────────────────────────────────────────────────────────
   2. DIDECO — sidebar toggle en móvil
   (Estilos de detalle están inline en dideco.php; aquí solo lo base)
────────────────────────────────────────────────────────────────── */
/* El panel de contenido mínimo */
#dideco-content { min-height: 200px; }

/* ──────────────────────────────────────────────────────────────────
   3. ELECCIONES — tabs y grupos en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .elec-tab-btn { padding: .55rem .9rem; font-size: .82rem; min-height: 44px; }
    .elec-mes-titulo { font-size: .8rem; padding: .65rem 1rem; }
    .elec-item { flex-wrap: wrap; gap: .4rem; padding: .75rem 1rem; }
    .elec-item-titulo { font-size: .82rem; min-width: 0; flex: 1 1 100%; }
    .elec-item-hora   { font-size: .72rem; }
    .elec-item-dl     { padding: .4rem .7rem; font-size: .74rem; min-height: 44px; }
}

/* ──────────────────────────────────────────────────────────────────
   5. TRÁMITES — sección y grid en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .tram-seccion-header { padding: .85rem 1rem; gap: .6rem; }
    .tram-seccion-titulo { font-size: .95rem; }
}
@media (max-width: 576px) {
    .tram-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .tram-item { padding: 1.1rem .7rem; }
    .tram-item-icon { width: 44px; height: 44px; font-size: 1.1rem; }
    .tram-item-label { font-size: .75rem; }
}
@media (max-width: 380px) {
    .tram-grid { grid-template-columns: 1fr !important; }
}

/* ──────────────────────────────────────────────────────────────────
   6. OBRAS — grid en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .obras-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem; }
}
@media (max-width: 480px) {
    .obras-grid { grid-template-columns: 1fr !important; }
    .obra-card-btn { padding: .55rem .8rem; font-size: .8rem; }
}

/* ──────────────────────────────────────────────────────────────────
   7. OFERTAS LABORALES — sección header en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .oferta-seccion-titulo { flex-wrap: wrap; gap: .5rem; }
    .oferta-seccion-count  { margin-left: 0; }
    .omil-infobox { flex-direction: column; gap: .6rem; padding: 1rem; }
}

/* ──────────────────────────────────────────────────────────────────
   8. PLAN REGULADOR — nav rápida y grids
────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .prc-nav { gap: .5rem; }
    .prc-nav-item { font-size: .78rem; padding: .45rem .8rem; }
    .prc-bloque-header { padding: .85rem 1.1rem; flex-wrap: wrap; gap: .5rem; }
    .prc-bloque-header-count { margin-left: 0; }
}

/* ──────────────────────────────────────────────────────────────────
   9. SERVICIOS (servicios.php) — 5→3→2→1 cols
────────────────────────────────────────────────────────────────── */
@media (max-width: 1199px) { .servicios-todos-grid { grid-template-columns: repeat(4,1fr) !important; } }
@media (max-width: 991px)  { .servicios-todos-grid { grid-template-columns: repeat(3,1fr) !important; } }
@media (max-width: 767px)  { .servicios-todos-grid { grid-template-columns: repeat(2,1fr) !important; } }
@media (max-width: 480px)  { .servicios-todos-grid { grid-template-columns: repeat(2,1fr) !important; } }
@media (max-width: 360px)  { .servicios-todos-grid { grid-template-columns: 1fr !important; } }

/* ──────────────────────────────────────────────────────────────────
   10. TOPBAR MÓVIL — compacto con offcanvas sidebar
────────────────────────────────────────────────────────────────── */

/* Botón del topbar (visible solo en móvil) */
.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,.9);
    font-size: 1.35rem;
    padding: .25rem .4rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    margin-left: auto;
}

/* Texto de marca en topbar móvil */
.topbar-mobile-label {
    display: none;
    color: rgba(255,255,255,.8);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    align-items: center;
    gap: .4rem;
}

@media (max-width: 767px) {
    /* Ocultar links y badges del topbar */
    .topbar-link  { display: none !important; }
    .topbar-badges { display: none !important; }
    /* Mostrar elementos móvil */
    .topbar-menu-btn   { display: flex; align-items: center; }
    .topbar-mobile-label { display: flex; }
    .topbar-inner { justify-content: space-between; flex-wrap: nowrap; }
}

/* Offcanvas sidebar — estilo municipalidad */
#topbarOffcanvas .offcanvas-header {
    background: #0D5963;
    padding: 1rem 1.2rem;
}
#topbarOffcanvas .offcanvas-title {
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
#topbarOffcanvas .offcanvas-body { padding: 0; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.2rem;
    color: #1e293b;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    font-size: .88rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.1rem; color: #0D5963; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-link:hover { background: #f0f7f6; color: #0D5963; }
.sidebar-link-sub  { font-size: .72rem; color: #94a3b8; display: block; margin-top: .1rem; }

.sidebar-badge-section {
    padding: .85rem 1.2rem;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
}
.sidebar-badge-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1rem;
    background: #0D5963;
    color: #fff;
    border-radius: .5rem;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.sidebar-badge-link:hover { background: #094550; color: #fff; }

/* ──────────────────────────────────────────────────────────────────
   11. FOOTER — mejoras adicionales pequeñas pantallas
────────────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
    .footer-bottom-inner { flex-direction: column; gap: .5rem; text-align: center; }
    .footer-redes { justify-content: center; }
}

/* ──────────────────────────────────────────────────────────────────
   12. FORMULARIOS ADMIN — responsivos en pantalla pequeña (tablet)
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .af-card-body { padding: 1.1rem; }
    .af-card-header { padding: .75rem 1.1rem; }
    .tbl-accion { gap: .25rem; }
    /* Tablas admin: scroll horizontal */
    .af-card .table { font-size: .8rem; }
    .af-card .table td, .af-card .table th { padding: .6rem .6rem; }
}

/* ──────────────────────────────────────────────────────────────────
   13. GALERÍA / MODALES — padding en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .modal-noticia-body { padding: 1.1rem 1.1rem 1.5rem; }
    .modal-noticia-body h3 { font-size: 1.15rem; }
    #modal-svc-caja { padding: 1.4rem 1.2rem 1.2rem; }
    #modal-svc-titulo { font-size: 1rem; }
    #modal-svc-botones a { padding: .75rem 1rem; font-size: .88rem; }
}

/* ──────────────────────────────────────────────────────────────────
   14. CUENTA PÚBLICA / GUÍA SERVICIOS — viewer en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* PDF viewer canvas ocupa todo el ancho */
    #pdf-canvas, .cuenta-publica-canvas { max-width: 100%; }
    /* Barra de navegación del viewer */
    .cp-nav-bar, .gs-nav-bar { flex-wrap: wrap; gap: .4rem; padding: .5rem; }
    .cp-nav-btn, .gs-nav-btn { min-height: 44px; min-width: 44px; }
}

/* ──────────────────────────────────────────────────────────────────
   15. NOTICIAS — grid completo en móvil
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Slider desaparece — mostrar columna de cards */
    .noticias-track-outer { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .noticias-track { padding-bottom: .5rem; }
}

/* ──────────────────────────────────────────────────────────────────
   16. ALCALDE / CONCEJO / PÁGINAS INTERNAS — col stacking
────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Foto de alcalde en columna centrada */
    .alcalde-foto-col { text-align: center; margin-bottom: 1.5rem; }
    /* Concejo: cards más compactas */
    .concejal-card { padding: 1rem; }
}

/* ──────────────────────────────────────────────────────────────────
   17. POPUP — adaptable a cualquier pantalla
────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .popup-overlay { padding: .5rem; align-items: flex-start; padding-top: 3rem; }
    .popup-caja { border-radius: 10px; max-height: 88dvh; }
}
@media (max-width: 400px) {
    .popup-overlay { padding-top: 2.5rem; }
}
