/* =========================================================
   ESTILOS COMPLETOS CONSOLA SPLIT — PINO LIVE
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-primary: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --accent-pino: #c1cd7d;
    --accent-pino-dim: rgba(193, 205, 125, 0.25);
    --accent-pino-glow: rgba(193, 205, 125, 0.4);
    --accent-indigo-glow: rgba(59, 66, 98, 0.4);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-muted: #9e9ea7;
}

body.cotizador-body {
    background-color: #040507 !important;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
    background-position: center center !important;
    color: #ffffff !important;
    font-family: var(--font-primary) !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Luces ambientales tenues */
.cotizador-ambient-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.glow-mesh-pino {
    position: absolute;
    top: -100px;
    left: 5%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--accent-pino-dim) 0%, transparent 70%);
    filter: blur(140px);
    opacity: 0.5;
}

.glow-mesh-indigo {
    position: absolute;
    bottom: -100px;
    right: 5%;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, var(--accent-indigo-glow) 0%, transparent 70%);
    filter: blur(140px);
    opacity: 0.4;
}

/* HEADER FLOTANTE */
.cotizador-header-glass {
    position: relative;
    z-index: 10;
    margin: 20px auto 0;
    width: min(1320px, 94%);
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    background: rgba(14, 14, 19, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 32px;
}

.brand-logo a {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #ffffff;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent-pino);
    text-transform: uppercase;
}

.btn-return-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.2s, transform 0.2s;
}

.btn-return-link:hover {
    color: var(--accent-pino);
    transform: translateX(-3px);
}

/* CONTENEDOR SPLIT */
.split-console-container {
    flex: 1;
    position: relative;
    z-index: 2;
    width: min(1320px, 94%);
    margin: 24px auto 40px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
    align-items: stretch;
}

/* PANEL IZQUIERDO: CONVERSACIÓN */
.console-left-panel {
    background: rgba(12, 14, 20, 0.85);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    height: 720px;
    max-height: 80vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.stepper-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(16, 18, 26, 0.85);
    flex-shrink: 0;
}

.stepper-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stepper-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-pino);
    box-shadow: 0 0 10px var(--accent-pino);
    animation: ledPulse 1.8s infinite ease-in-out;
}

@keyframes ledPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

.stepper-step-txt {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.telemetry-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-pino);
    background: rgba(193, 205, 125, 0.12);
    border: 1px solid rgba(193, 205, 125, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}

/* ÁREA DE MENSAJES */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(193, 205, 125, 0.25);
    border-radius: 4px;
}

.msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
    animation: msgEntry 0.3s ease forwards;
}

@keyframes msgEntry {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-bot {
    align-self: flex-start;
    background: rgba(22, 25, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--accent-pino);
    color: #e5e5f0;
}

.msg-user {
    align-self: flex-end;
    background: var(--accent-pino);
    color: #08090c;
    font-weight: 700;
    box-shadow: 0 0 16px -4px var(--accent-pino-glow);
}

.msg-time {
    display: block;
    font-family: var(--font-mono);
    font-size: 9.5px;
    margin-top: 6px;
    opacity: 0.55;
    text-align: right;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(22, 25, 36, 0.85);
    border-radius: 10px;
    border-left: 3px solid var(--accent-pino);
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-pino);
    border-radius: 50%;
    animation: waveBounce 1.3s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes waveBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ENTRADA INFERIOR */
.chat-input-area {
    flex-shrink: 0;
    padding: 16px 20px;
    background: rgba(13, 15, 22, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-ui-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 100px;
    overflow-y: auto;
}

.btn-opcion {
    background: rgba(26, 28, 38, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 9px 15px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-opcion:hover {
    border-color: var(--accent-pino);
    color: var(--accent-pino);
}

.btn-opcion.selected {
    background: var(--accent-pino) !important;
    color: #08090c !important;
    font-weight: 800;
}

.input-libre-container {
    display: flex;
    gap: 10px;
}

.input-libre {
    flex: 1;
    background: rgba(8, 9, 13, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 13.5px;
    outline: none;
}

.input-libre:focus {
    border-color: var(--accent-pino);
}

.btn-enviar-libre {
    background: var(--accent-pino);
    color: #08090c;
    border: none;
    padding: 0 20px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 11.5px;
    cursor: pointer;
}

/* PANEL DERECHO: RIDER EN VIVO */
.console-right-panel {
    display: flex;
    flex-direction: column;
}

.rider-sheet {
    background: #090a0f;
    border: 1px dashed rgba(193, 205, 125, 0.4);
    border-radius: 16px;
    padding: 32px 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.rider-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.rider-doc-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-pino);
    display: block;
    margin-bottom: 4px;
}

.rider-brand-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    color: #ffffff;
}

.rider-brand-title span {
    color: var(--accent-pino);
}

.rider-seal {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--accent-pino);
    background: rgba(193, 205, 125, 0.12);
    border: 1px solid rgba(193, 205, 125, 0.35);
    padding: 4px 10px;
    border-radius: 4px;
}

.rider-seal.confirmed {
    background: var(--accent-pino);
    color: #08090c;
    border-color: var(--accent-pino);
    box-shadow: 0 0 15px var(--accent-pino-glow);
}

.rider-data-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rider-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.r-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6d7082;
    margin-bottom: 5px;
}

.r-value {
    font-family: var(--font-primary);
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
}

.r-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.r-tag-item {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: rgba(193, 205, 125, 0.15);
    color: var(--accent-pino);
    border: 1px solid rgba(193, 205, 125, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.r-placeholder {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #4a4c59;
}

.rider-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rider-telemetry {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1px;
    color: #636677;
    text-transform: uppercase;
}

.btn-rider-pdf {
    width: 100%;
    background: var(--accent-pino);
    color: #08090c;
    border: none;
    border-radius: 30px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 25px -4px var(--accent-pino-glow);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-rider-pdf:hover {
    background: #d4e08a;
    transform: translateY(-2px);
    box-shadow: 0 0 35px var(--accent-pino-glow);
}

/* RESPONSIVIDAD */
@media (max-width: 992px) {
    .split-console-container {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   RESPONSIVE // CONSOLA DE COTIZACIÓN (≤ 860px)
   ========================================================= */
@media (max-width: 860px) {
    /* La vista dividida pasa a columna única */
    .cotizador-split-layout,
    .calc-console-grid,
    .cotizador-main {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        width: 100% !important;
        padding-inline: 16px !important;
    }

    /* Panel de resumen / sticky se desacopla en móvil */
    .console-summary-panel,
    .cotizador-sidebar {
        position: static !important;
        width: 100% !important;
    }

    /* Botón de envío a ancho completo */
    .btn-submit-cotizar,
    .btn-despacho {
        width: 100% !important;
        text-align: center !important;
    }
}