
/* =========================================================
   LCG responsive-perfect.css
   Ajustes SOLO responsive/adaptabilidad.
   No modifica logica, contenido, colores comerciales ni datos.
   ========================================================= */

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

body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

*, *::before, *::after {
    min-width: 0;
}

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

img {
    height: auto;
}

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

iframe {
    display: block;
}

.contenedor,
.container,
.main-content,
.login-shell,
.panel,
.card,
.table-container,
.modal,
.modal-box,
.modal-contenido,
.form-container,
.logo-container,
.tabs,
.tab-content {
    min-width: 0;
}

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

/* Boton sandwich generico para landings/portafolio cuando exista */
.lc-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(36, 80, 219, 0.14);
    background: #ffffff;
    color: var(--primary, #2450db);
    cursor: pointer;
    flex: 0 0 auto;
    box-shadow: 0 10px 22px rgba(15, 23, 40, 0.06);
}

.lc-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.header-inner.lc-menu-open .lc-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-inner.lc-menu-open .lc-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.header-inner.lc-menu-open .lc-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Desktop intermedio */
@media (max-width: 1400px) {
    .contenedor { padding-left: 24px; padding-right: 24px; }
    .main-content { padding: 26px; }
    .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .feature-grid, .smart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    .main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .sidebar {
        max-width: min(292px, calc(100vw - 32px));
    }

    .login-shell {
        width: min(100%, calc(100vw - 28px)) !important;
    }

    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablets y mobile horizontal */
@media (max-width: 1024px) {
    body {
        overflow-x: hidden !important;
    }

    .main-content {
        padding: 20px !important;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        width: auto;
        max-width: 100%;
        position: sticky;
        top: max(8px, env(safe-area-inset-top));
        z-index: 120;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-105%);
        transition: transform .25s ease;
    }

    .sidebar.active {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop.active {
        display: block !important;
        position: fixed;
        inset: 0;
        z-index: 95;
    }

    .modal-overlay.active,
    .modal.activo,
    .modal-overlay.ticket-fullscreen.active {
        align-items: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal,
    .modal-box,
    .modal-contenido {
        width: min(100%, calc(100vw - 24px)) !important;
        max-width: min(100%, calc(100vw - 24px)) !important;
    }

    .modal-frame-wrap,
    .modal-body,
    .modal-iframe {
        min-height: 0;
    }

    .hero-panel {
        min-height: auto !important;
    }

    .hero-main,
    .panel-header,
    .cards-wrap,
    .feature-header,
    .feature-grid,
    .smart-grid,
    .cta-main,
    .cta-side {
        padding-left: 26px !important;
        padding-right: 26px !important;
    }
}

/* Mobile */
@media (max-width: 860px) {
    .contenedor {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .header-inner {
        min-height: auto !important;
    }

    .header .header-inner {
        position: relative;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        flex-wrap: wrap;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .header .brand-link {
        width: auto !important;
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand,
    .brand-link {
        min-width: 0;
    }

    .brand-texto {
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: normal !important;
        line-height: 1.05 !important;
    }

    .brand-logo-wrap,
    .brand-icon {
        flex: 0 0 auto;
    }

    .lc-menu-toggle {
        display: inline-flex;
    }

    .header .nav {
        display: none;
        width: 100% !important;
        flex: 1 0 100%;
        order: 5;
        flex-direction: column;
        align-items: stretch;
        gap: 10px !important;
        padding-top: 4px;
    }

    .header-inner.lc-menu-open .nav {
        display: flex !important;
    }

    .header .nav a,
    .header .nav button,
    .header .nav .btn-principal,
    .header .nav .btn-secundario,
    .header .nav .nav-link {
        width: 100% !important;
        justify-content: center !important;
        text-align: center;
        min-width: 0 !important;
    }

    .hero {
        padding-top: 14px !important;
        padding-bottom: 18px !important;
    }

    .hero-main,
    .panel-header,
    .cards-wrap,
    .feature-header,
    .feature-grid,
    .smart-grid,
    .cta-main,
    .cta-side,
    .contacto-body,
    .tools-body {
        padding: 20px !important;
    }

    .hero-main h1,
    .panel-header h2,
    .feature-header h2,
    .cta-main h2 {
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .hero-botones,
    .contacto-acciones,
    .modal-actions,
    .header-actions {
        width: 100%;
        align-items: stretch;
    }

    .hero-botones > *,
    .contacto-acciones > *,
    .modal-actions > *,
    .header-actions > *,
    .btn-principal,
    .btn-secundario,
    .btn-demo,
    .btn-contacto,
    .btn-module,
    .modal-link,
    .modal-close {
        max-width: 100%;
    }

    .cards-grid,
    .feature-grid,
    .smart-grid,
    .tools-grid,
    .form-grid,
    .cta-grid {
        grid-template-columns: 1fr !important;
    }

    .card-sector h3,
    .card-producto h3 {
        min-height: 0 !important;
    }

    .card-footer,
    .card-acciones,
    .inline-form,
    .status-actions {
        align-items: stretch !important;
    }

    .card-footer {
        flex-direction: column !important;
    }

    .inline-form,
    .status-actions {
        flex-direction: column;
        width: 100%;
    }

    .inline-form select,
    .inline-form button,
    .status-actions button,
    .actions-stack,
    .actions-stack form,
    .actions-stack select {
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-header {
        align-items: stretch !important;
    }

    .search-box {
        min-width: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

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

    th,
    td {
        white-space: nowrap;
    }

    .descripcion-ticket,
    .titulo-ticket {
        max-width: 260px;
    }

    .modal-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .modal-frame-wrap {
        height: min(72dvh, 680px) !important;
    }

    .modal-contenido {
        height: min(88dvh, 760px) !important;
        max-height: calc(100dvh - 24px) !important;
    }

    .contacto-fijo {
        right: max(14px, env(safe-area-inset-right)) !important;
        bottom: max(74px, env(safe-area-inset-bottom)) !important;
    }

    body:has(.modal-overlay.active),
    body:has(.modal.activo) {
        overflow: hidden;
    }
}

@media (max-width: 680px) {
    .main-content {
        padding: 14px !important;
    }

    .header,
    .kpi-card,
    .table-container,
    .panel,
    .feature-panel,
    .smart-panel,
    .cta-panel,
    .hero-panel,
    .card,
    .cardx,
    .form-container,
    .tab-content,
    .tabs {
        border-radius: 18px !important;
    }

    .header {
        padding: 18px !important;
        margin-bottom: 18px !important;
    }

    .header-title h1 {
        line-height: 1 !important;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .kpi-card {
        padding: 16px !important;
        min-height: 112px !important;
    }

    .kpi-card .value {
        font-size: clamp(26px, 9vw, 34px) !important;
    }

    .table-header {
        padding: 16px !important;
    }

    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-warning,
    .btn-danger,
    .btn-info,
    input[type="submit"] {
        min-height: 44px;
        justify-content: center;
    }

    select,
    input,
    textarea {
        font-size: 16px !important;
    }

    body:has(.login-shell) {
        display: block !important;
        overflow-y: auto !important;
        padding: 12px !important;
    }

    .login-shell {
        display: block !important;
        min-height: auto !important;
        border-radius: 24px !important;
    }

    .visual-panel,
    .login-panel,
    .form-panel {
        min-height: auto !important;
        padding: 24px !important;
    }

    .visual-panel {
        display: none !important;
    }

    .tab-button {
        float: none !important;
        display: block;
        width: 100%;
        margin: 0 0 8px 0 !important;
    }

    .logo-container {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 480px) {
    .contenedor {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .main-content {
        padding: 10px !important;
    }

    .hero-main,
    .panel-header,
    .cards-wrap,
    .feature-header,
    .feature-grid,
    .smart-grid,
    .cta-main,
    .cta-side,
    .card-body,
    .smart-body,
    .feature-card,
    .contacto-body,
    .tools-body,
    .card,
    .cardx,
    .form-container,
    .tab-content {
        padding: 16px !important;
    }

    .pill,
    .saas-chip,
    .sector-tag,
    .smart-badge {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .brand-logo-wrap,
    .brand-icon {
        width: 44px !important;
        height: 44px !important;
        border-radius: 14px !important;
    }

    .brand-texto {
        font-size: clamp(17px, 6vw, 22px) !important;
    }

    .hero-main h1 {
        font-size: clamp(30px, 10vw, 38px) !important;
        letter-spacing: -1px !important;
        line-height: 1.03 !important;
    }

    .panel-header h2,
    .feature-header h2,
    .cta-main h2 {
        font-size: clamp(26px, 8.4vw, 34px) !important;
        letter-spacing: -.8px !important;
    }

    .hero-subtitulo,
    .hero-contexto,
    .panel-header p,
    .feature-header p,
    .cta-main p,
    .smart-body p,
    .feature-card p {
        font-size: 15.5px !important;
    }

    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-overlay.active,
    .modal.activo {
        padding: 8px !important;
    }

    .modal,
    .modal-box,
    .modal-contenido {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        border-radius: 16px !important;
    }

    .modal-frame-wrap {
        height: 70dvh !important;
    }

    .modal-contenido {
        height: calc(100dvh - 16px) !important;
    }

    .toast-container {
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
    }

    .toast {
        max-width: none !important;
        width: 100% !important;
    }
}

@media (max-width: 360px) {
    .contenedor,
    .main-content {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .header,
    .hero-main,
    .panel-header,
    .cards-wrap,
    .feature-header,
    .feature-grid,
    .smart-grid,
    .cta-main,
    .cta-side,
    .card-body,
    .smart-body,
    .feature-card,
    .card,
    .cardx,
    .form-container {
        padding: 14px !important;
    }

    .lc-menu-toggle {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .btn,
    .btn-principal,
    .btn-secundario,
    .btn-demo,
    .btn-contacto,
    .btn-module,
    .btn-preview,
    .modal-link,
    .modal-close {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* Dispositivos bajos: evita formularios/modales cortados */
@media (max-height: 720px) {
    body {
        overflow-y: auto;
    }

    .modal-overlay.active,
    .modal.activo {
        align-items: flex-start !important;
        overflow-y: auto !important;
    }

    .modal,
    .modal-box,
    .modal-contenido {
        max-height: calc(100dvh - 16px) !important;
    }

    .modal-frame-wrap,
    .modal-body {
        height: calc(100dvh - 86px) !important;
    }
}
