/**
 * ============================================================================
 * ARCHIVO: style.css (ENTERPRISE LOGISTICS ENGINE v8.6.0 - CORE DEFINITIVO)
 * PROYECTO: Refrigerados García OS | Centro de Control Logístico y Web Pública
 * ARQUITECTURA: Sinapse OS Headless Blueprint (Vanilla JS)
 * VERSION: 8.6.0 (Build 2024 - Stable Release)
 * ============================================================================
 * NOTA TÉCNICA:
 * Este archivo implementa un sistema de "Auto-Layout Flow".
 * Soluciona problemas de colapso de secciones dinámicas y restaura el
 * motor de edición visual (Live Editor) con tecnología de traspaso de clics.
 * ============================================================================
 */

/* ==========================================
   1. SISTEMA DE VARIABLES MAESTRAS (Design System)
   ========================================== */
   :root {
    /* --- Identidad Corporativa (Industrial Luxury) --- */
    --kori-primary: #002147;       /* Navy Profundo (Autoridad) */
    --kori-secondary: #FFBF00;     /* Ámbar Gold (Energía/Precisión) */
    --kori-accent: #00ccaa;        /* Cyan Tecnológico (Éxito/Sistemas) */
    --kori-success: #10b981;
    --kori-warning: #f59e0b;
    --kori-error: #ef4444;
    --kori-info: #3b82f6;

    /* --- Superficies y Fondos --- */
    --rg-bg-base: #f1f5f9;         /* Slate 100 */
    --rg-bg-alt: #ffffff;
    --rg-bg-dark: #020f24;         /* Navy Ultra Oscuro */
    --rg-bg-dark-elevated: #0a192f;
    --rg-surface: #ffffff;
    --rg-surface-glass: rgba(255, 255, 255, 0.95);
    --rg-border: #e2e8f0;

    /* --- Tipografía (Escala Áurea) --- */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* --- Paleta de Textos --- */
    --text-main: #0f172a;          /* Slate 900 */
    --text-muted: #64748b;         /* Slate 500 */
    --text-light: #f8fafc;         /* Slate 50 */
    --text-on-dark: #e2e8f0;       /* Slate 200 */

    /* --- Geometría y Layout (Métricas de Ingeniería) --- */
    --nav-height: 90px;
    --nav-height-mobile: 75px;
    --bottom-nav-height: 70px;
    --section-padding-y: 120px;
    --section-padding-x: 8%;

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 30px;
    --radius-pill: 500px;

    /* --- Sombras y Efectos (Profundidad) --- */
    --shadow-sm: 0 2px 10px rgba(0, 33, 71, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 33, 71, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 33, 71, 0.12);
    --shadow-heavy: 0 30px 100px rgba(0, 0, 0, 0.4);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* --- Transiciones --- */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Capas (Z-Index) --- */
    --z-base: 1;
    --z-elevated: 10;
    --z-sticky: 100;
    --z-nav: 5000;
    --z-overlay: 9000;
    --z-modal: 10000;
    --z-toast: 15000;
    --z-editor: 20000;
}

/* ==========================================
   2. RESET INDUSTRIAL Y NORMALIZACIÓN
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: -webkit-fill-available;
}

body {
    font-family: var(--font-body);
    background-color: var(--rg-bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Corporativa */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--rg-bg-base);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border: 3px solid var(--rg-bg-base);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--kori-primary);
}

/* Tipografía Base */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--kori-primary);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-base);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: var(--transition-base);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================
   3. SISTEMA DE LAYOUT "FLOW ENGINE"
   ========================================== */

/* Contenedor Principal de Renderizado Dinámico */
#dynamic-page-render {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    z-index: var(--z-base);
    /* Previene el amontonamiento de secciones inyectadas */
}

/* Regla Maestra de Secciones (Soluciona el amontonamiento) */
#dynamic-page-render > section,
#dynamic-page-render > div {
    position: relative;
    width: 100%;
    clear: both;
    padding: var(--section-padding-y) var(--section-padding-x) !important;
    background-color: var(--rg-bg-alt);
    overflow: clip;
}

/* Alternancia de Fondos para Profundidad Visual */
#dynamic-page-render > section:nth-child(even) {
    background-color: var(--rg-bg-base);
}

/* La primera sección después del Nav requiere un ajuste de espacio */
#dynamic-page-render > section:first-child,
#dynamic-page-render > .hero-cinematic:first-child {
    padding-top: calc(var(--section-padding-y) + var(--nav-height)) !important;
}

/* Ajuste específico para HERO (Donde el amontonamiento es más crítico) */
.hero-cinematic {
    min-height: 95vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 var(--section-padding-x) !important;
    color: white !important;
    background-color: var(--rg-bg-dark) !important;
}

/* ==========================================
   4. NAVEGACIÓN SUPERIOR (DESKTOP NAV)
   ========================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: #fff;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    z-index: var(--z-nav);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-container-inner,
.brand-wrapper,
.desktop-menu,
.auth-container {
    min-width: 0;
}

.mobile-menu-trigger {
    display: none;
}

.brand-logo {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text-main {
    font-size: clamp(0.95rem, 1.35vw, 1.2rem);
    font-weight: 900;
    color: var(--kori-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.brand-text-sub {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}

.desktop-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-btn {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
    position: relative;
    padding: 5px 0;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--kori-secondary);
    border-radius: var(--radius-xs);
    transition: var(--transition-base);
}

.nav-btn:hover {
    color: var(--kori-primary);
}

.nav-btn:hover::after,
.nav-btn.active::after {
    width: 100%;
}

.auth-container {
    padding-left: 2rem;
    border-left: 1px solid var(--rg-border);
    margin-left: 1rem;
}

.highlight-btn {
    background: var(--kori-secondary);
    color: var(--kori-primary) !important;
    padding: 10px 25px !important;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 15px rgba(255, 191, 0, 0.3);
}

.highlight-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 191, 0, 0.4);
}

/* ==========================================
   5. COMPONENTES: HERO CINEMATIC
   ========================================== */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 33, 71, 0.95) 0%, rgba(2, 15, 36, 0.6) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    text-align: center;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: clamp(2.15rem, 5vw, 4.2rem);
    color: white;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 2rem;
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-on-dark);
    margin-bottom: 3rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ==========================================
   6. COMPONENTES: SPLIT (IMAGE & TEXT)
   ========================================== */
.split-luxury {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.split-reverse {
    direction: rtl;
}

.split-reverse > * {
    direction: ltr;
}

.split-img-box {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-slow);
}

.split-img-box img {
    width: 100%;
    height: 100%;
    transition: var(--transition-slow);
}

.split-img-box:hover img {
    transform: scale(1.05);
}

.split-txt-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.split-txt-box h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.split-txt-box p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ==========================================
   7. COMPONENTES: GRIDS (SERVICIOS / CATALOGO)
   ========================================== */
.luxury-section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.catalog-filter-title {
    display: inline-block;
    margin-bottom: 0.65rem;
    color: var(--kori-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.6px;
    line-height: 1.2;
    text-transform: uppercase;
}

.catalog-filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1200px;
    margin: -2rem auto 2.2rem;
}

.catalog-filter {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--rg-border);
    border-radius: var(--radius-pill);
    background: var(--rg-surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
}

.catalog-filter:hover,
.catalog-filter.active {
    border-color: var(--kori-primary);
    background: var(--kori-primary);
    color: white;
}

.service-poster[hidden] {
    display: none;
}

.sales-cover {
    position: relative;
    min-height: clamp(240px, 32vw, 430px);
    display: flex;
    align-items: flex-end;
    max-width: 1400px;
    margin: calc(var(--section-padding-y) * -0.55) auto 4rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--rg-bg-dark);
    box-shadow: var(--shadow-lg);
}

.sales-cover img,
.sales-cover-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sales-cover img {
    object-fit: cover;
}

.sales-cover-overlay {
    background: linear-gradient(90deg, rgba(0, 33, 71, 0.92), rgba(0, 33, 71, 0.25));
}

.sales-cover-copy {
    position: relative;
    z-index: 1;
    max-width: 650px;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.sales-cover-copy h1 {
    margin: 0 0 0.75rem;
    color: white;
    font-size: clamp(1.8rem, 4vw, 3.6rem);
    line-height: 1.08;
}

.sales-cover-copy p {
    max-width: 560px;
    margin: 0;
    color: #e2e8f0;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
}

.luxury-section-header h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.grid-luxury-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    justify-content: start;
}

.service-poster {
    position: relative;
    height: 480px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--rg-bg-dark);
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.ecommerce-product-card,
.ecommerce-job-card {
    width: 100%;
    text-align: left;
    font: inherit;
}

.product-card-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--kori-secondary);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-slow);
}

.poster-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 33, 71, 0.9) 0%, rgba(0, 33, 71, 0.4) 50%, transparent 100%);
    z-index: 2;
    transition: var(--transition-base);
}

.poster-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    z-index: 3;
    color: white;
    transform: translateY(20px);
    transition: var(--transition-base);
}

.poster-category {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--kori-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    display: block;
}

.poster-content h3 {
    color: white;
    margin: 0;
    font-size: 1.5rem;
}

.service-poster:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.service-poster:hover img {
    transform: scale(1.1);
}

.service-poster:hover .poster-overlay {
    background: linear-gradient(to top, rgba(0, 33, 71, 1) 0%, rgba(0, 33, 71, 0.7) 100%);
}

.service-poster:hover .poster-content {
    transform: translateY(0);
}

/* ==========================================
   8. COMPONENTES: BOLSA DE TRABAJO (JOBS)
   ========================================== */
.job-card {
    background: var(--rg-surface);
    border: 1px solid var(--rg-border);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.job-card:hover {
    border-color: var(--kori-secondary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.ecommerce-job-card {
    min-height: 280px;
    cursor: pointer;
}

.job-card-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    overflow: hidden;
    color: var(--text-muted);
    line-height: 1.7;
}

.job-benefit-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--kori-primary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.product-detail,
.job-detail {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: stretch;
}

.product-detail-image,
.job-detail-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 320px;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-md);
    background: var(--rg-bg-dark);
}

.job-detail-image {
    position: relative;
    overflow: hidden;
    display: grid;
    background: linear-gradient(145deg, var(--kori-primary), #0b5269);
}

.job-detail-image img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    object-position: center;
}

.job-detail-image-label {
    position: absolute;
    inset: auto 16px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 33, 71, 0.82);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
}

.product-detail-copy,
.job-detail-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.product-detail-copy h2,
.job-detail-copy h2 {
    margin: 8px 0 12px;
}

.product-detail-copy p,
.job-description {
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0 0 22px;
}

.product-price {
    color: var(--kori-primary);
    font-size: 1.35rem;
    margin-bottom: 16px;
}

.job-detail-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 4px 0 18px;
    color: var(--kori-primary);
}

.job-benefits {
    width: 100%;
    margin: 0 0 22px;
    padding: 14px 16px;
    border-left: 4px solid var(--kori-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: #fff8df;
}

.job-benefits strong {
    display: block;
    margin-bottom: 5px;
    color: var(--kori-primary);
}

.job-benefits p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
    white-space: pre-line;
}

.quote-options p { color: var(--text-muted); margin-top: 0; }
.quote-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quote-option-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--rg-border);
    border-radius: var(--radius-md);
    background: var(--rg-surface);
    color: var(--kori-primary);
    text-align: left;
    cursor: pointer;
    transition: var(--transition-base);
}

.quote-option-card:hover { border-color: var(--kori-secondary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quote-option-card i { color: var(--kori-secondary); font-size: 1.8rem; }
.quote-option-card span { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

.job-badge {
    background: rgba(0, 204, 170, 0.1);
    color: var(--kori-accent);
    padding: 6px 15px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    align-self: flex-start;
}

.job-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.job-card p {
    font-size: 0.95rem;
    margin-bottom: 2rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   9. COMPONENTES: FAQ ACORDEON
   ========================================== */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item-luxury {
    background: var(--rg-surface);
    border: 1px solid var(--rg-border);
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-base);
}

.faq-item-luxury summary {
    padding: 1.5rem 2rem;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--kori-primary);
}

.faq-item-luxury summary::-webkit-details-marker {
    display: none;
}

.faq-icon {
    width: 30px;
    height: 30px;
    background: var(--rg-bg-base);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kori-secondary);
    transition: var(--transition-base);
}

.faq-item-luxury[open] {
    border-color: var(--kori-secondary);
    box-shadow: var(--shadow-md);
}

.faq-item-luxury[open] .faq-icon {
    transform: rotate(45deg);
    background: var(--kori-secondary);
    color: var(--kori-primary);
}

.faq-answer {
    padding: 0 2rem 2rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Contacto comercial */
.contact-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e8eef5 100%) !important;
}

.contact-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: clamp(2rem, 6vw, 5rem);
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.contact-copy h1 {
    font-size: clamp(2rem, 4.5vw, 3.7rem);
    margin: 1rem 0 1.5rem;
}

.contact-copy > p {
    max-width: 700px;
    font-size: 1.1rem;
}

.contact-options {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-option {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--rg-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.contact-option i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 33, 71, 0.08);
    color: var(--kori-primary);
    font-size: 1.2rem;
}

.contact-option strong,
.contact-option span {
    display: block;
    overflow-wrap: anywhere;
}

.contact-option span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.contact-card {
    background: var(--kori-primary);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: var(--shadow-lg);
}

.contact-card h2,
.contact-card p {
    color: #fff;
}

.contact-card .cta-btn {
    width: 100%;
    margin-top: 0.75rem;
}

/* ==========================================
   10. MOTOR DE EDICIÓN VISUAL (PENCIL EDITOR)
   ========================================== */

/* Toolbar Flotante del Editor */
.live-editor-toolbar {
    position: fixed;
    top: 110px;
    right: 30px;
    background: var(--rg-bg-dark-elevated);
    padding: 20px 25px;
    border-radius: var(--radius-md);
    z-index: var(--z-editor);
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

.live-editor-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: var(--z-editor);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    background: var(--kori-secondary);
    color: var(--kori-primary);
    box-shadow: var(--shadow-heavy);
    font-weight: 800;
    cursor: pointer;
}

.quote-intro { margin: 0 0 1.5rem; color: var(--text-muted); }
.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.quote-form .form-group { margin-bottom: 1rem; }

@media (max-width: 640px) {
    .live-editor-launcher { right: 16px; bottom: 16px; }
    .quote-grid { grid-template-columns: 1fr; }
    .product-detail,
    .job-detail,
    .quote-options-grid { grid-template-columns: 1fr; }
    .product-detail-image,
    .job-detail-image { min-height: 220px; max-height: 280px; }
}

.editor-badge {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--kori-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

/* Nodos Editables: El "Lápiz" (Corrección de UX) */
body.live-edit-active .editable-node {
    position: relative !important;
    outline: 2px dashed rgba(255, 191, 0, 0.4) !important;
    outline-offset: 10px;
}

/* Área de Texto Editable */
body.live-edit-active .node-edit-text {
    position: relative !important;
    cursor: text !important;
    display: inline-block !important;
    min-width: 50px;
    padding-right: 40px !important; /* Espacio para el lápiz */
    border: 1px dashed transparent;
    transition: var(--transition-fast);
    /* CLAVE: Permitir que el clic llegue al texto */
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

body.live-edit-active .node-edit-text:hover {
    border-color: var(--kori-secondary);
    background: rgba(255, 191, 0, 0.05);
}

/* El Icono del Lápiz (Decoración No-Bloqueante) */
body.live-edit-active .node-edit-text::after {
    content: '\f303'; /* Fa-Pen */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kori-secondary);
    font-size: 1.1rem;
    opacity: 0.8;
    /* CLAVE: Los clics pasan a través del icono */
    pointer-events: none !important;
    transition: var(--transition-fast);
}

body.live-edit-active .node-edit-text:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 5px rgba(255, 191, 0, 0.2);
    border-radius: 4px;
    color: var(--kori-primary);
}

/* ==========================================
   11. SMART FORMS (CAPTURA DE DATOS)
   ========================================== */
.form-capture-card {
    background: var(--rg-surface);
    padding: 4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
    border-top: 8px solid var(--kori-primary);
}

.form-capture-card h2 {
    text-align: center;
    font-size: 2.5rem;
}

.form-capture-card p {
    text-align: center;
    margin-bottom: 3rem;
}

.glass-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--rg-border);
    background: var(--rg-bg-base);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-base);
}

.glass-input:focus {
    outline: none;
    background: white;
    border-color: var(--kori-secondary);
    box-shadow: 0 0 0 5px rgba(255, 191, 0, 0.1);
}

textarea.glass-input {
    min-height: 150px;
    resize: vertical;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    color: var(--kori-primary);
}

/* ==========================================
   12. FOOTER CORPORATIVO
   ========================================== */
.kori-footer {
    background: var(--rg-bg-dark);
    color: white;
    padding: 100px 6% 40px;
    margin-top: auto;
    border-top: 8px solid var(--kori-secondary);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-col h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 12px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--kori-secondary);
}

.footer-link {
    display: block;
    color: var(--text-on-dark);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: var(--kori-secondary);
    transform: translateX(8px);
}

.footer-socials {
    display: flex;
    gap: 15px;
    margin-top: 2rem;
}

.social-btn {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition-base);
}

.social-btn:hover {
    background: var(--kori-secondary);
    color: var(--kori-primary);
    transform: translateY(-5px);
}

.footer-bottom {
    margin-top: 80px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================
   13. UI COMPONENTS: BOTONES (CTAs)
   ========================================== */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 1.2rem 2.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition-base);
}

.primary-btn {
    background: var(--kori-secondary);
    color: var(--kori-primary);
    box-shadow: 0 10px 20px rgba(255, 191, 0, 0.2);
}

.primary-btn:hover {
    background: white;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 191, 0, 0.3);
}

.outline-btn {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.outline-btn:hover {
    background: white;
    color: var(--kori-primary);
}

.outline-dark-btn {
    border: 2px solid var(--kori-primary);
    color: var(--kori-primary);
}

.outline-dark-btn:hover {
    background: var(--kori-primary);
    color: white;
}

/* ==========================================
   14. NAVEGACIÓN MÓVIL (BOTTOM BAR)
   ========================================== */
.bottom-nav-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: #fff;
    border-top: 1px solid var(--rg-border);
    z-index: var(--z-nav);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-mobile .nav-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    gap: 4px;
}

.bottom-nav-mobile .nav-btn i {
    font-size: 1.4rem;
}

.bottom-nav-mobile .nav-btn.active {
    color: var(--kori-primary);
}

.bottom-nav-mobile .highlight-btn {
    width: 60px;
    height: 60px;
    background: var(--kori-secondary);
    color: var(--kori-primary) !important;
    border-radius: 50%;
    margin-top: -35px;
    border: 5px solid var(--rg-bg-base);
    box-shadow: 0 5px 20px rgba(255, 191, 0, 0.4);
    flex: none;
    padding: 0 !important;
}

/* ==========================================
   15. NOTIFICACIONES (TOASTS)
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--rg-bg-dark-elevated);
    color: white;
    padding: 1rem 1.8rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 320px;
    border-left: 5px solid var(--kori-secondary);
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left-color: var(--kori-success); }
.toast-error { border-left-color: var(--kori-error); }
.toast-warning { border-left-color: var(--kori-warning); }
.toast-info { border-left-color: var(--kori-info); }

/* ==========================================
   16. MODALES GLOBALES
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 15, 36, 0.85);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overscroll-behavior: contain;
}

.admin-modal-box {
    background: var(--rg-surface);
    width: 100%;
    max-width: 780px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-modal-box.wide-modal {
    max-width: 960px;
}

@keyframes modalIn {
    from { transform: scale(0.9) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rg-bg-base);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--rg-border);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.close-btn:hover {
    background: var(--kori-error);
    color: white;
    border-color: var(--kori-error);
}

.modal-body {
    padding: 2.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--rg-border);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: var(--rg-bg-base);
}

#modal-visor-imagen {
    background: rgba(2, 15, 36, 0.94);
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    z-index: calc(var(--z-modal) + 100) !important;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.visor-content {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: min(76vw, 1200px);
    height: min(76dvh, 720px);
    max-height: calc(100dvh - 3rem);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    cursor: default;
}

.visor-content img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-heavy);
}

.close-btn-visor {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: white;
    font-size: 1.6rem;
    line-height: 1;
}

.close-btn-visor:hover {
    background: var(--kori-secondary);
    color: var(--kori-primary);
}

@media (max-width: 1200px) {
    .visor-content {
        width: 82vw;
        height: 76dvh;
    }
}

/* ==========================================
   17. FIRMA BIOMÉTRICA (CANVAS)
   ========================================== */
.signature-wrapper {
    background: white;
    border: 3px dashed var(--rg-border);
    border-radius: var(--radius-md);
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.signature-pad {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ==========================================
   18. CARGADOR DE SISTEMA (BOOT)
   ========================================== */
.app-loader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: var(--z-editor) + 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    width: min(88vw, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.loader-logo {
    width: clamp(88px, 22vw, 132px);
    height: clamp(88px, 22vw, 132px);
    object-fit: contain;
    mix-blend-mode: multiply;
    margin-bottom: 18px;
}

.loader-truck {
    margin-bottom: 8px;
    color: var(--kori-primary);
    font-size: 1.7rem;
    animation: loaderTruck 2.2s ease-in-out infinite;
}

@keyframes loaderTruck {
    0%, 100% { transform: translateX(-8px); opacity: 0.65; }
    50% { transform: translateX(8px); opacity: 1; }
}

.loader-content h2 {
    margin: 0;
    color: var(--kori-primary);
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 4vw, 1.8rem);
    letter-spacing: clamp(1px, 0.6vw, 3px);
    line-height: 1.2;
}

.loader-progress {
    width: min(150px, 42vw);
    height: 4px;
    margin: 18px auto 14px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: #e2e8f0;
}

.loader-progress span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: var(--kori-secondary);
    animation: loaderProgress 1.3s ease-in-out infinite;
}

.loader-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

@keyframes loaderProgress {
    0% { transform: translateX(-120%); }
    50%, 100% { transform: translateX(330%); }
}

/* ==========================================
   19. RESPONSIVIDAD EXTREMA (MEDIA QUERIES)
   ========================================== */

/* LAPTOPS / PANTALLAS GRANDES */
@media (min-width: 1440px) {
    :root {
        --section-padding-x: 10%;
    }
}

/* TABLETS Y MÓVILES LANDSCAPE */
@media (max-width: 1024px) {
    :root {
        --section-padding-y: 80px;
        --nav-height: var(--nav-height-mobile);
    }

    .split-luxury {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .split-reverse {
        direction: ltr;
    }

    .hero-cinematic {
        min-height: 80vh !important;
    }

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

    .product-detail,
    .job-detail {
        grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
    }
}

/* SMARTPHONES (MÓVIL UI ACTIVADO) */
@media (max-width: 1200px) {
    .desktop-menu {
        display: none;
    }

    .bottom-nav-mobile {
        display: flex;
    }

    body {
        padding-bottom: var(--bottom-nav-height);
    }

    .top-nav {
        padding: 0 5%;
        justify-content: center;
    }

    .brand-text {
        align-items: center;
    }

    .brand-text-sub {
        display: none;
    }

    .luxury-section-header {
        margin-bottom: 3rem;
    }

    .grid-luxury-container {
        grid-template-columns: 1fr;
    }

    .form-capture-card {
        padding: 2.5rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-btn {
        width: 100%;
    }

    .live-editor-toolbar {
        top: auto;
        bottom: 90px;
        right: 15px;
        left: 15px;
        flex-direction: row;
        justify-content: center;
        padding: 10px;
    }

    .toast-container {
        left: 20px;
        right: 20px;
        bottom: calc(var(--bottom-nav-height) + 20px);
    }

    .toast {
        min-width: 100%;
    }

    .admin-modal-box {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
    }

    .admin-modal-box {
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        height: auto;
        min-height: min(100%, 420px);
        margin: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    }

    .admin-modal-box.wide-modal {
        max-width: 100%;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-header h3 {
        font-size: 1rem;
        padding-right: 12px;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .job-detail-image img {
        min-height: 220px;
        max-height: 280px;
    }
}

/* PANTALLAS ULTRA PEQUEÑAS */
@media (max-width: 380px) {
    .brand-text-main {
        font-size: 0.9rem;
    }

    .brand-logo {
        height: 35px;
    }
}

/* ==========================================
   20. REGLAS DE IMPRESIÓN (INFORMES LOGÍSTICOS)
   ========================================== */
@media print {
    .top-nav, .bottom-nav-mobile, .live-editor-toolbar, .toast-container {
        display: none !important;
    }

    body {
        background: white;
    }

    #dynamic-page-render > section {
        padding: 20px !important;
        page-break-after: always;
    }
}

/* ============================================================================
   PARCHE DE ESTABILIZACIÓN CRÍTICA v8.6.9 (CORE FIX)
   ============================================================================ */

/* 1. FIX PANTALLA NEGRA: Forzar la eliminación física del loader */
.app-loader.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* 2. FIX AMONTONAMIENTO: Garantizar que cada bloque dinámico ocupe su propio espacio */
#dynamic-page-render {
    display: block !important;
    height: auto !important;
    min-height: 100vh !important;
}

#dynamic-page-render > * {
    position: relative !important;
    clear: both !important; /* Evita que elementos flotantes se encimen */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 3. FIX LÁPIZ EDITOR: Traspaso de eventos y jerarquía de clics */
body.live-edit-active .editable-node::before {
    pointer-events: none !important; /* El borde punteado NO debe recibir clics */
    z-index: 1 !important;
}

body.live-edit-active .node-edit-text {
    pointer-events: all !important; /* Forzar que el texto reciba el clic */
    cursor: text !important;
    z-index: 10 !important;
    position: relative !important;
    outline: none !important; /* Quitar el borde azul feo del navegador */
}

body.live-edit-active .node-edit-text::after {
    pointer-events: none !important; /* El icono del lápiz NO debe bloquear el clic */
}

/* 4. FIX HERO: Asegurar que el primer impacto visual sea siempre visible */
.hero-cinematic {
    z-index: 2 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 5. FIX NAV: Evitar que el menú tape el inicio de la primera sección */
header.top-nav {
    pointer-events: all !important;
}

/* 6. FIX MOBILE: Desbloqueo de scroll y visibilidad en smartphones */
@media (max-width: 1200px) {
    body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #dynamic-page-render > section {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    #dynamic-page-render > .hero-cinematic:first-child {
        min-height: calc(100svh - var(--bottom-nav-height)) !important;
        padding-top: calc(var(--nav-height-mobile) + 3rem) !important;
        padding-bottom: 3rem !important;
    }

    .contact-shell {
        grid-template-columns: 1fr;
    }
}

/* 7. PREVENCIÓN DE NODOS FANTASMA: Evita que capas invisibles roben clics */
.hidden,
[hidden],
.modal-overlay.hidden,
.live-editor-toolbar.hidden,
#toast-container:empty {
    display: none !important;
    pointer-events: none !important;
}

/* ============================================================================
   FIN DEL PARCHE DEFINITIVO
   ============================================================================ */

   /* ============================================================================
   CORRECCIÓN ESTRUCTURAL: LOGO DEL FOOTER
   ============================================================================ */

.footer-brand-logo,
#footer-logo {
    max-height: 85px !important; /* Limita la altura para que no sea intrusivo */
    width: auto !important;     /* Mantiene la proporción original */
    object-fit: contain !important;
    display: block !important;
    margin-bottom: 1.5rem !important; /* Espacio entre el logo y el texto descriptivo */
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); /* Sutil sombra para dar profundidad */
    transition: transform 0.3s ease;
}

/* Efecto hover profesional */
.footer-brand-logo:hover {
    transform: scale(1.05);
}

/* Ajuste para la columna del footer para que el logo no empuje todo */
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinea logo y texto a la izquierda */
}

/* Corrección para móviles: Centrar logo si el diseño cambia a una sola columna */
@media (max-width: 1200px) {
    .footer-col {
        align-items: center;
        text-align: center;
    }
    .footer-brand-logo, #footer-logo {
        margin-left: auto;
        margin-right: auto;
        max-height: 70px !important;
    }
}

/* ============================================================================
   AJUSTE DE CABECERAS DE SECCIÓN (GRID FIX)
   ============================================================================ */

.luxury-section-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    margin-bottom: 50px !important;
    gap: 10px !important; /* Espacio entre el badge y el título */
}

.luxury-section-header .subtitle-badge {
    display: inline-block !important;
    margin-bottom: 0 !important; /* El gap del padre ya da el espacio */
    width: fit-content !important;
}

.luxury-section-header h2 {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Ajuste del lápiz para que no mueva el texto */
body.live-edit-active .luxury-section-header h2.node-edit-text {
    padding-right: 45px !important;
    margin-right: -45px !important; /* Compensa el espacio del lápiz para mantener el centro real */
}

/* ==========================================================================
   MOBILE POLISH: FLUJO, ESPACIO Y MODALES
   ========================================================================== */
html.modal-open,
body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.modal-overlay {
    touch-action: auto;
}

.modal-overlay .modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1200px) {
    :root {
        --section-padding-y: 72px;
        --section-padding-x: 5%;
    }

    body {
        font-size: 15px;
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }

    #dynamic-page-render > section {
        padding-left: var(--section-padding-x) !important;
        padding-right: var(--section-padding-x) !important;
    }

    .nav-container-inner {
        min-width: 0;
        gap: 10px;
    }

    .brand-wrapper {
        min-width: 0;
        max-width: calc(100% - 54px);
    }

    .brand-text-main {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero-cinematic {
        min-height: calc(100svh - var(--bottom-nav-height)) !important;
    }

    .hero-content,
    .split-txt-box,
    .contact-copy,
    .contact-card {
        width: 100%;
    }

    .hero-content h1,
    .contact-copy h1 {
        font-size: clamp(1.85rem, 7.5vw, 2.65rem);
        line-height: 1.12;
        overflow-wrap: anywhere;
    }

    .luxury-section-header h2 {
        font-size: clamp(1.65rem, 7vw, 2.35rem);
        line-height: 1.15;
    }

    .catalog-filter-bar {
        justify-content: flex-start;
        gap: 8px;
        margin-top: -1.25rem;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 2px 1px 8px;
        scrollbar-width: none;
    }

    .catalog-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .catalog-filter {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 8px 13px;
        font-size: 0.72rem;
    }

    .sales-cover {
        min-height: 280px;
        margin-top: calc(var(--section-padding-y) * -0.35);
        margin-bottom: 2.5rem;
        border-radius: 14px;
    }

    .sales-cover-copy {
        padding: 1.35rem;
    }

    .sales-cover-copy h1 {
        font-size: clamp(1.75rem, 8vw, 2.35rem);
    }

    .luxury-section-header p,
    .contact-copy > p {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .hero-actions,
    .editor-actions {
        gap: 10px;
    }

    .cta-btn,
    .hero-actions .cta-btn,
    .contact-card .cta-btn {
        min-height: 48px;
        padding: 0.9rem 1.1rem;
        width: 100%;
        white-space: normal;
        line-height: 1.25;
    }

    .grid-luxury-container {
        gap: 18px;
    }

    .service-poster {
        height: 360px;
        border-radius: 12px;
    }

    .poster-content {
        padding: 1.25rem;
        transform: none;
    }

    .poster-content h3 {
        font-size: 1.25rem;
        overflow-wrap: anywhere;
    }

    .service-poster:hover,
    .job-card:hover,
    .service-poster:hover img {
        transform: none;
    }

    .job-card {
        min-height: 0;
        padding: 1.35rem;
        border-radius: 12px;
    }

    .job-card h3 {
        font-size: 1.25rem;
        overflow-wrap: anywhere;
    }

    .job-card-summary {
        margin-bottom: 1.25rem;
    }

    .product-detail,
    .job-detail,
    .contact-shell,
    .split-luxury {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-detail-image,
    .job-detail-image {
        min-height: 190px;
        max-height: 230px;
    }

    .job-detail-image img {
        min-height: 190px;
        max-height: 230px;
    }

    .product-detail-copy,
    .job-detail-copy {
        min-width: 0;
    }

    .product-detail-copy h2,
    .job-detail-copy h2 {
        font-size: 1.55rem;
        overflow-wrap: anywhere;
    }

    .quote-options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .quote-option-card {
        min-height: 112px;
        padding: 18px;
    }

    .quote-grid {
        grid-template-columns: 1fr;
    }

    .quote-form input,
    .quote-form textarea,
    .glass-input,
    .form-capture-card input,
    .form-capture-card textarea {
        font-size: 16px;
    }

    .modal-overlay {
        align-items: flex-start;
        padding: env(safe-area-inset-top) 8px env(safe-area-inset-bottom);
    }

    .admin-modal-box,
    .admin-modal-box.wide-modal {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        margin: 0;
        border-radius: 12px;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .modal-footer .admin-btn {
        flex: 1 1 100%;
        min-height: 46px;
    }

    .live-editor-toolbar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .editor-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .editor-actions .editor-btn {
        flex: 1 1 140px;
        min-height: 44px;
    }

    .toast-container {
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 14px);
    }

    .brand-logo {
        display: block;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .brand-wrapper {
        gap: 8px;
    }

    .brand-text {
        min-width: 0;
        max-width: calc(100% - 50px);
    }

    .bottom-nav-mobile {
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        padding: 4px 6px env(safe-area-inset-bottom);
    }

    .bottom-nav-mobile .nav-btn {
        min-width: 0;
        padding: 3px 2px !important;
        gap: 2px;
        line-height: 1.1;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .bottom-nav-mobile .nav-btn span {
        display: block;
        max-width: 100%;
        font-size: 0.62rem;
        line-height: 1.15;
    }

    .bottom-nav-mobile .nav-btn i {
        flex: 0 0 auto;
        font-size: 1.15rem;
    }

    .live-editor-launcher {
        right: 14px;
        bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 14px);
        padding: 11px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .top-nav {
        padding-left: 4%;
        padding-right: 4%;
    }

    .brand-text-main {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .service-poster {
        height: 330px;
    }

    .poster-content,
    .job-card {
        padding: 1rem;
    }
}

/* Tablet: navegación compacta con tarjetas en dos columnas. */
@media (min-width: 769px) and (max-width: 1200px) {
    .grid-luxury-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-content h1, .contact-copy h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
    .hero-actions { flex-wrap: wrap; }
    .hero-actions .cta-btn { width: auto; }
    .bottom-nav-mobile .nav-btn span { font-size: 0.8rem; }
}

@media (min-width: 1201px) and (max-width: 1400px) {
    .desktop-menu { gap: 1rem; }
}
