/* Importa la fuente Montserrat desde Google Fonts */
@import url('https://fonts.googleapis.com/css?family=Montserrat&display=swap');

/* Estilos globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background: #ffffff !important;
}

/* Contenedor principal para las tarjetas */
.container-card {
    display: grid;

   
    grid-template-columns: repeat(4, 180px);

    gap: 16px; /* MISMO espacio */
    max-width: 820px; /* se mantiene */
    margin: auto;
    padding: 16px;

    justify-content: center; /* centra el bloque */
}

/* Estilos de las tarjetas (UNIFICADO, sin duplicados) */
.card {
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0px 1px 10px rgba(0,0,0,0.6);
    transition: all 400ms ease-out;
    cursor: default;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    /* 🔒 IMPORTANTE: asegura tamaño consistente */
    width: 180px;
}

/* Hover igual */
.card:hover {
    box-shadow: 5px 5px 20px rgba(0,0,0,0.4);
    transform: translateY(-3%);
}

/* Contenido interno */
.card .contenido-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card .contenido-card h3 {
    margin-bottom: 8px;
    color: #7a7a7a;
}

.card .contenido-card p {
    line-height: 1.8;
    color: #6a6a6a;
    font-size: 14px;
    margin-bottom: 5px;
}

.card .contenido-card a {
    display: inline-block;
    padding: 10px;
    margin-top: 10px;
    text-decoration: none;
    color: #2fb4cc;
    border: 1px solid #2fb4cc;
    border-radius: 4px;
    transition: all 400ms ease;
    margin-bottom: 5px;
}

.card .contenido-card a:hover {
    background: #2fb4cc;
    color: #fff;
}

/* 🔒 CONTROL DE IMÁGENES  */
.card img {
    width: 100%;
    height: auto;
    display: block;
}

/* 🎯 Centrar último elemento cuando queda solo en la fila */
.container-card .card:last-child:nth-child(4n+1) {
    grid-column: 2 / 4;
    justify-self: center;
}

/* 📱 Móviles */
@media only screen and (max-width: 768px) {
    .container-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
        justify-items: center;
    }

    .card {
        max-width: 175px;
        width: 100%;
    }

    /* 🔧 FIX correcto */
    .container-card .card:last-child:nth-child(4n+1) {
        grid-column: auto;
        justify-self: start;
    }
}