/* 1. VARIABLES Y RESET */
:root {
    --primary-blue: #1d2d5b;
    --secondary-blue: #2c3e50;
    --pink: #ff007a;
    --teal: #20c1ba;
    --orange: #f39c12;
    --gray-bg: #f8f9fa;
    --text-dark: #333;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* 2. HEADER Y NAVEGACIÓN */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img { height: 50px; display: block; }

nav ul { display: flex; list-style: none; gap: 20px; }

nav ul li a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: var(--transition);
}

nav ul li a:hover { color: var(--pink); }

.contact-box {
    background: var(--primary-blue);
    color: var(--white);
    padding: 10px 20px;
    font-size: 0.8rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

/* 3. HERO SECTION */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('wallpaper.png') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    padding: 0 20px;
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400; }
.hero h1 span { background: var(--pink); padding: 5px 15px; font-weight: 700; display: inline-block; }

/* 4. SECCIONES Y GRID */
section { padding: 80px 10%; }

.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { 
    font-size: 2rem; 
    text-transform: uppercase; 
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title h2::after {
    content: ""; width: 50px; height: 3px; background: var(--pink);
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* 5. TARJETAS (CARDS) */
.card {
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.card-content { padding: 25px; flex-grow: 1; }
.card-content h3 { margin-bottom: 10px; color: var(--primary-blue); font-size: 1.2rem; }
.card-content p { font-size: 0.9rem; color: var(--text-light); }

.btn {
    display: block; 
    text-align: center; 
    padding: 15px;
    text-decoration: none; 
    font-weight: 700;
    background: var(--teal); 
    color: var(--white); 
    transition: var(--transition);
}

.btn:hover { background: var(--primary-blue); }

/* 6. GRUPOS DE CENTROS Y CICLOS */
.centro-group {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid #e1e8ed;
}

.centro-header {
    background-color: var(--secondary-blue);
    color: var(--white);
    padding: 25px;
    text-align: center;
}

.familia-section {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.familia-section h4 {
    color: var(--secondary-blue);
    margin-bottom: 15px;
    border-left: 4px solid var(--teal);
    padding-left: 12px;
    font-size: 1.1rem;
}

.ciclos-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 12px;
}

.ciclo-item {
    display: flex;
    align-items: center;
    background: var(--gray-bg);
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 5px;
}

.ciclo-item:hover { transform: translateX(8px); background: #f0f2f5; }

/* 7. BADGES */
.badge {
    display: inline-block;
    padding: 4px 12px;       /* Espaciado interno: arriba/abajo y lados */
    border-radius: 10px;     /* Bordes redondeados */
    font-size: 0.85rem;      /* Tamaño de letra adecuado */
    font-weight: bold;
    white-space: nowrap;     /* Evita que la palabra se parta en dos líneas */
    color: #ffffff;          /* Color de texto blanco por defecto */
    margin-right: 10px;             /* Separación entre etiquetas si hay varias */
}

.badge.gm { background: var(--teal); } 
.badge.gs { background: var(--pink); } 
.badge.dtgs { background: var(--orange); } 
.badge.semipresencial, .badge.distancia { background: #6c757d; }

/* 8. FOOTER */
.main-footer {
    background-color: #1a2433;
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.footer-contact i { color: var(--pink); margin-right: 10px; }

.footer-social a {
    color: var(--white);
    font-size: 1.5rem;
    margin-right: 15px;
    transition: var(--transition);
}

.footer-social a:hover { color: var(--pink); }

.footer-bottom {
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 10%;
}

.bottom-content {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.bottom-content a { color: var(--white); text-decoration: none; margin-left: 15px; }

/* 9. RESPONSIVE */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 15px; padding: 20px; }
    nav ul { flex-wrap: wrap; justify-content: center; }
    section { padding: 50px 5%; }
    .bottom-content { flex-direction: column; text-align: center; gap: 10px; }
    .ciclo-item { flex-wrap: wrap; gap: 5px; }
}

.filtros-container {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.btn-filtro {
    padding: 8px 16px;
    border: 2px solid #3498db;
    background: transparent;
    color: #3498db;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-filtro.active, .btn-filtro:hover {
    background: #3498db;
    color: white;
}

.logos-superpuestos {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Forzamos que no haya espacio entre elementos del flex */
    gap: 0; 
}

.footer-logo {
    width: 60%;
    height: auto;
    display: block;
    position: static;
    transform: none;
    
    /* Eliminamos cualquier margen por defecto que pueda tener la imagen */
    margin-top: -5px;    /* Margen negativo para pegarlos aún más si es necesario */
    margin-bottom: -5px;
}