/* ==========================================================================
   Correcciones responsive SIPSO
   Se carga después de main.css para ajustar el sitio en móvil/tablet.
   ========================================================================== */

/* Evita el scroll horizontal por elementos que se desbordan */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ninguna imagen debe desbordar su contenedor */
img {
    max-width: 100%;
}

/* -------- Botón "Volver arriba": alineado y por encima del de WhatsApp --- */
/* WhatsApp: right 15px + 72px de ancho => centro a 51px del borde derecho; alto hasta 87px.
   Volver arriba (44px): right 29px => centro también a 51px; se muestra a 100px (~13px de separación). */
.back-to-top-wrapper { right: 29px; }
.back-to-top-wrapper.back-to-top-btn-show { bottom: 100px; }
@media (max-width: 575px) {
    .back-to-top-wrapper { right: 29px; bottom: 40px; }
}

/* ---------------- Submenú "Servicios" (dropdown de escritorio) ---------- */
/* Ancho según contenido y cada ítem en una sola línea (sin salto). */
.tp-main-menu ul li .submenu {
    width: auto;
    min-width: 220px;
    white-space: nowrap;
}
.tp-main-menu ul li .submenu li a {
    white-space: nowrap;
}

/* --------------------------- Logo del header móvil ---------------------- */
.sipso-logo-mobile {
    height: 46px;
    width: auto;
    object-fit: contain;
}
@media (max-width: 575px) {
    .sipso-logo-mobile {
        height: 38px;
    }
}

/* Barra superior del header en móvil: alineación y aire */
@media (max-width: 1199px) {
    .tp-header-wrapper-3 {
        padding: 10px 0;
    }
    .tp-main-menu.home-3 {
        min-height: 56px;
    }
    /* Botón hamburguesa centrado verticalmente */
    .tp-header-main-right-hamburger-btn .hamburger-btn {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
    }
}

/* Header sticky: logo proporcional en móvil */
@media (max-width: 767px) {
    #header-sticky .tp-header-logo-2 img {
        height: 44px !important;
    }
}

/* ------------------------------- Hero (home) ---------------------------- */
@media (max-width: 1199px) {
    /* La imagen del dashboard pasa a fluir bajo el texto, sin recortes */
    .tp-hero-area-3 .tp-hero-thumb-main-3 {
        position: static !important;
        width: 100% !important;
        padding: 0 !important;
        margin-top: 40px;
        justify-content: center !important;
    }
    .tp-hero-area-3 .tp-hero-thumb-3 {
        justify-content: center !important;
    }
    .tp-hero-area-3 .tp-hero-thumb-main-3 img.sipso-hero-dashboard {
        margin-right: 0 !important;
        max-width: 560px;
        width: 100%;
    }
    .tp-hero-hight-3 {
        height: auto !important;
        padding-bottom: 60px;
    }
    .tp-hero-area-3 .col-lg-7 {
        width: 100%;
    }
}

@media (max-width: 575px) {
    /* Botones del hero: ocupan el ancho y se apilan cómodos */
    .sipso-hero-buttons {
        width: 100%;
    }
    .sipso-hero-buttons .sipso-hero-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
    /* Título del hero sin desbordes */
    .tp-hero-title-3 {
        word-break: break-word;
    }
}

/* ------------------------- Secciones "Qué es SIPSO" --------------------- */
@media (max-width: 767px) {
    /* Trazabilidad / Informes con QR: en columna para que no se aprieten */
    .tp-about-area-3 .tp-about-item-wrapper-3 {
        flex-wrap: wrap;
    }
    .tp-about-area-3 .tp-about-item-wrapper-3 .tp-about-item-3 {
        flex: 1 1 100%;
    }
}

/* ------------------------------ Tipografías ----------------------------- */
@media (max-width: 575px) {
    .tp-section-title {
        font-size: 30px !important;
        line-height: 1.2 !important;
    }
    /* Los <br> dentro de títulos rompen mal en móvil */
    .tp-section-title br,
    .sipso-contact-features-title br {
        display: none;
    }
}

/* --------------------------- Contenedores y grillas --------------------- */
@media (max-width: 575px) {
    .container,
    .container-fluid {
        padding-left: 18px;
        padding-right: 18px;
    }
    /* Tablas anchas (planes/servicios): permitir scroll interno */
    .tp-testimonial-slider-3,
    .adm-tabla-wrap {
        overflow-x: auto;
    }
}

/* ---------------------------- Flujo integral ---------------------------- */
@media (max-width: 767px) {
    .sipso-flow-card {
        border-radius: 14px;
    }
}

/* --------- Contador flotante "85% Trazabilidad" (sección Credibilidad) --- */
@media (max-width: 991px) {
    /* Deja de flotar y fluye bajo la imagen, centrado: evita que se monte
       sobre la sección de "Evaluaciones" que está encima. */
    .tp-support-count {
        position: static !important;
        display: inline-block;
        margin: 26px auto 0 !important;
        left: auto !important;
        bottom: auto !important;
    }
    .tp-support-thumb {
        flex-wrap: wrap;
        margin-bottom: 40px;
    }
}

/* ------------------- Sección de contacto ("Solicita una demo") ---------- */
@media (max-width: 991px) {
    /* El formulario deja de tener el sangrado pensado para escritorio */
    .tp-contact-wrapper-2 {
        padding-left: 0 !important;
    }
    /* Separación entre la columna de datos y el formulario al apilarse */
    .tp-contact-box-2 .col-lg-5 {
        margin-bottom: 34px;
    }
    /* Título y textos alineados a la izquierda de forma consistente */
    .tp-contact-wrapper-2 .tp-section-title,
    .tp-contact-wrapper-2 .tp-section-title-pre {
        text-align: left;
    }
    /* Los items de contacto ocupan todo el ancho, sin quedar centrados a medias */
    .tp-contact-breadcrumb-item {
        width: 100%;
    }
    /* El botón ENVIAR a ancho completo para acompañar los campos */
    .tp-contact-wrapper-2 .tp-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 767px) {
    /* La caja reduce su padding: evitamos que el contenido toque los bordes */
    .tp-contact-box-2 {
        padding: 28px 20px !important;
    }
    .tp-contact-wrapper-2 .tp-section-title {
        font-size: 26px !important;
        line-height: 1.25 !important;
    }
    /* Íconos de los datos de contacto: tamaño y alineación uniformes */
    .tp-contact-breadcrumb-item {
        align-items: flex-start;
    }
}
