.grid {
    margin: 0 auto;
    padding: 0; /* Añade esta línea para matar el espacio por defecto */
    list-style: none;
    text-align: center;
}

.grid li {
	display: inline-block;
	margin: 0;
	padding: 20px;
	text-align: center;
	position: relative;
}

.grid figure {
	margin: 0;
	position: relative;
}

.grid figure img {
	width: 100%;
	max-width: 100%;
	display: block;
	position: relative;
}

.grid figcaption {
	position: absolute;
	top: 0;
	left: 0;
	padding: 42px 22px;
	background: #304352;
	color: #ed4e6e;
}

.grid figcaption h1 {
	font-size: 1.6rem;
	line-height: 2.2rem;
	margin: 0;
	padding-bottom: 12px;
	color: #fff;
}

.grid figcaption small {
	font-size: 12px;
	letter-spacing: 1px;
	display: none !important; /* Oculta el texto en la miniatura */
}

.grid figcaption a {
	text-align: center;
	padding: 5px 10px;
	border-radius: 2px;
	display: inline-block;
	background: #e44c65;
	color: #fff;
}

/* =========================================
   TARJETAS DE SERVICIOS (DENTAL TARGET)
========================================= */
.cs-style-4 figure {
    position: relative;
    overflow: hidden;
    border-radius: 15px; /* Bordes redondeados que le pusimos */
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.08);
}

/* -----------------------------------------
   1. VERSIÓN MÓVIL (Celulares - sin animación)
----------------------------------------- */
@media (max-width: 767px) {
    .cs-style-4 figure img {
        width: 100%;
        transform: none !important; /* Cero animaciones */
    }
    
    .cs-style-4 figcaption {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 20px;
        /* Degradado oscuro abajo hacia transparente arriba */
        background: linear-gradient(to top, #30435292);
        transform: none !important;
        opacity: 1; /* Siempre visible */
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        
        text-align: center;
    }

    .cs-style-4 figcaption h3,
    .cs-style-4 figcaption span {
        color: #ffffff; /* Texto blanco para resaltar en el degradado */
        margin: 0;
    }
}

/* -----------------------------------------
   2. VERSIÓN ESCRITORIO (Computadoras - Efecto Fade)
----------------------------------------- */
@media (min-width: 768px) {
    .cs-style-4 figure img {
        transform: none !important;
        transition: transform 0.4s ease-in-out;
    }
    
    .cs-style-4 figcaption {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        opacity: 0; /* Oculto inicialmente */
        background-color: #30435292; /* Color de Dental Target */
        transition: opacity 0.4s ease-in-out;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center; /* Texto al centro */
        cursor: pointer;
        transform: none !important;
    }

    /* Al pasar el ratón */
    .cs-style-4 figure:hover figcaption {
        opacity: 1; /* Aparece el recuadro de color */
    }

    .cs-style-4 figure:hover img {
        transform: scale(1.05) !important; /* Pequeño zoom a la foto */
    }
}


