/**
 * ==========================================================================
 * LA EMPRESA - ESTILOS ESPECÍFICOS (empresa.css)
 * ==========================================================================
 * Contiene exclusivamente los estilos de la página "La Empresa".
 * Los estilos de Header, Footer y variables se importan de global.css.
 * ==========================================================================
 */

/* ================= ACCESIBILIDAD (WCAG 2.2 AA) ================= */
.value-pill:focus-visible {
    outline: 4px solid var(--color-verde-acento, #28CC43) !important;
    outline-offset: 6px !important;
}
.close-value-modal:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: 4px !important;
}
[data-theme="light"] .close-value-modal:focus-visible {
    outline: 2px solid #000957 !important;
}
.btn-contact-company:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 4px !important;
}
[data-theme="light"] .btn-contact-company:focus-visible {
    outline: 3px solid #000957 !important;
}
/* =============================================================== */

/* ==========================================================================
 * 1. SECCIÓN HERO DE LA EMPRESA (Pantalla completa)
 * ========================================================================== */

.company-hero-section {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 600px;
    background-image: url('../Imagenes/empresa/empresa.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 9, 87, 0.6), rgba(0, 9, 87, 0.3));
    z-index: 1;
}

.company-hero-content {
    position: relative;
    z-index: 2;
    background: rgba(0, 9, 87, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(40, 204, 67, 0.4);
    border-radius: 15px;
    padding: 30px 50px;
    max-width: 900px;
    text-align: center;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transform: scale(0.98) translateY(0);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.8s ease, background-color 0.8s ease;
    opacity: 0;
    animation: fadeInHero 1s ease-out forwards;
}

.company-hero-content.auto-hover-active {
    transform: scale(1.05) translateY(-15px);
    box-shadow: 0 45px 90px rgba(0, 0, 0, 0.65), 0 0 50px rgba(40, 204, 67, 0.4);
    background: rgba(0, 9, 87, 0.3);
}

[data-theme="light"] .company-hero-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .company-hero-content.auto-hover-active {
    box-shadow: 0 45px 90px rgba(0, 0, 0, 0.18), 0 0 50px rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.35);
}

.company-hero-content h1 {
    font-size: 3.5rem;
    color: #ffffff;
    margin-bottom: 25px;
    line-height: 1.2;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(40, 204, 67, 0.6);
}

.company-hero-content p {
    font-size: 1.3rem;
    color: #ffffff;
    margin-bottom: 40px;
    line-height: 1.6;
    font-weight: 400;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
}

.btn-contact-company {
    display: inline-block;
    background-color: var(--color-verde-acento);
    color: #ffffff !important;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 204, 67, 0.4);
    letter-spacing: 1px;
    border: none;
}

.btn-contact-company:hover {
    background-color: #21a836;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(40, 204, 67, 0.6);
}

@keyframes fadeInHero {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
 * 2. BARRA DE TÍTULOS ESTILO PÍLDORA (ANIMACIÓN AUTO-HOVER INCLUIDA)
 * ========================================================================== */

.title-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.title-wrapper.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.title-bar {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    background-color: #ffffff;
    color: #000957 !important;
    margin-bottom: 10px;
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255,255,255,0.1);
    text-shadow: none;
    transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.3s ease;
    cursor: default;
}

.title-bar:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .title-bar {
    background-color: var(--color-verde-acento, #28CC43);
    color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(40, 204, 67, 0.3);
}

[data-theme="light"] .title-bar:hover {
    box-shadow: 0 20px 40px rgba(40, 204, 67, 0.5), 0 0 20px rgba(40, 204, 67, 0.3) !important;
}

.title-wrapper.is-visible .title-bar {
    animation: titlePop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

[data-theme="light"] .title-wrapper.is-visible .title-bar {
    animation: titlePopLight 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes titlePop {
    0% { transform: scale(0.8); box-shadow: 0 0 0 rgba(0,0,0,0); }
    50% { transform: scale(1.05); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
    100% { transform: scale(1); box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
}

@keyframes titlePopLight {
    0% { transform: scale(0.8); box-shadow: 0 0 0 rgba(0,0,0,0); }
    50% { transform: scale(1.05); box-shadow: 0 20px 40px rgba(40, 204, 67, 0.5); }
    100% { transform: scale(1); box-shadow: 0 10px 25px rgba(40, 204, 67, 0.3); }
}

/* ==========================================================================
 * 3. SECCIÓN "SOBRE NOSOTROS" (Efectos Sincronizados y Levitación)
 * ========================================================================== */

.about-us-section {
    padding: 40px 40px 100px 40px;
    background-color: transparent;
    position: relative;
    z-index: 5;
    overflow-x: hidden;
}

.about-container {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    max-width: 1300px;
    margin: 0 auto;
    gap: 40px;
}

.about-text-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;

    background: linear-gradient(135deg, rgba(60, 100, 220, 0.35) 0%, rgba(0, 9, 87, 0.6) 45%, rgba(0, 3, 30, 0.85) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 40px 50px;

    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35), inset 0 2px 15px rgba(255, 255, 255, 0.1);

    translate: var(--scroll-x, -100vw) 0;
    will-change: translate;

    animation: floatTech 6s ease-in-out infinite;
    animation-delay: -3s;

    scale: 1;
    transition: scale 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

.about-text-col:hover {
    scale: 1.03;
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.45), inset 0 2px 20px rgba(255, 255, 255, 0.2), 0 0 30px rgba(40, 204, 67, 0.2);
}

[data-theme="light"] .about-text-col {
    background: linear-gradient(135deg, rgba(235, 240, 245, 0.95) 0%, rgba(180, 195, 210, 0.9) 45%, rgba(140, 155, 175, 0.95) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    border-right: 1px solid rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.20), inset 0 2px 20px rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .about-text-col:hover {
    box-shadow: 0 35px 60px rgba(0, 0, 0, 0.30), inset 0 2px 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.5);
}

.about-title-img {
    max-width: 220px;
    height: auto;
    margin: 0 auto 25px auto;
    display: block;
    transform: translateY(-8px);
    filter: drop-shadow(0 20px 15px rgba(0,0,0,0.5));
    transform-origin: center center;
}

.spin-active {
    animation: spin360 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes spin360 {
    0% { rotate: 0deg; }
    100% { rotate: 360deg; }
}

[data-theme="light"] .about-title-img {
    filter: drop-shadow(0 20px 15px rgba(0, 9, 87, 0.25));
}

.about-text-col p {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 20px;
    color: var(--color-texto-principal);
    transform: translateY(-4px);
    text-shadow: 0 15px 20px rgba(0, 0, 0, 0.8), 0 4px 5px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .about-text-col p {
    text-shadow: 0 15px 20px rgba(0, 9, 87, 0.3), 0 4px 5px rgba(0, 9, 87, 0.15);
}

.about-text-col p:last-child {
    margin-bottom: 0;
}

.about-image-col {
    flex: 1;
    display: flex;
    translate: var(--scroll-x, 100vw) 0;
    will-change: translate;
}

.about-dynamic-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35), 0 0 60px rgba(40, 204, 67, 0.15);
    border: 1px solid var(--borde-dropdown);

    animation: floatTech 6s ease-in-out infinite;
}

[data-theme="light"] .about-dynamic-gif {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(140, 155, 175, 0.6);
}

@keyframes floatTech {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}


/* ==========================================================================
 * 4. HISTORIA / ACERCA DE NOSOTROS
 * ========================================================================== */
.our-history-section {
    padding: 20px 40px 60px 40px;
    background-color: transparent;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.history-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.history-row {
    display: flex;
    gap: 40px;
    align-items: center;
}

.history-text-box {
    flex: 1.2;
    background-color: #00063d;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    will-change: transform, opacity;
}

[data-theme="light"] .history-text-box {
    background-color: #CFD5E1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.history-text-box h3 {
    color: var(--color-verde-acento, #28CC43);
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-align: center;
}

.history-text-box p {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    overflow-wrap: break-word;
    word-spacing: -0.05em;
}

.history-text-box p:last-child {
    margin-bottom: 0;
}

[data-theme="light"] .history-text-box p { color: #000957; }

.history-image-box {
    flex: 0.8;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    perspective: 1000px;
    will-change: transform, opacity;
    display: flex;
    align-items: center;
}

.history-image-box img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

[data-theme="light"] .history-image-box {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}


/* --- ANIMACIONES INDEPENDIENTES --- */
.top-row .top-text { opacity: 0; transform: translateX(-100vw); }
.top-row .top-image { opacity: 0; transform: scale(0.05) translateZ(-200px); }

.bottom-row .bottom-text { opacity: 0; transform: translateX(100vw); }
.bottom-row .bottom-image { opacity: 0; transform: scale(0.05) translateZ(-200px); }

.top-row.is-visible .top-text {
    animation: slideInLeft 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0s;
}
.top-row.is-visible .top-image {
    animation: zoomInImageHist 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.6s;
}

.bottom-row.is-visible .bottom-text {
    animation: slideInRight 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0s;
}
.bottom-row.is-visible .bottom-image {
    animation: zoomInImageHist 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.6s;
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(100vw); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-100vw); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes zoomInImageHist {
    0% { opacity: 0; transform: scale(0.05) translateZ(-200px); }
    40% { opacity: 0.5; }
    100% { opacity: 1; transform: scale(1) translateZ(0); }
}

/* ==========================================================================
 * 5. SECCIÓN VALORES (PÍLDORAS SUSPENDIDAS Y MODAL)
 * ========================================================================== */

.values-section {
    padding: 20px 40px 40px 40px; 
    background-color: transparent;
    position: relative;
    z-index: 5;
    overflow-x: hidden;
}

.values-intro {
    text-align: center;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    max-width: 800px;
    margin: 30px auto 50px auto;
    padding: 20px 30px;
    background: rgba(0, 6, 61, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);

    opacity: 0;
    transform: scale(0.05) translateZ(-200px);
    will-change: transform, opacity;
}

.values-intro.is-visible {
    animation: zoomInImageHist 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

[data-theme="light"] .values-intro {
    color: #ffffff;
    background: rgba(0, 6, 61, 0.75);
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    text-shadow: none;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.value-pill {
    flex: 1 1 calc(33.333% - 30px);
    min-width: 280px;
    max-width: 360px;
    background-color: #00063d;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 25px 35px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    opacity: 0;
}

/* Efecto hover manual exclusivo para Escritorio */
@media (min-width: 769px) {
    .value-pill:hover {
        transform: translateY(-10px) scale(1.05) !important;
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(40, 204, 67, 0.2) !important;
        border-color: rgba(40, 204, 67, 0.4) !important;
    }

    [data-theme="light"] .value-pill:hover {
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 0 20px rgba(40, 204, 67, 0.3) !important;
        border-color: var(--color-verde-acento, #28CC43) !important;
    }
}

[data-theme="light"] .value-pill {
    background-color: #CFD5E1;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.value-pill h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

[data-theme="light"] .value-pill h3 {
    color: #000957;
}

.value-num {
    color: var(--color-verde-acento, #28CC43);
    font-weight: 900;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--color-verde-acento, #28CC43);
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.value-pill:hover .read-more {
    transform: translateX(5px);
}

.hidden-content {
    display: none;
}

/* ==========================================================================
 * ANIMACIÓN DE PÍLDORAS (DESKTOP SOLAMENTE - Aislado para no chocar con móvil)
 * ========================================================================== */
@media (min-width: 769px) {
    .value-pill:nth-child(1), .value-pill:nth-child(2), .value-pill:nth-child(3) { transform: translateX(-100vw); }
    .value-pill:nth-child(4), .value-pill:nth-child(5) { transform: translateX(100vw); }

    .values-grid.is-visible .value-pill:nth-child(1) { animation: slideInLeftPill 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0s; }
    .values-grid.is-visible .value-pill:nth-child(2) { animation: slideInLeftPill 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.15s; }
    .values-grid.is-visible .value-pill:nth-child(3) { animation: slideInLeftPill 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.3s; }
    .values-grid.is-visible .value-pill:nth-child(4) { animation: slideInRightPill 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.45s; }
    .values-grid.is-visible .value-pill:nth-child(5) { animation: slideInRightPill 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.6s; }

    @keyframes slideInLeftPill { 0% { opacity: 0; transform: translateX(-100vw); } 100% { opacity: 1; transform: translateX(0); } }
    @keyframes slideInRightPill { 0% { opacity: 0; transform: translateX(100vw); } 100% { opacity: 1; transform: translateX(0); } }
}


/* Modal de Valores */
.value-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.value-modal-overlay.active { opacity: 1; visibility: visible; }

.value-modal-box {
    background-color: #00084d;
    width: 90%; max-width: 550px;
    border-radius: 30px; padding: 40px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(40, 204, 67, 0.4);
    transform: scale(0.1); opacity: 0;
}

[data-theme="light"] .value-modal-box {
    background-color: #ffffff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), inset 0 0 0 2px var(--color-verde-acento, #28CC43);
}

.value-modal-box h3 {
    color: #ffffff; font-size: 1.6rem; font-weight: 800;
    margin-bottom: 20px; padding-right: 30px;
}

[data-theme="light"] .value-modal-box h3 { color: #000957; }

.value-modal-body {
    color: #ffffff; font-size: 1.1rem; font-weight: 600; line-height: 1.6;
    text-align: justify; text-align-last: left;
    hyphens: auto; -webkit-hyphens: auto; -ms-hyphens: auto;
    overflow-wrap: break-word; word-spacing: -0.05em;
}

[data-theme="light"] .value-modal-body { color: #000957; }
.value-modal-body strong { color: var(--color-verde-acento, #28CC43); }

.close-value-modal {
    position: absolute; top: 20px; right: 20px;
    background-color: rgba(255, 255, 255, 0.1); color: #ffffff; border: none;
    width: 35px; height: 35px; border-radius: 50%; cursor: pointer;
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.close-value-modal:hover { background-color: var(--color-verde-acento, #28CC43); transform: rotate(90deg); }
[data-theme="light"] .close-value-modal { background-color: rgba(0, 9, 87, 0.1); color: #000957; }
[data-theme="light"] .close-value-modal:hover { background-color: var(--color-verde-acento, #28CC43); color: #ffffff; }

/* ==========================================================================
 * 6. NUEVA SECCIÓN: BASES, MISIÓN Y VISIÓN (DISEÑO ESCALONADO)
 * ========================================================================== */

.foundations-section {
    padding: 0px 40px 40px 40px; 
    position: relative;
    z-index: 5;
    overflow-x: hidden;
}

.foundations-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    perspective: 1200px;
}

.foundation-block {
    display: flex;
    flex-direction: column;
    gap: 25px;
    will-change: transform, opacity;
}

.block-bases { grid-column: 1; grid-row: 1; }
.block-mission { grid-column: 2; grid-row: 1 / 3; margin-top: 150px; }
.block-vision { grid-column: 1; grid-row: 2 / 4; margin-top: 50px; }

.foundation-card {
    background-color: #00063d;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255,255,255,0.05);
}

[data-theme="light"] .foundation-card {
    background-color: #CFD5E1;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.foundation-card h3 {
    color: var(--color-verde-acento, #28CC43);
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 800;
}

.foundation-card p {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    overflow-wrap: break-word;
    word-spacing: -0.05em;
    margin: 0;
}

[data-theme="light"] .foundation-card h3 { color: #000957; }
[data-theme="light"] .foundation-card p { color: #000957; }

.puzzle-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    background-color: transparent;
}

[data-theme="light"] .puzzle-image-container { box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

.puzzle-piece {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    transform: translate(var(--tx), var(--ty)) rotate(var(--trot)) scale(0);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1.5s ease;
}

/* --- ANIMACIONES DE LAS BASES, MISIÓN Y VISIÓN --- */
.block-bases { opacity: 0; transform: translateZ(-800px) rotateX(90deg); transform-origin: top center; }
.block-bases.is-visible { animation: zoomInFlip 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes zoomInFlip {
    0% { opacity: 0; transform: translateZ(-800px) rotateX(90deg); }
    50% { opacity: 0.5; transform: translateZ(-200px) rotateX(45deg); }
    100% { opacity: 1; transform: translateZ(0) rotateX(0deg); }
}

.mission-text-card { opacity: 0; transform: translateX(100vw); }
.block-mission.is-visible .mission-text-card { animation: slideInRight 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.8s; }

.vision-text-card { opacity: 0; transform: translateX(-100vw); }
.block-vision.is-visible .vision-text-card { animation: slideInLeft 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: 0.8s; }

.foundation-block.is-visible .puzzle-piece { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }

/* ==========================================================================
 * 7. DISEÑO RESPONSIVO GENERAL (Y MEJORAS MÓVILES EXCLUSIVAS)
 * ========================================================================== */
@media (max-width: 992px) {
    .about-container { flex-direction: column; text-align: center; gap: 40px; }
    .about-text-col, .about-image-col { translate: 0 0 !important; }

    .history-row { flex-direction: column; }
    .top-row { flex-direction: column-reverse; }
    .history-text-box, .history-image-box { width: 100%; }

    .title-bar { font-size: 1.8rem; padding: 12px 30px; }
    .value-pill { flex: 1 1 calc(50% - 30px); }

    .foundations-grid { grid-template-columns: 1fr; gap: 60px; }
    .block-bases, .block-mission, .block-vision { grid-column: 1; grid-row: auto; margin-top: 0; }
}

@media (max-width: 768px) {
    .company-hero-content { margin: 0 20px; padding: 40px 20px; }
    .company-hero-content h1 { font-size: 2.2rem; }
    .company-hero-content p { font-size: 1.1rem; }

    .company-hero-content p, 
    .about-text-col p, 
    .values-intro {
        text-align: justify !important;
        text-align-last: left !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
        -ms-hyphens: auto !important;
        overflow-wrap: break-word !important;
        word-spacing: -0.05em !important;
    }

    .about-us-section, .our-history-section { padding: 40px 20px; }
    .values-section, .foundations-section { padding: 20px 20px 40px 20px; }

    .about-text-col { padding: 30px 20px; }
    .history-text-box { padding: 25px 20px; }

    .values-intro { font-size: 1.05rem; padding: 15px 20px; }
    .value-pill { flex: 1 1 100%; border-radius: 30px; }
    .value-modal-box { padding: 30px 20px; }

    .foundation-card { padding: 30px 20px; }
    .foundation-card h3 { font-size: 1.5rem; }

    /* ==========================================================================
     * ANIMACIÓN MÓVIL: ENTRADA LATERAL (1 VEZ) Y AUTO-HOVER PERPETUO
     * Diseñado con máquina de estados basada en clases para evitar colisiones.
     * ========================================================================== */
    
    /* 1. Base compartida para las píldoras en móvil */
    .value-pill {
        transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease, box-shadow 0.35s ease, border-color 0.35s ease !important;
        z-index: 1;
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    /* 2. Estado de reposo esperando entrar a la pantalla (Inyectado por JS) */
    .value-pill.mobile-hidden-left {
        transform: translateX(-100vw);
        opacity: 0;
    }
    .value-pill.mobile-hidden-right {
        transform: translateX(100vw);
        opacity: 0;
    }

    /* 3. Lupa Continua (Agregada/Quitada por el radar en tiempo real) */
    .value-pill.active-mobile-hover {
        transform: translateX(0) scale(1.06) !important;
        transition-duration: 0.35s !important; /* Acelera la transición del hover */
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(40, 204, 67, 0.2) !important;
        border-color: rgba(40, 204, 67, 0.4) !important;
        z-index: 50 !important;
    }

    [data-theme="light"] .value-pill.active-mobile-hover {
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 0 20px rgba(40, 204, 67, 0.3) !important;
        border-color: var(--color-verde-acento, #28CC43) !important;
    }
}

@media (max-width: 600px) {
    .values-grid { flex-direction: column; } 
}
