:root {
    --primary-color: #007BFF;
    --secondary-color: #343a40;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #343a40;
    --link-color: #007BFF;
    --hover-color: #0056b3;
    --box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

/* Contenedor para el header y el main */
.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative; /* Esencial para el sticky header */
}

/* Estilos de la cabecera */
header {
    text-align: center;
    padding: 20px 20px;
    background: linear-gradient(45deg, var(--primary-color), #00c6ff);
    color: white;
    box-shadow: var(--box-shadow);
    position: sticky; /* La solución para que se "pegue" al top del contenedor */
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Estilos del contenedor de los cards */
.container {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-sizing: border-box;
    width: 100%;
}

.card {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.5em;
}

.card p {
    font-size: 1em;
}

.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s;
    margin-top: 20px;
}

.button:hover {
    background-color: var(--hover-color);
}

/* Estilos para el pie de página fijo */
footer {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 5px;
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

footer p a {
    color: white;
}

.social-links a {
    color: white;
    font-size: 1.0em;
    margin: 0 10px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Animación sutil para las cajas al cargar la página */
.card {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para el efecto de desplegar/contraer */
.description-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out; /* Transición suave */
    padding-top: 0;
}

.description-container.active {
    max-height: 1000px; /* Suficiente para mostrar el contenido */
    transition: max-height 0.5s ease-in;
    padding-top: 15px; /* Un poco de espacio al desplegar */
}

.description-title {
    cursor: pointer;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.description-title i {
    transition: transform 0.3s ease-in-out;
}

.description-title.active i {
    transform: rotate(180deg);
}
@media (max-width: 991px) {
    /* Estilos para el footer en pantallas de tablet */
    header h1 {
        font-size: 1.4em;
    }

    header h1 {
        margin: 0px;
    }

    header p {
        margin: 0px;
    }
    
    header p {
        font-size: 1.0em;
    }
    
    .container {
        padding: 20px;
    }

    .card {
        padding: 15px;
    }

    footer p {
        font-size: 0.8em; /* Reduce el tamaño del texto */
        margin: 0; /* Elimina márgenes extra */
    }
}

@media (max-width: 768px) {
    /* Estilos para el footer en pantallas de móvil */   
    footer {
        flex-direction: column; /* Apila el párrafo y los enlaces sociales */
        gap: 5px; /* Reduce el espacio entre las dos líneas */
    } 

    .social-links {
        display: flex; /* Asegura que los íconos de redes sociales se comporten como una fila */
        justify-content: center; /* Centra los íconos */
        gap: 15px; /* Espacio entre los íconos */
    }

    header {
        padding: 5px 5px;
    }

    header h1 {
        font-size: 1.0em;
    }

    header p {
        font-size: 0.75em;
    }

    .container {
        padding: 15px 15px;
    }

    .card h2 {
        font-size: 0.9em;
    }
    .card h3 {
        font-size: 0.9em;
    }
        .card p {
        font-size: 0.9em;
    }

    .description-container.active {
    max-height: 1500px; /* Suficiente para mostrar el contenido */
    }

    .btn-licitaciones {
        /* 1. Reducir el padding */
        padding: 5px 20px;

        /* 2. Reducir el tamaño de la fuente */
        font-size: 14px;

        /* 3. Opcional: Si quieres que el botón ocupe todo el ancho en móvil, puedes usar: */
        /* width: 100%; */
        /* display: block; */

        /* 4. Opcional: Si quieres que ocupe menos ancho, puedes usar: */
        max-width: 80%;
        margin: 0 auto;  /* Para centrarlo si usas max-width */
    }
}
