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

/* Fuente */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

/* ===== Header ===== */
header {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #17416d;
    color: #fff;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative; /* Clave para el posicionamiento del menú */
}

header img {
    height: 55px;
}

a {
    text-decoration: none;
}

header nav a {
    color: #fff;
    margin-left: 15px;
    padding: 8px 15px;
    border-radius: 15px;
    transition: background 0.3s;
    font-weight: 500;
}

header nav a:hover,
header nav a.active {
    background: #3498db;
}

/* Oculta el botón por defecto en pantallas grandes */
#menu-btn {
    display: none;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    background: none;
    border: 0;
    cursor: pointer;
}

/* ===== Contenedor principal ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
}

/* ===== Cards ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    padding: 15px;
    width: 48%;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* ===== Botón ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

/* ===== Responsividad ===== */

/* Estilos para pantallas medianas y grandes */
@media (min-width: 769px) {
    header nav {
        display: flex;
    }
}

/* Estilos para pantallas pequeñas (móviles) */
@media (max-width: 768px) {
    header {
        height: auto;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    header img {
        margin: 10px 0;
    }

    #menu-btn {
        display: block; /* Muestra el botón en móviles */
        margin-left: auto; /* Para alinear el botón a la derecha del logo */
    }

    header nav {
        display: none; /* Oculta el menú por defecto en móviles */
        position: absolute;
        top: 70px;
        right: 20px;
        background: #17416d; /* Fondo del menú desplegable */
        flex-direction: column;
        width: 220px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.25);
        z-index: 1000;
        text-align: center;
    }

    header nav a {
        display: block; /* Cada enlace en una línea */
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    /* Clase que se añade con JavaScript para mostrar el menú */
    header nav.show {
        display: flex;
    }

    .card {
        width: 100%;
    }
}