/* ═══════════════════════════════════════════════════════════
   VesselNexus — unified buy-entry component (P5)
   [data-vnx-buy] buttons: ship report cards, market cash unlock,
   inquiry modal cash unlock.
   ═══════════════════════════════════════════════════════════ */

/* Base button — matches .vnx-inquire-btn visual language */
.vnx-buy-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #1B4D85;
    border-radius: 6px;
    background: transparent;
    color: #1B4D85;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.vnx-buy-btn:hover { background: #1B4D85; color: #fff; }

/* Cash alternative — inverted emphasis */
.vnx-buy-btn--cash {
    border-color: var(--vnx-gold-600, #B8860B);
    color: var(--vnx-gold-700, #8B6914);
}
.vnx-buy-btn--cash:hover { background: var(--vnx-gold-600, #B8860B); color: #fff; }

/* Stripe not configured — cash-only entries degrade */
.vnx-buy--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.vnx-buy--disabled:hover { background: transparent; color: inherit; }

/* ── 落点① market sale details panel AI report section（P10 迁移，原 ship detail） ── */
.vnx-ai-report-section {
    margin: 18px 0 6px;
    padding: 14px 16px;
    border: 1px solid var(--vnx-gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--vnx-color-info-bg, #f0f7ff);
}
.vnx-ai-report-section__title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1B4D85;
}
.vnx-ai-report-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.vnx-buy-btn--report {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 150px;
    background: #fff;
}
.vnx-buy-btn--report strong { font-size: 0.9rem; }
.vnx-buy-btn--report span   { font-size: 0.75rem; font-weight: 400; opacity: 0.85; }

/* Owned state (P8) — solid success green; links to My Account downloads.
   Same success token as the account "generated" badge — green = owned. */
.vnx-buy-btn--owned,
.vnx-buy-btn--owned:hover {
    border-color: var(--vnx-color-success, #219653);
    background:  var(--vnx-color-success, #219653);
    color: #fff;
    text-decoration: none;   /* <a> variant */
}

/* P10 — hard data gate: insufficient vessel data. Native [disabled]
   blocks all real input; the button carries no [data-vnx-buy] attribute
   so the delegated buy listener never fires either. Hover override keeps
   the base .vnx-buy-btn:hover from inverting the gray.
   (Not .vnx-buy--disabled — that is the JS soft state for Stripe-absent
   cash entries, visual-only by design.) */
.vnx-buy-btn--na,
.vnx-buy-btn--na:hover {
    border-color: var(--vnx-gray-300, #d1d5db);
    background:  var(--vnx-gray-100, #f3f4f6);
    color: var(--vnx-gray-500, #9ca3af);
    cursor: not-allowed;
    box-shadow: none;
}

/* Market details panel variant — sits below the long spec grid */
.vnx-ai-report-section--market {
    margin-top: 14px;
}

.vnx-ai-report-section__hint {
    display: block;
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--vnx-gray-600, #6b7280);
}

/* ── 落点② market card — cash button sits beside credit unlock ── */
.vnx-market-card__price .vnx-buy-btn { margin-left: 6px; }
.vnx-market-card__price { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* ── 落点③ inquiry modal cash unlock block ───────────────────── */
.vnx-inquiry-cashbuy {
    margin: 14px 0 0;
    padding: 12px;
    border: 1px dashed var(--vnx-gold-600, #B8860B);
    border-radius: 8px;
    background: var(--vnx-color-warning-bg, #fff8e6);
}
.vnx-inquiry-cashbuy__hint {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--vnx-gold-900, #6b4e0a);
}
.vnx-inquiry-cashbuy small {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--vnx-gray-600, #6b7280);
}

@media (max-width: 640px) {
    .vnx-buy-btn--report { min-width: 0; flex: 1 1 45%; }
}

/* ═══════════════════════════════════════════════════════════
   P37 — payment overlay: channel-choice modal + QR polling modal
   (XunhuPay CNY channels; same visual language as the buy buttons)
   ═══════════════════════════════════════════════════════════ */

.vnx-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 22, 40, 0.62);
}

.vnx-pay-modal {
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px 20px 18px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(10, 22, 40, 0.35);
    text-align: center;
}

.vnx-pay-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0A1628;
}

.vnx-pay-item {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: var(--vnx-gray-600, #6b7280);
}

/* Channel buttons */
.vnx-pay-chans {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 14px;
}

.vnx-pay-chan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--vnx-gray-200, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0A1628;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.vnx-pay-chan:hover { border-color: #1B4D85; box-shadow: 0 2px 8px rgba(27, 77, 133, 0.12); }
.vnx-pay-chan__amt { font-weight: 700; }
.vnx-pay-chan--wechat:hover { border-color: #07C160; box-shadow: 0 2px 8px rgba(7, 193, 96, 0.18); }
.vnx-pay-chan--wechat .vnx-pay-chan__amt { color: #07C160; }
.vnx-pay-chan--alipay:hover { border-color: #1677FF; box-shadow: 0 2px 8px rgba(22, 119, 255, 0.18); }
.vnx-pay-chan--alipay .vnx-pay-chan__amt { color: #1677FF; }

/* Cancel / retry ghost button */
.vnx-pay-cancel {
    display: inline-block;
    margin-top: 4px;
    padding: 6px 18px;
    border: 1px solid var(--vnx-gray-300, #d1d5db);
    border-radius: 6px;
    background: transparent;
    color: var(--vnx-gray-600, #6b7280);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.vnx-pay-cancel:hover { background: var(--vnx-gray-100, #f3f4f6); }
.vnx-qr-retry {
    margin-left: 8px;
    border-color: var(--vnx-gold-600, #B8860B);
    color: var(--vnx-gold-700, #8B6914);
}
.vnx-qr-retry:hover { background: var(--vnx-gold-600, #B8860B); color: #fff; }

/* QR modal */
.vnx-qr-amt {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--vnx-gray-600, #6b7280);
}
.vnx-qr-amt strong { color: #0A1628; font-size: 1.15rem; }

.vnx-qr-box {
    display: inline-block;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid var(--vnx-gray-200, #e5e7eb);
    border-radius: 10px;
    background: #fff;
}
.vnx-qr-canvas svg { display: block; width: 216px; height: 216px; }

.vnx-qr-tip {
    margin: 12px 0 4px;
    font-size: 0.8rem;
    color: var(--vnx-gray-600, #6b7280);
}

.vnx-qr-state {
    min-height: 1.2em;
    margin: 6px 0 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--vnx-gold-700, #8B6914);
}
.vnx-qr-state--ok  { color: var(--vnx-color-success, #219653); }
.vnx-qr-state--bad { color: #D64545; }

.vnx-qr-countdown {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--vnx-gray-500, #9ca3af);
}
