/* ════════════════════════════════════════
   SOBREMI — original (sin cambios)
════════════════════════════════════════ */
.button-principal {
    position: absolute;
    text-decoration: none;
    background-color: #d72b1f;
    color: white;
    border: 0;
    font-family: Roboto;
    font-size: 18px;
    font-weight: 400;
    border-radius: 20px;
    top: 78.95%;
    cursor: pointer;
}
.button-principal:hover {
    background-color: #0039a6;
    transition: background-color 0.3s ease;
}
.contacto-form-wrapper {
    position: relative;
}
html {
    scroll-behavior: smooth;
}
.historia {
    opacity: 0;
    transform: translateX(80px) scale(1);
    transition: opacity 1.2s ease, transform 0.6s ease;
    will-change: transform, opacity;
}
.historia1 {
    opacity: 0;
    transform: translateX(-80px) scale(1);
    transition: opacity 1.2s ease, transform 0.6s ease;
    will-change: transform, opacity;
}
.historia2 {
    opacity: 0;
    transform: translateY(80px) scale(1);
    transition: opacity 1.2s ease, transform 0.6s ease;
    will-change: transform, opacity;
}
.historia.visible,
.historia1.visible,
.historia2.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}
p {
    font-family: Roboto;
}
body {
    overflow-x: hidden;
    max-width: 100%;
}
.a-text-b {
    color: white;
    text-decoration: none;
    font-family: Roboto;
    font-weight: 400;
    font-size: 18px;
    position: relative;
    display: block;
    width: fit-content;
}
.a-text-b::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background: #d72b1f;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    will-change: transform;
}
.a-text-b:hover::after {
    transform: translateX(-50%) scaleX(1);
}
.a-text-b:hover {
    color: rgba(255, 255, 255, 0.773);
    transition: color 0.3s ease;
}
.button-contact {
    text-decoration: none;
    background-color: #d72b1f;
    color: white;
    border: 0;
    font-family: Roboto;
    width: 100px;
    height: 30px;
    margin: 0 auto;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 400;
    border-radius: 20px;
    top: 78.95%;
    cursor: pointer;
}
.button-contact:hover {
    background-color: #0039a6;
    transition: background-color 0.2s ease;
}
.input-contacto {
    border-radius: 30px;
    border: none;
    padding: 10px 15px;
    outline: none;
    font-family: Roboto;
}
.input-contacto:focus {
    box-shadow: 0 0 0 3px #d72b1f;
    transition: box-shadow 80ms ease;
}
.error-input {
    box-shadow: 0 0 0 3px #d72b1f;
}

/* ════════════════════════════════════════
   RESPONSIVE — solo se activa en móvil
   El diseño desktop no se toca para nada.
════════════════════════════════════════ */

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {

    html, body {
        overflow-x: hidden !important;
    }

    /* --- HERO --- */
    #inicio > div {
        height: 61vh !important;
        overflow: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .hero-img-desktop { display: none !important; }
    .hero-img-mobile {
        display: block !important;
        width: 100% !important;
        height: 62vh !important;
        object-fit: cover !important;
        object-position: center top !important;
    }
    .hero-title {
        font-size: 21px !important;
        left: 16px !important;
        right: 16px !important;
        top: 42% !important;
        line-height: 1.2 !important;
    }
    .hero-subtitle {
        font-size: 17px !important;
        left: 16px !important;
        top: 49% !important;
    }
    .hero-btn-sobre {
        position: absolute !important;
        left: 16px !important;
        width: 150px !important;
        height: 32px !important;
        font-size: 16px !important;
        text-align: center !important;
        box-sizing: border-box !important;
        top: 64% !important;
    }

    /* --- HISTORIA --- */

    /* La sección ya no tiene altura fija */
    #historia > div {
        height: auto !important;
        padding: 0 16px 50px 16px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Cada bloque (flex-row) se apila en columna */
    #historia .flex-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 24px !important;
    }

    /* Imágenes: ancho completo, altura automática, sin márgenes laterales fijos */
    #historia .flex-row img {
        width: 92% !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        order: -1 !important;
        /* Animación vertical (no genera overflow horizontal) */
        transform: translateY(80px) !important;
        opacity: 0 !important;
        transition: opacity 1.2s ease, transform 0.6s ease !important;
    }
    #historia .flex-row img.visible {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    /* Párrafos: ancho completo, sin márgenes laterales fijos */
    #historia .flex-row p {
        width: 92% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        font-size: 16px !important;
        order: 0 !important;
        /* Animación vertical (no genera overflow horizontal) */
        transform: translateX(80px) !important;
        opacity: 0 !important;
        transition: opacity 1.2s ease, transform 0.6s ease !important;
    }
    #historia .flex-row p.visible {
        transform: translateX(0) !important;
        opacity: 1 !important;
    }

    /* --- FOOTER --- */
    footer > div {
        height: auto !important;
        padding: 24px 16px !important;
        box-sizing: border-box !important;
    }
    .footer {
        flex-direction: column !important;
        align-items: center !important;
        gap: 24px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    .logo-wrapper {
        margin-right: 0 !important;
        margin-left: 0 !important;
        justify-content: center !important;
        height: auto !important;
    }
}
