/* =========================================================
   Nave for WooCommerce — Estilos del checkout
   ========================================================= */

:root {
    --nave-purple:        #7B2FBE;
    --nave-purple-light:  #9D52D9;
    --nave-purple-bg:     #F5EEFF;
    --nave-purple-border: #D4AAFF;
    --nave-black:         #1A1A1A;
    --nave-gray:          #6B7280;
    --nave-gray-light:    #F3F4F6;
    --nave-border:        #E5E7EB;
    --nave-radius:        10px;
}

/* ── Contenedor principal */
.nave-checkout-container {
    padding: 4px 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Badge Sandbox ──────────────────────────────────────── */
.nave-sandbox-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff8e6;
    border: 1px solid #f59e0b;
    border-radius: 20px;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nave-sandbox-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #f59e0b;
    border-radius: 50%;
    animation: nave-pulse 1.5s ease-in-out infinite;
}
@keyframes nave-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ── Descripción ────────────────────────────────────────── */
.nave-checkout-description {
    color: var(--nave-gray);
    font-size: 13.5px;
    margin: 0 0 12px;
    line-height: 1.5;
    padding: 0;
}

/* ── Cartel de redirección ──────────────────────────────── */
.nave-redirect-notice {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    background: var(--nave-purple-bg);
    border: 1.5px solid var(--nave-purple-border);
    border-radius: var(--nave-radius);
    padding: 12px 14px;
}

/* Logo Nave dentro del ícono */
.nave-redirect-logo {
    height: 16px;
    width: auto;
    display: block !important;
    margin: 0 !important;
    float: none !important;
}

/* Ícono contenedor */
.nave-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--nave-purple-border);
    flex-shrink: 0;
}

/* Texto */
.nave-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.nave-option-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--nave-black);
    line-height: 1.3;
}
.nave-option-desc {
    display: block;
    font-size: 12px;
    color: var(--nave-gray);
    line-height: 1.4;
}

/* Flecha derecha */
.nave-redirect-arrow {
    color: var(--nave-gray);
    flex-shrink: 0;
}

/* ── QR Inline (dentro del payment_fields) ─────────────── */
.nave-inline-qr {
    margin-top: 12px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.nave-inline-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}
.nave-inline-qr-loading p {
    margin: 0;
    color: var(--nave-gray);
    font-size: 14px;
}
.nave-inline-qr-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Modal QR Inline ────────────────────────────────────── */

/* Backdrop */
.nave-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.60);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.nave-modal--visible {
    opacity: 1;
    pointer-events: auto;
}
body.nave-modal-open {
    overflow: hidden;
}

/* Card */
.nave-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: 92vh;
    overflow-y: auto;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.20);
}

/* ── Loading ─── */
.nave-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
}
.nave-modal-loading p {
    margin: 0;
    color: var(--nave-gray);
    font-size: 14px;
}
.nave-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--nave-purple-border);
    border-top-color: var(--nave-purple);
    border-radius: 50%;
    animation: nave-spin 0.75s linear infinite;
}
@keyframes nave-spin {
    to { transform: rotate(360deg); }
}

/* ── QR Section ─── */
.nave-modal-scan-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--nave-black);
    margin: 0 0 18px;
}

/* QR wrap — relative para el overlay de estado */
.nave-modal-qr-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    border: 1px solid var(--nave-border);
}

/* El canvas generado por qrcode.js */
.nave-modal-qr-wrap canvas,
.nave-modal-qr-wrap img {
    display: block;
    border-radius: 11px;
}

/* Overlay de estado (approved / failed / expired) */
.nave-modal-qr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    gap: 10px;
    padding: 16px;
}
.nave-modal-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}
.nave-modal-overlay-inner p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--nave-black);
}
.nave-overlay-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 8px 20px;
    background: var(--nave-gray-light);
    border: 1px solid var(--nave-border);
    border-radius: 8px;
    color: var(--nave-black);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.nave-overlay-btn:hover {
    background: var(--nave-border);
}

/* Hint y timer */
.nave-modal-hint {
    font-size: 12px;
    color: var(--nave-gray);
    margin: 0 0 10px;
    line-height: 1.5;
}
.nave-modal-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--nave-gray);
    margin-bottom: 8px;
}
.nave-modal-timer strong {
    color: var(--nave-black);
}

.nave-modal-status {
    font-size: 13px;
    color: var(--nave-gray);
    margin: 0 0 18px;
}

/* Divider "o" */
.nave-modal-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--nave-gray);
    font-size: 12px;
}
.nave-modal-divider::before,
.nave-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--nave-border);
}

/* Botón "Pagar en Nave" */
.nave-modal-btn-primary {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--nave-purple);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
    margin-bottom: 10px;
}
.nave-modal-btn-primary:hover {
    background: var(--nave-purple-light);
    color: #fff;
}

/* Botón cancelar */
.nave-modal-btn-cancel {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--nave-border);
    border-radius: 10px;
    color: var(--nave-gray);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.nave-modal-btn-cancel:hover {
    border-color: #aaa;
    color: var(--nave-black);
}
