.portafolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 40px; 
    margin-top: 50px;
    padding: 20px; 
}
/* Base de la Tarjeta (Link <a>) */
.project-card {
    display: flex;
    flex-direction: column; 
    position: relative;
    overflow: hidden;
    border-radius: 12px;    
    background-color: #1a1a2e; 
    color: #f0f0f0; 
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2); 
    border: 1px solid rgba(0, 255, 255, 0.4);    
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.4s ease-in-out;
}
/* Efecto Hover: Resaltar y elevar la tarjeta */
.project-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.5); 
}
/* Imagen */
.project-card img {
    width: 100%;
    height: 250px; 
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0; 
}
/* 2. OVERLAY DE INFORMACIÓN (Contenedor siempre visible) */
.card-overlay {
    position: relative; 
    padding: 20px;
    background-color: #1a1a2e; 
    color: white;
    padding-bottom: 30px; 
}
.card-title {
    font-family: sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    color: #fff; 
   text-decoration: none !important;
}
/* 3. LISTA DE TECNOLOGÍAS (COMPACTACIÓN CON EFECTO HOVER) */
.card-techs {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;   
    max-height: 120px;
    overflow: hidden; 
    position: relative;
    transition: max-height 0.6s ease-in-out;
}
/* El truco del Gradiente: Simula que la lista continúa */
.card-techs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px; 
    background: linear-gradient(to top, #1a1a2e, rgba(26, 26, 46, 0)); 
    pointer-events: none; 
    transition: opacity 0.3s ease;
}
/* Expande la lista completa al hacer HOVER en la tarjeta */
.project-card:hover .card-techs {
    max-height: 500px; 
}
.project-card:hover .card-techs::after {
    opacity: 0; 
}
.card-techs li {
    font-family: sans-serif;
    font-size: 1em;
    font-weight: 400;
    margin-bottom: 8px;
    color: #c0c0c0; 
    position: relative;
    padding-left: 20px;
}
/* Estilo del ícono de Checkmark */
.card-techs li::before {
    content: "✓"; 
    color: #00bcd4;
    font-weight: 700;
    font-size: 1.1em;
    position: absolute;
    left: 0;
    top: 0;
}
.card-techs li,
.card-techs li a {
    text-decoration: none !important;
}
/* Botón Ver Detalle */
.view-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    font-weight: 600;
    background: #00bcd4; 
    color: #fff;
    border-color: #00bcd4;
    box-shadow: 0 5px 5px #0097a7;
    text-decoration: none !important;
}
/* 4. FILTROS Y BOTONES DE ACCIÓN */
.portafolio-filtros {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 20px;
}
/* Estilo de los Botones de Filtro */
.filter-button {
    background: transparent;
    color: #00bcd4; 
    border: 2px solid #00bcd4;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    border-radius: 25px; 
    font-family: sans-serif;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    user-select: none;
}
.filter-button:hover {
    background: #00bcd4;
    color: #fff; 
}
.filter-button.active {
    background: #00bcd4; 
    color: #fff;
    border-color: #00bcd4;
    box-shadow: 0 5px 5px #0097a7;
}
/* Botón "Cargar Más Proyectos" */
#load-more-projects {
    display: block; 
    width: 300px; 
    max-width: 90%;
    margin: 60px auto; 
    padding: 18px 30px;
    background: #00bcd4; 
    color: #fff;
    border: none;
    border-radius: 30px; 
    font-family: sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    user-select: none;
}
#load-more-projects:hover {
    background: #0097a7;
    transform: translateY(-2px);
}
#load-more-projects:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: default;
    transform: translateY(0);
}
@media (max-width: 768px) {
    /* 🚨 AJUSTE 1: Reduce el padding del grid principal */
    .portafolio-grid {
        /* Reducimos el padding de 20px a 10px a los lados para usar más ancho */
        padding: 10px 10px; 
        grid-template-columns: 1fr; 
        gap: 20px;
    }
    .project-card img {
        height: 220px; 
    }
    .card-overlay {
        padding: 25px 20px; /* Más padding interno para evitar que el texto toque los bordes */
    }
    .portafolio-filtros {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        gap: 5px;
    }
    .filter-button {
        margin: 5px 2px;
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .card-techs {
        max-height: none !important; /* Desactiva la altura limitada (120px) */
        overflow: visible;           /* Desactiva el overflow: hidden */
        transition: none;            /* Desactiva la transición */
    }
    /* 🚨 SOLUCIÓN HOVER EN MÓVIL: Desactiva el gradiente de fundido */
    .card-techs::after {
        content: none; /* Elimina el elemento de gradiente */
        opacity: 0;
    }
}