/* ESTILOS GLOBALES - ARQUITECTURA FULL SCREEN Y FONDO LOGIN NEXUS */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: radial-gradient(ellipse at 50% 30%, #4a9fd4 0%, #1a6aaa 40%, #0d3d6b 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(255,255,255,0.015) 40px,
        rgba(255,255,255,0.015) 80px
    );
    pointer-events: none;
    z-index: 0;
}

.outer-container {
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
    bottom: 25px;
    box-sizing: border-box;
    z-index: 1;
}

.app-window {
    background-color: #FFFFFF;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid #759DCB;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 1. BARRA DE TÍTULO Y CONTROLES DE VENTANA */
.title-bar {
    background: linear-gradient(to bottom, #E4F1FD 0%, #C4E1FC 100%);
    padding: 6px 10px 6px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #A9C6E2;
    flex-shrink: 0;
}

.title-bar-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.office-orb-container {
    margin-right: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-top: -2px; 
}

.office-orb-img {
    width: 32px; 
    height: 32px;
    transition: transform 0.1s;
}

.office-orb-img:active {
    transform: scale(0.95);
}

.title-text {
    color: #1E395B;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 0px #FFFFFF;
}

.window-controls {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.control-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #1E395B;
    width: 28px;
    height: 22px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    padding: 0;
    outline: none;
    line-height: 1;
}

.btn-max:hover {
    background-color: #D3E6F8;
    border-color: #9CAEC0;
}

.btn-close:hover {
    background-color: #E81123;
    color: #FFFFFF;
    border-color: #E81123;
}

/* 2. PESTAÑAS RIBBON */
.ribbon-tabs-container {
    background-color: #C4E1FC;
    padding: 4px 10px 0 10px;
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    border-bottom: 1px solid #9CAEC0;
}

.ribbon-tab {
    padding: 4px 18px;
    font-size: 12px;
    color: #1E395B;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: -1px;
    z-index: 1;
}

.ribbon-tab:hover {
    background: linear-gradient(to bottom, #FAFCFD 0%, #EAF3FC 100%);
    border-color: #9CAEC0;
}

.ribbon-tab.active {
    background: #FAFCFD;
    border-color: #9CAEC0;
    font-weight: bold;
    z-index: 10;
}

/* 3. CUERPO RIBBON (Contenedor Master) */
.ribbon-body {
    background: linear-gradient(to bottom, #FAFCFD 0%, #E6F0FA 40%, #D3E6F8 45%, #EAF3FC 100%);
    border-bottom: 1px solid #869FB7;
    padding: 5px;
    height: 95px;
    display: block; 
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.ribbon-body-content {
    height: 100%;
    display: none; 
    flex-direction: row;
}

.ribbon-body-content.active {
    display: flex;
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid #9CAEC0;
    padding: 0 10px;
    position: relative;
}

.ribbon-group-label {
    position: absolute;
    bottom: 2px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    color: #627C97;
    left: 0;
}

.office-button {
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: background 0.15s ease-in-out, border-color 0.15s ease-in-out;
    cursor: pointer;
    color: #1E395B;
}

.office-button:hover {
    background: linear-gradient(to bottom, #FFFBF0 0%, #FFEDC2 100%);
    border-color: #F7C684;
    box-shadow: inset 0 1px 0 #FFFFFF;
}

.button-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
}

.icon-large { font-size: 28px; margin-bottom: 2px; }
.text-large { font-size: 11px; text-align: center; }

.button-small {
    display: flex;
    align-items: center;
    padding: 2px 5px;
}

.icon-small { font-size: 14px; margin-right: 5px; }
.text-small { font-size: 11px; }

/* 4. WORKSPACE MULTI-VISTA */
.workspace-container {
    flex-grow: 1;
    position: relative;
    background-color: #F3F8FD;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    overflow-y: auto;
}

.workspace {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px;
    min-height: 100%;
    box-sizing: border-box;
}

.workspace.active {
    display: flex;
}

#ws-inicio { justify-content: center; padding-top: 30px; }

.main-logo {
    color: #1E395B;
    font-size: 42px;
    font-weight: normal;
    margin: 0;
    text-shadow: 1px 1px 0px #FFFFFF;
}

.welcome-text {
    color: #4A6E9B;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0 25px 0;
}

/* ESTILOS CARRUSEL HERO INICIO */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    background-color: #E4F1FD;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

/* DATA CARDS Y TABLAS */
.data-card {
    background: #FFFFFF;
    border: 1px solid #A9C6E2;
    border-radius: 6px;
    padding: 25px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.data-card-wide {
    max-width: 1000px;
    width: 95%;
}

/* TOURS INTERACTIVOS (pestaña Tour) — acordeón agrupado por área, mismo
   agrupamiento Y MISMO COMPORTAMIENTO de expandir/contraer que la sidebar real
   de Nexus (Ventas, Stock, Proveedores, Caja, Configuración → Archivos/Procesos/
   Reportes → sub-grupos). Cada nivel arranca contraído y se expande de forma
   independiente — mecanismo calcado de .nx-toggle/.nx-collapse/.nx-open de
   main.php + sidebar.php, ver ese archivo si hace falta comparar. */

.tour-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Botón disparador de cualquier nivel (grupo, sección o sub-sección) — reset
   de botón nativo + fila con el caret empujado al final */
.tour-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.tour-toggle-text { flex: 1; }
.tour-caret {
    display: inline-block;
    flex-shrink: 0;
    font-size: 11px;
    transition: transform 0.2s ease;
    transform: rotate(0deg);
    color: inherit;
    opacity: 0.7;
}
.tour-toggle.tour-open .tour-caret { transform: rotate(90deg); }

/* Contenido de cualquier nivel — oculto hasta que se expande su propio toggle,
   cada uno independiente (no se cierran los hermanos al abrir uno) */
.tour-collapse { display: none; margin-top: 10px; }
.tour-collapse.tour-open { display: block; }

/* Nivel 0 — módulo (VENTAS, STOCK, PROVEEDORES, CAJA, CONFIGURACIÓN) */
.tour-group-label {
    background: linear-gradient(to right, #eaf1fb, rgba(234,241,251,0));
    border-left: 4px solid #1b365d;
    border-radius: 0 4px 4px 0;
    padding: 9px 12px;
}
.tour-group-label .tour-toggle-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #1b365d;
}
.tour-group-icon { font-size: 14px; }

/* Nivel 1 — ARCHIVOS / PROCESOS / REPORTES (mismo rol que .grp-heading) */
.tour-section-label {
    padding: 6px 8px;
    border-radius: 3px;
    background: #f3f6fa;
}
.tour-section-label .tour-toggle-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #5a6f8c;
}

/* Nivel 2+ — sub-grupo anidado: Facturas, Remitos, Cuentas Corrientes,
   Ingresos/Egresos, Reportes Detallados, etc. (mismo rol que .sub-heading).
   El RÓTULO queda al mismo margen que sus hermanos (Ventas Rápidas, POS,
   Autoservicio...) — se distingue por el borde de acento, no por indentación,
   para que no parezca "hijo" del ítem anterior. Sólo su CONTENIDO (una vez
   expandido) se indenta, dejando claro que Alta/Consulta cuelgan de Facturas
   y no de lo que esté arriba. */
.tour-subsection-label {
    padding: 5px 8px 5px 10px;
    border-left: 3px solid #9fb3d1;
    background: #f7f9fc;
    border-radius: 0 3px 3px 0;
}
.tour-subsection-label .tour-toggle-text {
    font-size: 11.5px;
    font-weight: 700;
    color: #7185ab;
}
.tour-subsection > .tour-collapse {
    margin-left: 18px;
    padding-left: 12px;
    border-left: 2px solid #dfe6f0;
}

.tour-item {
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tour-item-hd {
    width: 100%;
    text-align: left;
    background: linear-gradient(to bottom, #f7f9fa, #e9ecef);
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: bold;
    color: #1b365d;
    outline: none;
    transition: background 0.2s ease;
    font-family: inherit;
}
.tour-item-hd.is-open {
    background: linear-gradient(to bottom, #e9ecef, #dfe4ea);
}
.tour-item-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}
.tour-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
    background-color: #ffffff;
}
.tour-item-inner {
    padding: 16px 18px 18px;
    border-top: 1px solid #e0e0e0;
}
.tour-item-summary {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
    margin: 0 0 14px 0;
}
.tour-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to bottom, #2a4a7a, #1b365d);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    padding: 9px 18px;
    border-radius: 4px;
    transition: box-shadow 0.15s, transform 0.1s;
}
.tour-item-btn:hover {
    box-shadow: 0 4px 12px rgba(27,54,93,0.35);
    transform: translateY(-1px);
}
.tour-item-btn .arrow { transition: transform 0.15s; }
.tour-item-btn:hover .arrow { transform: translateX(3px); }

/* ══════════════════════════════════════════════════════════════
   MODAL DE TOURS — ventana Office2007 (celeste + naranja, misma
   identidad que .app-window/.title-bar de la ventana principal)
   que aloja el tour elegido en un iframe, sin salir del micrositio.
   El naranja de acento no hace falta reinventarlo acá: cada tour
   ya lo trae adentro (--accent de tour-shared.css) — el chrome del
   modal sólo pone el celeste + el orb con el mismo hover naranja
   que usa el botón de Inicio de la ventana real.
══════════════════════════════════════════════════════════════ */
.tour-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(10, 20, 35, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
    box-sizing: border-box;
}
.tour-modal-overlay.active { display: flex; opacity: 1; }

.tour-modal-window {
    width: min(94vw, 1320px);
    height: min(90vh, 840px);
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid #759DCB;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.97);
    transition: transform 0.2s ease;
}
.tour-modal-overlay.active .tour-modal-window { transform: scale(1); }

.tour-modal-titlebar { flex-shrink: 0; }
.tour-modal-titlebar .office-orb-container { cursor: default; margin-top: 0; }
.tour-modal-titlebar .office-orb-img { width: 22px; height: 22px; }
.tour-modal-titlebar .title-text { font-size: 12.5px; }

.tour-modal-body {
    position: relative;
    flex: 1;
    min-height: 0;
    background-color: #F3F8FD;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* El wrapper mide exactamente el resultado YA escalado (JS lo dimensiona);
   el iframe adentro mantiene su tamaño "natural" y se encoge con
   transform:scale — así el tour entra completo sin scroll sea cual sea
   la altura fija de .appviewport que use ese tour puntual.
   Arranca invisible: hasta que fitTourIframe() mide el contenido real y
   confirma que entra (con o sin escala), no se muestra nada — evitar que
   el usuario vea el estado "a medio ajustar" (sin escalar todavía, con
   scroll) fue el motivo de esta ronda de fixes. */
.tour-modal-iframe-wrap {
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.tour-modal-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    border: none;
    display: block;
}

.tour-modal-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tour-modal-spinner-ring {
    width: 34px;
    height: 34px;
    border: 3px solid #C4E1FC;
    border-top-color: #d98a1e;
    border-radius: 50%;
    animation: tourModalSpin 0.7s linear infinite;
}
@keyframes tourModalSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
    .tour-modal-overlay { padding: 0; }
    .tour-modal-window { width: 100vw; height: 100vh; border-radius: 0; }
}

.data-title {
    color: #1A1A1A;
    font-size: 24px;
    border-bottom: 2px solid #D4AF37;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.feature-list li {
    margin-bottom: 12px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.feature-list li:last-child {
    border-bottom: none;
}

/* GRILLA DE PRECIOS INTERACTIVA */
.pricing-grid {
    display: flex;
    gap: 30px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    margin-top: 20px;
    flex-wrap: wrap;
}

.price-card {
    background: #F8F9FA;
    border: 1px solid #CCC;
    border-radius: 8px;
    padding: 30px 25px;
    flex: 1;
    min-width: 280px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
    border-color: #759DCB;
}

.price-card.highlight {
    border: 2px solid #D4AF37;
    background: #FFFCF5;
}

.price-card.highlight:hover {
    border-color: #D4AF37;
    box-shadow: 0 12px 25px rgba(212, 175, 55, 0.2);
}

.badge-popular {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #D4AF37;
    color: #1A1A1A;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
}

.price-tag {
    font-size: 34px;
    font-weight: bold;
    margin: 10px 0 15px 0;
}

/* ESTILOS GALERÍA DE IMÁGENES */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin-top: 20px;
}

.gallery-item {
    flex: 1 1 300px;
    max-width: 400px;
    border-radius: 6px;
    border: 1px solid #A9C6E2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    background-color: #FFF;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-color: #759DCB;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* LIGHTBOX NATIVO */
#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 20, 35, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 2px solid #759DCB;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFF;
    font-size: 40px;
    cursor: pointer;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: color 0.2s;
}

.lightbox-close:hover { color: #D4AF37; }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #FFF;
    font-size: 60px;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: color 0.2s, transform 0.2s;
}

.lightbox-nav:hover { color: #D4AF37; }
.lightbox-nav:active { transform: translateY(-50%) scale(0.9); }

#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

/* 5. BARRA DE ESTADO */
.status-bar {
    background: linear-gradient(to bottom, #E4F1FD 0%, #C4E1FC 100%);
    border-top: 1px solid #869FB7;
    padding: 4px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #4A6E9B;
    flex-shrink: 0;
}

/* MEDIA QUERIES - RESPONSIVIDAD DEL RIBBON */
@media (max-width: 700px) {
    .outer-container {
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .app-window { border-radius: 0; border: none; }
    .ribbon-body {
        height: auto;
        padding-bottom: 0;
    }
    .ribbon-body-content {
        flex-wrap: wrap;
    }
    .ribbon-group {
        border-right: none;
        border-bottom: 1px solid #9CAEC0;
        width: 100%;
        padding-bottom: 25px;
        margin-bottom: 5px;
    }
    .ribbon-group:last-child {
        border-bottom: none;
        padding-bottom: 15px;
        margin-bottom: 0;
    }
    
    #ribbon-inicio .ribbon-group > div {
        justify-content: flex-start;
        padding-left: 15px;
    }
    
    #ribbon-info .ribbon-group > div,
    #ribbon-galeria .ribbon-group > div,
    #ribbon-precios .ribbon-group > div {
        justify-content: center;
    }

    .pricing-grid {
        flex-direction: column;
    }
    
    .hero-carousel {
        height: 250px;
    }
}