/* =========================================
   1. VARIABLES Y RESET
========================================= */
:root {
    --color-rojo: #fd2827;      
    --color-plomo-oscuro: #333333;         
    --color-plomo-claro: #f4f4f4;
    --color-blanco: #ffffff;
    --color-amarillo: #f1c40f;
    --fuente-montserrat: 'Montserrat', sans-serif; 
    --fuente-roboto: 'Roboto', sans-serif;      
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: var(--fuente-roboto);
    color: var(--color-plomo-oscuro);
    background-color: var(--color-blanco);
    padding-top: 85px; 
    overflow-x: hidden; 
}

body.no-scroll { overflow: hidden; }

/* Bloquea el rebote en la página completa */
html, body {
    overscroll-behavior-y: none;
}

/* Bloquea el rebote al hacer scroll dentro de la ficha del mapa */
.modal-window {
    overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6 { 
    font-family: var(--fuente-montserrat); 
    font-weight: 700; 
    margin-top: 0;
}

/* =========================================
   2. LAYOUT Y CONTENEDORES GLOBALES
========================================= */
.container {
    max-width: 1200px; 
    width: 100%; 
    margin: 0 auto; 
    padding: 0 20px;
}

.content { min-height: calc(100vh - 85px - 150px); }
.seccion { padding: 60px 0; width: 100%; }
.section-block { padding: 80px 0; }

.split-container {
    display: flex;
    align-items: center; 
    gap: 50px;
    flex-direction: row; 
}
.split-container.reverse-layout { flex-direction: row-reverse; }
.text-side { flex: 1; }
.map-side { flex: 1; width: 100%; }

/* =========================================
   3. GRILLAS UNIFICADAS
========================================= */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 30px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
/* Layout para PC (3 columnas) */
.cifras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Espaciado entre las cifras */
    text-align: center;
    width: 100%;
}

/* Layout para Celulares (1 columna) */
@media (max-width: 768px) {
    .cifras-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   4. UTILIDADES (Colores, Textos, Botones)
========================================= */
.bg-blanco { background-color: var(--color-blanco); }
.bg-gris { background-color: var(--color-plomo-claro); }

.text-justify { text-align: justify; line-height: 1.6; color: #555; }
.text-justify p { margin-bottom: 15px; }

.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 {
    font-size: 1.5rem; 
    color: var(--color-plomo-oscuro);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}
.level-3-title {
    font-size: 1.2rem; 
    color: var(--color-plomo-oscuro);
    margin-bottom: 20px;
}
.title-with-border {
    border-left: 5px solid var(--color-rojo);
    padding-left: 15px;
}

.btn { 
    padding: 12px 25px; 
    border-radius: 4px; 
    font-weight: 700; 
    text-transform: uppercase; 
    cursor: pointer; 
    display: inline-block;
}
.btn-rojo { background: var(--color-rojo); color: white; border: 1px solid var(--color-rojo); }
.btn-blanco { background: white; color: #333; border: 1px solid white; }

/* =========================================
   5. COMPONENTES GLOBALES Y DE OTRAS PÁGINAS
========================================= */
/* Cifras Banner (Usado en el Home) */
.cifras-banner { background-color: #f4f5f7; padding: 50px 0; width: 100%; }
.cifra-box { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px; text-align: center; }
.cifra-box .numero { font-size: 3.5rem; font-weight: 800; color: var(--color-rojo); line-height: 1; margin-bottom: 15px; font-family: var(--fuente-montserrat); }
.cifra-box .etiqueta { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: #222; letter-spacing: 1px; max-width: 200px; line-height: 1.5; }

/* Logos */
.logos-container { align-items: center; justify-items: center; }
.logo-wrapper { display: flex; gap: 15px; align-items: center; } /* Corregido de .-wrapplogoer */
.logo-img { height: 50px; width: auto; }

/* Team & Steps (Otras páginas) */
.team-card { background: white; padding: 30px 20px; border-radius: 8px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.bg-blanco .team-card { border: 1px solid #eee; box-shadow: none; }
.team-photo { width: 120px; height: 120px; background-color: #ddd; border-radius: 50%; margin: 0 auto 20px auto; background-size: cover; background-position: center; border: 3px solid var(--color-rojo); }
.team-card h4 { margin-bottom: 5px; font-size: 1.2rem; color: #222; }
.role { display: block; font-size: 0.9rem; color: var(--color-rojo); font-weight: 600; margin-bottom: 15px; text-transform: uppercase; font-family: var(--fuente-montserrat); }
.team-card p { font-size: 0.9rem; color: #666; line-height: 1.5; }
.team-card.simple { padding: 20px; }

.step-card { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); position: relative; border-top: 4px solid var(--color-rojo); }
.step-number { font-family: var(--fuente-montserrat); font-size: 3rem; font-weight: 800; color: #eee; position: absolute; top: 10px; right: 20px; line-height: 1; }
.step-card h4 { font-size: 1.3rem; color: var(--color-rojo); margin-bottom: 15px; position: relative; z-index: 2; }

.custom-list { margin-top: 20px; }
.custom-list li { margin-bottom: 15px; padding-left: 20px; position: relative; }
.custom-list li::before { content: "•"; color: var(--color-rojo); font-weight: bold; font-size: 1.2rem; position: absolute; left: 0; top: -2px; }

.placeholder-box { background: rgba(0,0,0,0.05); border: 2px dashed #ccc; height: 300px; display: flex; justify-content: center; align-items: center; font-weight: 700; color: #999; border-radius: 8px; }

/* =========================================
   6. RESPONSIVE GENERAL
========================================= */
@media (max-width: 960px) {
    .section-title h2 { font-size: 1.5rem; }
    .level-3-title { font-size: 1.3rem; }
    .split-container, .split-container.reverse-layout { flex-direction: column; gap: 30px; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cifras-grid { gap: 40px; }
}

@media (max-width: 600px) {
    .grid-4 { grid-template-columns: 1fr; }
}

/* =========================================
   7. MATRIZ DE METODOLOGÍA
========================================= */

/* Versión Desktop (Grilla) */
.matriz-desktop {
    display: grid;
    grid-template-columns: 50px repeat(5, 1fr);
    gap: 15px;
    margin-top: 0px;
}

.matriz-header {
    text-align: center;
    font-weight: 700;
    padding: 15px;
    font-family: var(--fuente-montserrat);
    color: var(--color-plomo-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Colores de la matriz (Iguales para PC y Móvil) */
.fase-verde { background-color: #a9d08e; }
.fase-amarillo { background-color: #ffd966; }
.fase-azul { background-color: #8faadc; }

/* Spans de las columnas superiores */
.matriz-header.fase-verde { grid-column: 2 / span 2; }
.matriz-header.fase-amarillo { grid-column: 4 / span 1; }
.matriz-header.fase-azul { grid-column: 5 / span 2; }

/* Etiquetas laterales rotadas (Ahora con color ROJO para que coincida con móvil) */
.matriz-label {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    font-family: var(--fuente-montserrat);
    font-weight: 700;
    color: var(--color-rojo); /* <-- Color rojo unificado */
    border: 1px solid #ccc;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-blanco);
    text-transform: uppercase;
}

/* Cajas grises de contenido (PC) */
.matriz-caja {
    background-color: #e7e6e6; /* Gris exacto */
    padding: 20px 15px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-plomo-oscuro);
}

/* =========================================
   Versión Mobile (Tarjetas verticales) 
========================================= */
.matriz-mobile {
    display: none;
    margin-top: 0px;
}

.metodo-card {
    background: var(--color-blanco, #ffffff); /* Fondo blanco para que destaquen las cajitas grises */
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
}

.metodo-card-header {
    padding: 12px;
    font-weight: 700;
    text-align: center;
    font-family: var(--fuente-montserrat);
    font-size: 0.95rem;
    color: var(--color-plomo-oscuro);
}

.metodo-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio exacto entre las cajitas grises */
}

/* Aquí armamos la "cajita gris" idéntica a la de PC */
.metodo-item {
    background-color: #e7e6e6; /* El mismo gris de la PC */
    padding: 15px;
    border-radius: 4px;
}

/* Justificamos el texto como pediste */
.metodo-item p {
    text-align: justify; 
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-plomo-oscuro);
}

/* Etiqueta roja en móvil */
.metodo-etiqueta {
    font-family: var(--fuente-montserrat);
    color: var(--color-rojo);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
    text-align: left; /* Alineado a la izquierda para verse más ordenado */
}

/* Responsive: Cambio de grilla a tarjetas */
@media (max-width: 960px) {
    .matriz-desktop { display: none; }
    .matriz-mobile { display: block; }
}

.datos-link {
            text-decoration: none;
            color: var(--color-plomo-oscuro);
            transition: color 0.3s ease;
            display: block; /* Hace que toda el área sea "clickeable" */
}

.datos-link:hover {
            color: var(--color-rojo);
}

.tarjeta-datos {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
}

.tarjeta-datos:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}