/**
 * ═══════════════════════════════════════════════════════════════════════════
 * MOSHI STORE CR – INTERFAZ DE SISTEMA DE PAGO // TERMINAL v4
 * ═══════════════════════════════════════════════════════════════════════════
 * Concepto: "Cohesive Interface". En lugar de tarjetas separadas, el carrito
 * se convierte en una ventana de sistema única (COORDINATE_WINDOW).
 * Inspiración: Mi Cuenta (Pilot Terminal v3) y Valoraciones.
 * ═══════════════════════════════════════════════════════════════════════════
 */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;500;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --int-cyan: #00f3ff;
    --int-cyan-dim: rgba(0, 243, 255, 0.12);
    --int-cyan-glow: rgba(0, 243, 255, 0.35);
    --int-magenta: #ff00ff;
    --int-magenta-dim: rgba(255, 0, 255, 0.15);
    --int-bg: #050a10;
    --int-panel: rgba(8, 14, 22, 0.94);
    --int-border: rgba(0, 243, 255, 0.2);
    --int-border-thick: 2px solid var(--int-cyan);
    --int-text: #e0e6ed;
    --int-text-dim: rgba(255, 255, 255, 0.45);
    --int-font-ui: 'Rajdhani', sans-serif;
    --int-font-tech: 'Orbitron', sans-serif;
    --int-font-mono: 'JetBrains Mono', monospace;
    --int-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --int-grid-mesh:
        linear-gradient(rgba(0, 243, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.02) 1px, transparent 1px);
}

/* ══════════════════════════════════════════════════════════════════════════
   1. GLOBAL & BACKGROUND
   ══════════════════════════════════════════════════════════════════════════ */
body.woocommerce-cart {
    background-color: var(--int-bg) !important;
    color: var(--int-text);
    font-family: var(--int-font-ui);
}

body.woocommerce-cart::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--int-grid-mesh);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Ocultar Título por Defecto de Astra/WooCommerce en esta página */
.woocommerce-cart .entry-title {
    display: none !important;
}

.woocommerce-cart .ast-woocommerce-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px 80px;
    /* Reduced top, more bottom */
}

/* ══════════════════════════════════════════════════════════════════════════
   2. SYSTEM HEADER (Cabecera Principal HUD)
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-hud-system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 35px;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.08), transparent);
    border: 1px solid var(--int-border);
    border-bottom: none;
    position: relative;
    margin-bottom: 0;
}

.moshi-hud-title-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.moshi-hud-status-led {
    width: 10px;
    height: 10px;
    background: var(--int-cyan);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--int-cyan);
}

.moshi-hud-title-group {
    display: flex;
    flex-direction: column;
}

.moshi-hud-breadcrumb {
    font-family: var(--int-font-mono);
    font-size: 0.6rem;
    color: var(--int-text-dim);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.moshi-hud-m.cart-subtotal .amount {
    color: var(--int-text);
    font-weight: 600;
    font-size: 1rem;
}

.order-total .amount {
    color: var(--int-cyan);
    font-family: var(--int-font-tech);
    font-size: 1.4rem;
    /* Reduced from enormous size */
    text-shadow: 0 0 15px var(--int-cyan-glow);
}

.moshi-hud-main-title {
    font-family: var(--int-font-tech);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--int-cyan);
    /* Restored Cyan */
    margin: 0;
    letter-spacing: 5px;
    text-shadow: 0 0 20px var(--int-cyan-glow);
}

.moshi-hud-connection-info {
    display: flex;
    gap: 30px;
    font-family: var(--int-font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ══════════════════════════════════════════════════════════════════════════
   2. CURVED TERMINAL CHASSIS (Main Hardware Container)
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-terminal-chassis {
    display: flex;
    flex-direction: column;
    max-width: 1500px;
    margin: 40px auto;
    background: #020408;
    border-radius: 20px;
    border: 1px solid var(--int-cyan-dim);
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.95),
        inset 0 0 30px rgba(0, 243, 255, 0.05),
        0 0 0 5px #0a1118;
    /* Outer bevel simulating hardware */
    position: relative;
    overflow: hidden;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════
   3. TERMINAL HEADER 
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.moshi-terminal-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.moshi-hud-glitch-icon {
    width: 22px;
    height: 22px;
    background: var(--int-cyan);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
    box-shadow: 0 0 15px var(--int-cyan-glow);
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

.moshi-typewriter-text {
    font-family: var(--int-font-tech);
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--int-cyan-glow);
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--int-cyan);
    animation: typing 3s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--int-cyan);
    }
}

.moshi-terminal-sys-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--int-font-mono);
    font-size: 0.70rem;
    color: var(--int-text-dim);
}

.moshi-led-online {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ffcc;
    box-shadow: 0 0 8px #00ffcc;
    animation: ledPulse 2s infinite;
}

.moshi-text-cyan {
    color: var(--int-cyan);
    text-shadow: 0 0 8px var(--int-cyan-glow);
}

/* ══════════════════════════════════════════════════════════════════════════
   4. TERMINAL GRID LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-terminal-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   5. CRT SCREEN (Left Column)
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-terminal-screen-wrapper {
    padding: 30px;
    background: #060b12;
    /* Darker grey surround */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.moshi-terminal-screen {
    position: relative;
    flex-grow: 1;
    background: #000;
    /* Deep black screen */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 0 100px rgba(0, 0, 0, 1),
        0 0 0 6px #020408,
        /* Screen Inner Bezel */
        0 0 0 8px #080d14;
    /* Screen Outer Bezel */
    overflow: hidden;
    padding: 0;
}

/* The Glass Glare */
.moshi-crt-glass {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
        radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.8) 120%);
    pointer-events: none;
    z-index: 5;
}

/* Scanlines finas */
.moshi-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 1px,
            rgba(0, 243, 255, 0.02) 1px,
            rgba(0, 243, 255, 0.02) 2px);
    pointer-events: none;
    z-index: 4;
}

.moshi-terminal-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 40px rgba(0, 243, 255, 0.05);
    pointer-events: none;
    z-index: 3;
}

.moshi-cart-data-list {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

/* Terminal Logs below screen */
.moshi-terminal-logs {
    background: #000;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    font-family: var(--int-font-mono);
    opacity: 0.9;
    font-size: 0.70rem;
    line-height: 1.8;
    box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.moshi-log-row {
    display: flex;
    gap: 10px;
}

.moshi-log-label {
    color: var(--int-magenta);
    text-shadow: 0 0 5px var(--int-magenta-dim);
}

.moshi-log-msg {
    color: var(--int-cyan);
    text-shadow: 0 0 5px var(--int-cyan-glow);
}

/* ══════════════════════════════════════════════════════════════════════════
   6. PRODUCTS IN THE SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-cart-item-card {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px dashed rgba(0, 243, 255, 0.15);
    transition: all 0.4s var(--int-ease);
    background: transparent;
    position: relative;
    overflow: hidden;
}

/* Phosphor glow & Lift on hover */
.moshi-cart-item-card:hover {
    background: rgba(0, 243, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(0, 243, 255, 0.3);
}

/* Scanner line effect crossing the card */
.moshi-cart-item-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

.moshi-cart-item-card:hover::before {
    transform: translateX(100%);
}

/* Vertical indicator line */
.moshi-cart-item-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0%;
    background: var(--int-cyan);
    transition: height 0.3s var(--int-ease);
    box-shadow: 0 0 10px var(--int-cyan);
}

.moshi-cart-item-card:hover::after {
    height: 60%;
}

/* Thumbnail */
.moshi-cart-item-thumb {
    width: 80px;
    height: 60px;
    border: 1px solid var(--int-border);
    flex-shrink: 0;
    margin-right: 25px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.moshi-cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: all 0.4s;
}

.moshi-cart-item-card:hover .moshi-cart-item-thumb img {
    opacity: 1;
    transform: scale(1.05);
}

/* Info */
.moshi-cart-item-info {
    flex-grow: 1;
}

.moshi-cart-item-meta-top {
    font-family: var(--int-font-mono);
    font-size: 0.60rem;
    color: var(--int-magenta);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.moshi-cart-item-name {
    font-family: var(--int-font-ui);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.moshi-cart-item-name a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.moshi-cart-item-name a:hover {
    color: var(--int-cyan);
    text-shadow: 0 0 8px var(--int-cyan-glow);
}

/* QTY Control */
.moshi-cart-item-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 40px;
}

.moshi-cart-item-qty::before {
    content: 'CANTIDAD';
    font-family: var(--int-font-mono);
    font-size: 0.55rem;
    color: var(--int-text-dim);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.moshi-cart-item-qty input.qty {
    background: transparent;
    border: 1px solid var(--int-cyan-dim);
    color: var(--int-cyan);
    font-family: var(--int-font-mono);
    width: 50px;
    text-align: center;
    padding: 6px;
    font-weight: 700;
    border-radius: 4px;
    outline: none;
    transition: all 0.3s;
}

.moshi-cart-item-qty input.qty:focus {
    border-color: var(--int-cyan);
    box-shadow: 0 0 10px var(--int-cyan-glow);
}

/* Subtotal */
.moshi-cart-item-subtotal {
    font-family: var(--int-font-tech);
    font-size: 1.1rem;
    color: var(--int-cyan);
    text-shadow: 0 0 8px var(--int-cyan-dim);
    min-width: 120px;
    text-align: right;
}

/* Botón Remove */
.moshi-cart-item-remove {
    margin-right: 20px;
}

.moshi-cart-item-remove a {
    color: var(--int-text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    text-decoration: none;
    transition: all 0.3s;
    border-radius: 4px;
}

.moshi-cart-item-remove a svg {
    width: 18px;
    height: 18px;
}

.moshi-cart-item-remove a:hover {
    color: var(--int-magenta);
    background: rgba(255, 0, 255, 0.05);
}

/* ══════════════════════════════════════════════════════════════════════════
   7. SIDEBAR CONTROLS (Right Panel)
   ══════════════════════════════════════════════════════════════════════════ */
.moshi-terminal-controls {
    padding: 30px;
    background: #04080e;
    /* Chassis color */
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.moshi-control-module {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.moshi-control-module h3 {
    font-family: var(--int-font-tech);
    font-size: 0.80rem;
    color: var(--int-text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.moshi-control-module h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 12px;
    background: var(--int-cyan);
    border-radius: 2px;
}

/* ── LEDGER DISPLAY (Cart Totals) ── */
.moshi-ledger-display {
    width: 100%;
}

.cart_totals {
    width: 100% !important;
    background: transparent !important;
    padding: 0 !important;
}

.cart_totals>h2 {
    display: none !important;
}

.cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.cart_totals tr {
    transition: all 0.3s ease;
    border-bottom: 1px dashed rgba(0, 243, 255, 0.15);
}

.cart_totals tr:last-child {
    border-bottom: none;
}

.cart_totals tr:hover th,
.cart_totals tr:hover td {
    background: rgba(0, 243, 255, 0.05);
}

.cart_totals th,
.cart_totals td {
    padding: 15px 10px;
    background: transparent;
    border: none;
}

.cart_totals th {
    text-align: left;
    color: var(--int-magenta);
    font-family: var(--int-font-mono);
    font-weight: 500;
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-right: none;
    width: 35%;
}

.cart_totals th::before {
    content: '[ ';
    color: rgba(255, 0, 255, 0.4);
}

.cart_totals th::after {
    content: ' ]';
    color: rgba(255, 0, 255, 0.4);
}

.cart_totals td {
    text-align: right;
    color: var(--int-cyan);
    font-family: var(--int-font-mono);
    font-size: 0.85rem;
    border-left: none;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
}

.order-total th,
.order-total td {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--int-cyan);
    padding: 18px 15px;
}

.order-total th {
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--int-font-tech);
    letter-spacing: 2px;
}

.order-total th::before,
.order-total th::after {
    display: none;
}

.order-total td .woocommerce-Price-amount {
    font-family: var(--int-font-tech);
    font-size: 1.5rem;
    color: var(--int-cyan);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
}

/* Información de envío */
#shipping_method {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
    font-size: 0.85rem;
}

.woocommerce-shipping-destination {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--int-text-dim);
}

.woocommerce-shipping-calculator {
    margin-top: 10px;
    font-size: 0.75rem;
}

/* ── PHYSICAL INPUTS (Coupons) ── */
.moshi-physical-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.moshi-physical-input {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 15px 20px;
    font-family: var(--int-font-ui);
    font-size: 0.95rem;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.moshi-physical-input:focus {
    border-color: var(--int-cyan);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 243, 255, 0.1);
}

.moshi-physical-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: var(--int-font-ui);
    font-weight: 600;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.moshi-physical-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── ACTION MODULE (Proceed to Checkout) ── */
.moshi-action-module {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.wc-proceed-to-checkout {
    padding: 0;
    margin: 0;
}

.wc-proceed-to-checkout a.checkout-button {
    font-family: var(--int-font-tech) !important;
    background: var(--int-cyan) !important;
    color: #000 !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    text-transform: uppercase !important;
    padding: 22px 25px !important;
    border: none !important;
    border-radius: 12px !important;
    margin: 0 !important;
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    letter-spacing: 3px !important;
    transition: all 0.3s ease !important;
    box-shadow:
        0 10px 20px rgba(0, 243, 255, 0.2),
        inset 0 -3px 0 rgba(0, 0, 0, 0.2) !important;
}

.wc-proceed-to-checkout a.checkout-button:hover {
    background: #fff !important;
    transform: translateY(-2px);
    box-shadow:
        0 15px 30px rgba(0, 243, 255, 0.3),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1) !important;
}

.wc-proceed-to-checkout a.checkout-button:active {
    transform: translateY(1px);
    box-shadow:
        0 5px 10px rgba(0, 243, 255, 0.2),
        inset 0 3px 0 rgba(0, 0, 0, 0.2) !important;
}

/* Return Link */
.moshi-btn-return {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--int-cyan);
    font-family: var(--int-font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    margin-top: 20px;
    padding: 15px;
    border: 1px dashed rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(0, 243, 255, 0.02);
}

.moshi-btn-return:hover {
    color: #fff;
    border-color: var(--int-cyan);
    background: rgba(0, 243, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════════
   8. RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .moshi-terminal-grid {
        grid-template-columns: 1fr 340px;
    }
}

@media (max-width: 992px) {
    .moshi-terminal-grid {
        grid-template-columns: 1fr;
    }

    .moshi-terminal-screen-wrapper {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 768px) {
    .moshi-cart-item-card {
        flex-wrap: wrap;
        padding: 20px;
    }

    .moshi-cart-item-thumb {
        width: 70px;
        height: 55px;
        margin-right: 15px;
    }

    .moshi-cart-item-name {
        font-size: 1rem;
    }

    .moshi-cart-item-qty {
        margin-right: 20px;
    }

    .moshi-cart-item-subtotal {
        min-width: 100px;
        font-size: 1rem;
    }
}