/* =========================================================
   CASLA - AJUSTES FINALES RESPONSIVOS
   Hoja cargada después de los estilos de cada página pública.
   No modifica la estructura ni las funciones PHP.
========================================================= */

html {
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    max-width: 100%;
    overflow-x: clip;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    body {
        font-size: 15px;
        line-height: 1.55;
    }

    main,
    section,
    article,
    .container,
    .row,
    [class*="-contenedor"],
    [class*="-pagina"] {
        min-width: 0;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        max-width: 100%;
        overflow-wrap: break-word;
        hyphens: auto;
        text-wrap: pretty;
    }

    h1 {
        font-size: clamp(1.55rem, 6vw, 2.15rem);
        line-height: 1.18;
    }

    h2 {
        font-size: clamp(1.2rem, 4.8vw, 1.65rem);
        line-height: 1.25;
    }

    p {
        overflow-wrap: break-word;
    }

    .hero-titulo {
        font-size: clamp(2rem, 9vw, 2.8rem);
        line-height: 1.08;
    }

    .hero-subtitulo {
        font-size: clamp(1.25rem, 5.5vw, 1.8rem);
        line-height: 1.25;
    }

    .productos-intro h1,
    .nosotros-titulo-seccion h1,
    .productos-titulo-seccion h1,
    .servicios-titulo h1,
    .contacto-header h1,
    .contacto-titulo-seccion h1,
    .cotizacion-titulo-seccion h1,
    .carrito-contenedor h1,
    .carrito-contenedor h2,
    .pedidos-encabezado-texto h1 {
        font-size: clamp(1.55rem, 6vw, 2.1rem);
        line-height: 1.2;
    }

    .row {
        --bs-gutter-x: 1.15rem;
    }

    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    input,
    select,
    textarea,
    button,
    .form-control,
    .form-select {
        max-width: 100%;
    }

    .btn,
    .btn-casla,
    .btn-casla-secundario {
        min-height: 44px;
    }

    .whatsapp-float {
        width: 52px;
        height: 52px;
        right: 15px;
        bottom: 15px;
        font-size: 27px;
    }
}

@media (max-width: 420px) {
    .hero-contenido,
    .productos-intro,
    .nosotros-titulo-seccion,
    .servicios-titulo,
    .contacto-header,
    .contacto-titulo-seccion,
    .cotizacion-titulo-seccion {
        min-width: 0;
    }

    .hero-titulo {
        font-size: clamp(1.85rem, 9vw, 2.35rem);
    }

    .whatsapp-float {
        width: 48px;
        height: 48px;
        right: 12px;
        bottom: 12px;
        font-size: 25px;
    }
}




/* =========================================================
   CASLA - CORRECCIÓN DE BOTONES DEL PERFIL EN MÓVILES
========================================================= */

@media screen and (max-width: 768px) {

    .perfil-contenedor .perfil-pie-acciones {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        width: 100% !important;
        margin: 20px 0 25px !important;
        padding: 16px !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08) !important;
        box-sizing: border-box !important;
    }

    .perfil-contenedor .perfil-acciones-principales {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 11px !important;
        width: 100% !important;
    }

    .perfil-contenedor .perfil-pie-acciones .btn-perfil-accion {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 12px 16px !important;
        border-radius: 9px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-align: center !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
    }

    .perfil-contenedor .perfil-pie-acciones .btn-editar-perfil {
        color: #ffffff !important;
        background: #0d5bd7 !important;
        border: 1px solid #0d5bd7 !important;
    }

    .perfil-contenedor .perfil-pie-acciones .btn-volver-inicio {
        color: #174a8b !important;
        background: #eff6ff !important;
        border: 1px solid #bfdbfe !important;
    }

    .perfil-contenedor .perfil-cerrar-sesion {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding-top: 13px !important;
        border-top: 1px solid #e2e8f0 !important;
        box-sizing: border-box !important;
    }

    .perfil-contenedor .perfil-cerrar-sesion a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 12px 16px !important;
        color: #b42318 !important;
        background: #fff1f0 !important;
        border: 1px solid #fecaca !important;
        border-radius: 9px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        text-align: center !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
    }

    .perfil-contenedor .perfil-pie-acciones a i {
        display: inline-block !important;
        font-size: 15px !important;
    }

}

