/* ==================================================================== */
/* 🎨 ESTILOS CSS COMPLETOS PARA SIASZIN - MODO SCROLL NATIVO Y BOTONES */
/* ==================================================================== */

:root {
    /* Colores del DIF (Acento: Magenta; Header: Verde) */
    --header-bg-start: #38c172; /* Verde inicial del degradado */
    --header-bg-end: #28a745;   /* Verde final del degradado */
    --primary-text-color: #333;
    --secondary-text-color: #555;
    --accent-color: #e91e63; /* Magenta para acentos y enlaces */
    --button-bg-color: #e91e63;
    --button-hover-bg: #d81b60; 
    --card-bg-color: white;
    --body-bg-color: #f0f2f5;
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    --button-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --primary-color: var(--primary-text-color); /* Definición para otros usos */
    --secondary-color: #f0f2f5; /* Definición para cara posterior de flip-card */
}

/* Base y Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: white;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--secondary-text-color);
}

/* --- HEADER --- */
.main-header {
    background: linear-gradient(to right, var(--header-bg-start), var(--header-bg-end));
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- MAIN CONTENT CARD --- */
.main-content-card {
    background-color: var(--card-bg-color);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    max-width: 1200px;
    width: 95%;
    margin: 40px auto;
    flex-grow: 1;
}

.section-title {
    font-family: 'Roboto Slab', serif;
    color: var(--primary-text-color);
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- CARRUSEL Y LAYOUT (CRÍTICO: SCROLL NATIVO) --- */
.carousel-wrapper {
    position: relative;
    margin: 30px auto;
    padding: 0; 
    max-width: 900px; 
}

.carousel-content-wrapper {
    overflow-x: scroll; 
    overflow-y: hidden;
    width: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    /* Ocultar la barra de desplazamiento */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.carousel-content-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-content {
    display: flex;
    justify-content: flex-start;
    align-items: stretch; 
    gap: 30px;
}

/* --- TARJETA DE MAPA (.map-card) - 3 por vista --- */
.map-card {
    background-color: var(--card-bg-color);
    min-width: calc(33.333% - 20px); 
    flex-shrink: 0; 
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #ffffff; 
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 420px; 
    position: relative; 
    overflow: hidden; 
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    scroll-snap-align: start; 
}

.map-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

/* --- CAJA DE IMAGEN (.map-image-box) --- */
.map-image-box {
    border: 1px solid #ffffff;
    border-radius: 4px; 
    padding: 5px;
    margin-bottom: 15px;
    height: 230px; 
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    position: relative; 
    overflow: hidden;
}

.map-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    transition: opacity 0.3s;
}

.map-card:hover .map-image {
    opacity: 0.3;
}

/* --- BOTÓN DE VISUALIZACIÓN (OVERLAY) --- */
.view-image-button {
    background-color: rgba(233, 30, 99, 0.9);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 25px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--button-shadow);
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 5;
    margin: 0;
}

.map-card:hover .view-image-button {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.view-image-button:hover {
    background-color: var(--accent-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* --- DESCRIPCIÓN (Para map-card) --- */
.map-description {
    text-align: center; 
    padding: 10px 15px; 
    font-size: 1em;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

/* --- ESTILOS ESPECÍFICOS PARA FICHAS (.ficha-card) - 1 por vista --- */
.ficha-card {
    min-width: 100%; 
    height: auto; 
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 0; 
    margin-bottom: 0;
    box-sizing: border-box;
    
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;

    scroll-snap-align: center;
}

.ficha-header {
    height: 280px;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.ficha-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center; 
}
.ficha-body {
    padding: 30px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    justify-content: space-between;
}
.ficha-name {
    font-size: 2em; 
    margin-bottom: 25px;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 15px;
    width: 90%; 
    max-width: 700px; 
    text-align: center; 
}
.ficha-detail {
    display: flex;
    align-items: flex-start;
    margin-bottom: 18px;
    font-size: 1em;
    color: #333;
    width: 100%;
    max-width: 700px;
    text-align: left;
}
.ficha-detail i {
    margin-right: 10px;
    color: var(--accent-color);
    margin-top: 5px; 
}
.servicios-title {
    margin-top: 30px; 
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-text-color);
}
.servicios-title i {
    color: var(--accent-color);
    margin-right: 10px;
}
.servicios-title, .servicios-text {
    width: 100%;
    max-width: 700px; 
    text-align: left;
}
.servicios-text {
    text-align: justify; 
    margin-bottom: 30px; 
}
/* --- Responsive Fichas --- */
@media (max-width: 768px) {
    .ficha-header { height: 200px; }
    .ficha-body { padding: 20px 25px; }
    .ficha-name { font-size: 1.5em; width: 100%; }
    .ficha-detail, .servicios-title, .servicios-text { max-width: 100%; width: 100%; }
}

/* --- Bloque: Botones de Navegación del Carrusel (.nav-button) --- */
/* 🚫 OCULTAR COMPLETAMENTE LAS FLECHAS ORIGINALES */
.nav-button {
    display: none !important; 
}

/* --- ⬇️ NUEVO BLOQUE: BOTONES DE NAVEGACIÓN BAJO EL CARRUSEL ⬇️ --- */

.carousel-navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 25px; /* Espacio para separar del carrusel */
    padding: 10px 0;
}

.carousel-action-button {
    min-width: 180px; 
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilo para Anterior/Siguiente (Color Magenta) */
.carousel-action-button.primary {
    background-color: var(--accent-color); 
    color: white;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.4);
}

.carousel-action-button.primary:hover:not(:disabled) {
    background-color: var(--button-hover-bg); 
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(233, 30, 99, 0.6);
}

.carousel-action-button:disabled {
    background-color: #ccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.carousel-action-button i {
    margin: 0 8px;
    font-size: 1.1em;
}

/* --- Responsive Design (Map Card) --- */
@media (max-width: 1200px) {
    .carousel-wrapper { max-width: 900px; }
    /* Ajuste para Map-Card (2 tarjetas) */
    .map-card:not(.ficha-card) { 
        min-width: calc(50% - 15px); 
        height: 380px; 
    }
}
@media (max-width: 768px) {
    .carousel-wrapper { 
        max-width: 100%; 
        padding: 0;
    }
    /* Ajuste para Map-Card (1 tarjeta) */
    .map-card:not(.ficha-card) { 
        min-width: 100%; 
        height: 350px;
        margin: 0 auto 20px; 
    }
    
    .carousel-navigation-controls {
        flex-direction: column;
        gap: 15px;
    }
    .carousel-action-button {
        min-width: 90%;
    }
}


/* --- Bloque: Estilos para Botones de Acción Global (.main-actions-footer) --- */

.main-actions-footer {
    display: flex;
    justify-content: center;
    gap: 30px; 
    margin-top: 40px; 
    margin-bottom: 20px;
    padding: 10px 0;
    width: 100%;
}

.main-footer-button {
    min-width: 280px; 
    padding: 18px 25px; 
    font-size: 1em;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.main-footer-button i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Color y Hover del Botón Primario (Magenta/Rosa) */
.primary-action-button.main-footer-button {
    background-color: var(--accent-color); 
    color: white;
}

.primary-action-button.main-footer-button:hover {
    background-color: #d81b60; 
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.6);
}

/* Color y Hover del Botón Secundario (Rosa Claro/Secundario) */
.secondary-action-button.main-footer-button {
    background-color: #F8BBD0; 
    color: var(--primary-color);
}

.secondary-action-button.main-footer-button:hover {
    background-color: #F48FB1; 
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(244, 143, 177, 0.6);
}

/* Media Query para Responsividad */
@media (max-width: 650px) {
    .main-actions-footer {
        flex-direction: column;
        gap: 15px;
    }
    .main-footer-button {
        min-width: 90%;
        margin: 0 auto;
    }
}

/* --- Estilo para el Enlace "Volver al Inicio" --- */
.return-link {
    display: inline-block;
    background-color: var(--accent-color); 
    color: white;
    text-decoration: none;
    font-size: 1em;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 6px;
    margin-top: 30px;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.4);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.return-link:hover {
    background-color: #d81b60; 
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(233, 30, 99, 0.6);
}

/* --- Modal y Overlay --- */
.modal-open { overflow: hidden; }
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8); 
    align-items: center;
    justify-content: center;
}
.modal-close-button {
    display: inline-block;
    background-color: #dc3545; 
    color: white;
    border: none;
    text-decoration: none;
    font-size: 1em;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: absolute;
    bottom: 20px; 
    z-index: 1001; 
    left: 50%;
    transform: translateX(-50%);
}
.modal-close-button:hover {
    background-color: #c82333;
    transform: translateX(-50%) translateY(-2px); 
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.6);
}
.modal-content {
    margin: auto; 
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 80vh; 
    margin-bottom: 70px;
}

/* --- Estilos de Bibliografía (Icono y Popup) --- */
.tarjeta { position: relative; }
.tarjeta .bibliografia-icon {
    position: absolute; 
    top: 15px;
    right: 15px;
    color: var(--header-bg-start);
    font-size: 1.5em;
    cursor: help;
    z-index: 50;
}
.fuentes-popup {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 30px; 
    right: 0;
    background-color: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 350px; 
    text-align: left;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
}
.fuentes-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
}
.fuentes-popup li {
    line-height: 1.5;
    margin-bottom: 5px;
    padding-left: 10px;
    position: relative;
}
.fuentes-popup li:first-child {
    font-weight: 700;
    color: var(--header-bg-start);
    margin-bottom: 8px;
    padding-left: 0;
}
.fuentes-popup li:not(:first-child)::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    display: inline-block;
    width: 10px;
    margin-left: -10px;
}
.bibliografia-icon:hover .fuentes-popup {
    visibility: visible;
    opacity: 1; 
}

/* --- Estilos para Infografías (Flip Card) --- */
.infografia-card {
    perspective: 1000px; 
    width: 300px; 
    height: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 20px;
    margin-bottom: 20px;
}
.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.infografia-card:hover .card-flipper {
    transform: rotateY(180deg);
}
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}
.card-front {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}
.infografia-image-box {
    width: 100%;
    height: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.infografia-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.infografia-description {
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    margin-top: 15px;
    text-transform: uppercase;
}
.card-back {
    background-color: var(--secondary-color);
    color: #ffffff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.upload-date {
    font-size: 1em;
    font-weight: 400;
    margin-bottom: 20px;
    color: #333333;
}
.action-button {
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background-color 0.2s;
    width: 80%;
    text-align: center;
}
.view-pdf-button {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}
.view-pdf-button:hover {
    background-color: #43A047;
}
.download-pdf-button {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 8px rgba(233, 30, 99, 0.4);
}
.download-pdf-button:hover {
    background-color: #d81b60;
}

/* --- Estilos para el Bloque de Ubicación en Maps y Leyenda --- */
.map-location-controls {
    display: flex;
    flex-direction: column; 
    align-items: center;
    padding: 30px 0;
    margin: 20px auto;
    border-radius: 10px;
    background-color: #f8f8f8;
    max-width: 90%;
}
.map-button {
    background-color: #f7308c; 
    color: white;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 30px; 
    text-decoration: none;
    font-size: 1.1em;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-button i {
    margin-right: 10px;
    font-size: 1.2em;
}
.map-button:hover {
    background-color: #e51d7b; 
}
.map-legend {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 20px;
    font-size: 0.95em;
}
.legend-item {
    display: flex;
    align-items: center;
}
.legend-item::before {
    content: '';
    width: 15px;
    height: 15px;
    border-radius: 3px;
    margin-right: 8px;
    display: inline-block;
}
.health-units::before {
    background-color: #9370db;
}
.day-houses::before {
    background-color: #2ecc71;
}
.uris-units::before {
    background-color: #f39c12;
}
.modal-content-map {
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 900px;
    background-color: #fefefe;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}
.close-map-button {
    color: #aaa;
    float: right;
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    z-index: 1002;
}
.close-map-button:hover,
.close-map-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
#googleMapIframe {
    display: block;
    width: 100%;
    margin-top: 30px;
}