/* ====================== BASE ====================== */
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header (sin cambios importantes) */
.contenedor1 {
    width: 100%;
    padding: 10px 20px;
    background-color: #ffffff;
    border-bottom: 3.5px solid #e40e9d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.logos-texto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1900px;
    margin: 0 auto;
}

.ine, .iso { height: 60px; width: auto; }
.direccion {
    text-align: center;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    line-height: 1.4;
}

.documentos {
    text-align: center;
    margin: 25px 0;
    color: #1a437d;
    font-size: 2em;
}

/* ====================== GRID DE TARJETAS ====================== */
.grid-tarjetas, .contenedor3 {
    width: 90%;
    max-width: 1400px;
    margin: 30px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

/* ====================== TARJETA BASE ====================== */
.tarjeta {
    position: relative;
    background-color: #addde4ce;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none; /* ¡Quita el subrayado! */
}

.tarjeta:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
}

/* Texto centrado */
.texto {
    color: #1447b6;
    font-weight: 500;
    font-size: .9em;
    text-align: center;
    padding: 30px;
    z-index: 2;
    transition: opacity 0.4s ease;
}

/* Imagen que aparece en hover (usamos ::before) */
.tarjeta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.); /* empieza pequeña */
    width: 60%;
    height: 60%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

/* Imágenes específicas */
/*.tarjeta.documentos::before {
    background-image: url('../button/documentos_sgc/documentos.png');
}

.tarjeta.iso::before {
    background-image: url('../button/documentos_sgc/ISO_9001.jpg');
    
}*/


/* HOVER: mostrar imagen y ocultar texto */
.tarjeta:hover::before {
    opacity: 1;
    transform: translate(-80%, -35%) scale(1);
}

.tarjeta:hover .texto {
    opacity: 1;
}


/* ====================== BOTÓN SALIR ====================== */
.salir {
    margin: 40px 0;
}

.btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.cerrar {
    height: 70px;
    transition: transform 0.3s ease;
}

.salir:hover .cerrar {
    transform: scale(1.2);
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 768px) {
    .logos-texto { flex-direction: column; gap: 10px; }
    .ine, .iso { height: 50px; }
    .direccion { font-size: 12px; }

    /* En móvil mostramos la imagen siempre (muy tenue) para que no quede vacío */
    .tarjeta::before {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(0.8);
    }
    .tarjeta:hover::before {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
}