/**
 * Night Dragon B2C — 前台樣式
 *
 * @package NightDragonB2C
 * @version 1.0.0-beta
 */

/* ═══════════════════════════════════════════════════════════════
   詢價按鈕
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-quote-btn {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    color: #ffd700 !important;
    border: 2px solid #ffd700 !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ndb2c-quote-btn:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%) !important;
    color: #1a1a2e !important;
}

/* ═══════════════════════════════════════════════════════════════
    VIP 經銷價標籤 / B2B 價格包裝
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-b2b-price-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ndb2c-b2b-price-wrapper .ndb2c-vip-badge {
    display: inline-block;
    padding: 1px 7px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-size: 0.78em;
    border-radius: 3px;
    font-weight: 700;
    white-space: nowrap;
}

.ndb2c-wholesale {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #28a745;
    color: #fff;
    font-size: 0.85em;
    border-radius: 4px;
    font-weight: 600;
}

/* ── 確認下單按鈕 ── */
.ndb2c-btn-confirm-order {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #28a745 !important;
    font-weight: 600 !important;
    padding: 6px 16px !important;
    transition: all 0.2s ease;
}

.ndb2c-btn-confirm-order:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

.ndb2c-btn-confirm-order:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── 報價單操作結果提示 ── */
.ndb2c-quote-action-result {
    font-size: 0.85em;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   購物車追加推薦
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-cart-cross-sells {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.ndb2c-cross-sell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.ndb2c-cross-sell-item {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.ndb2c-cross-sell-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ndb2c-cross-sell-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
    border-radius: 4px;
}

.ndb2c-cross-sell-item .price {
    display: block;
    margin-top: 6px;
    font-weight: 700;
    color: #d63031;
}

/* ═══════════════════════════════════════════════════════════════
   商品推薦區塊
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-recommendations {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.ndb2c-recommendations h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #1a1a2e;
}

/* ═══════════════════════════════════════════════════════════════
   會員資訊卡
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-member-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d3436 100%);
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ndb2c-member-card h3 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.3em;
}

.ndb2c-member-card p {
    margin: 8px 0;
    font-size: 0.95em;
}

/* ═══════════════════════════════════════════════════════════════
   物流追蹤區塊
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-tracking {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 16px;
}

.ndb2c-tracking h3 {
    margin-top: 0;
    color: #1a1a2e;
}

.ndb2c-track-btn {
    display: inline-block;
    margin-top: 8px;
    background: #2171a0 !important;
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    transition: background 0.3s ease;
}

.ndb2c-track-btn:hover {
    background: #1a5a80 !important;
}

/* ═══════════════════════════════════════════════════════════════
   付款指引區塊
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-payment-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.ndb2c-bank-info {
    width: 100%;
    border-collapse: collapse;
}

.ndb2c-bank-info td {
    padding: 6px 0;
}

/* ═══════════════════════════════════════════════════════════════
   物流說明（結帳頁）
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-shipping-notes {
    margin: 15px 0;
    padding: 12px;
    background: #f0f8ff;
    border-left: 4px solid #2171a0;
    border-radius: 4px;
}

.ndb2c-shipping-notes strong {
    color: #1a1a2e;
}

/* ═══════════════════════════════════════════════════════════════
   RWD 響應式
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ndb2c-cross-sell-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ndb2c-quote-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ndb2c-cross-sell-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   儀表板 (Dashboard)
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.ndb2c-dashboard-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.ndb2c-dashboard-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    color: #1a1a2e;
    font-size: 1.2em;
}

/* ── 會員等級徽章 ── */
.ndb2c-tier-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 16px;
}

.ndb2c-tier-bronze {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: #fff;
}

.ndb2c-tier-silver {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: #1a1a2e;
}

.ndb2c-tier-gold {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
}

.ndb2c-tier-diamond {
    background: linear-gradient(135deg, #b9f2ff, #6c5ce7);
    color: #fff;
}

/* ── 升級進度條 ── */
.ndb2c-next-tier {
    margin: 12px 0 8px;
    font-size: 0.9em;
    color: #ffd700;
}

.ndb2c-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.ndb2c-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ── 表格 ── */
.ndb2c-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}

.ndb2c-table th {
    background: #1a1a2e;
    color: #ffd700;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
}

.ndb2c-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.ndb2c-table tbody tr:hover {
    background: #f8f9fa;
}

/* ── 訂單狀態標籤 ── */
.ndb2c-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.82em;
    font-weight: 600;
}

.ndb2c-status-completed { background: #d4edda; color: #155724; }
.ndb2c-status-processing { background: #cce5ff; color: #004085; }
.ndb2c-status-pending { background: #fff3cd; color: #856404; }
.ndb2c-status-on-hold { background: #fff3cd; color: #856404; }
.ndb2c-status-cancelled { background: #f8d7da; color: #721c24; }
.ndb2c-status-failed { background: #f8d7da; color: #721c24; }
.ndb2c-status-refunded { background: #e2e3e5; color: #383d41; }
.ndb2c-status-wc-ndb2c-shipped { background: #d1ecf1; color: #0c5460; }
.ndb2c-status-wc-ndb2c-delivered { background: #d4edda; color: #155724; }

/* ── 小按鈕 ── */
.ndb2c-btn-sm {
    display: inline-block;
    padding: 4px 12px;
    background: #2171a0;
    color: #fff !important;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none !important;
    transition: background 0.2s;
}

.ndb2c-btn-sm:hover {
    background: #1a5a80;
}

.ndb2c-view-all {
    text-align: right;
    margin-top: 12px;
}

.ndb2c-view-all a {
    color: #2171a0;
    text-decoration: none;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   詢價表單
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-quote-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.ndb2c-quote-form h2 {
    margin-top: 0;
    color: #1a1a2e;
    font-size: 1.4em;
    margin-bottom: 24px;
}

.ndb2c-quote-product {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.ndb2c-quote-product img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ndb2c-quote-product h3 {
    margin: 8px 0;
    color: #1a1a2e;
}

.ndb2c-quote-product .price {
    font-weight: 700;
    color: #d63031;
    font-size: 1.1em;
}

.ndb2c-form-row {
    margin-bottom: 18px;
}

.ndb2c-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.ndb2c-form-row input[type="text"],
.ndb2c-form-row input[type="number"],
.ndb2c-form-row textarea,
.ndb2c-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.ndb2c-form-row input:focus,
.ndb2c-form-row textarea:focus {
    border-color: #ffd700;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.ndb2c-btn-primary {
    background: linear-gradient(135deg, #1a1a2e, #16213e) !important;
    color: #ffd700 !important;
    border: 2px solid #ffd700 !important;
    padding: 12px 32px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ndb2c-btn-primary:hover {
    background: linear-gradient(135deg, #ffd700, #ffaa00) !important;
    color: #1a1a2e !important;
}

/* ── 商品搜尋結果下拉 ── */
.ndb2c-search-results {
    position: absolute;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.ndb2c-search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.ndb2c-search-result-item:hover {
    background: #fffde7;
}

/* ═══════════════════════════════════════════════════════════════
   登入提示區塊
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-login-prompt {
    text-align: center;
    padding: 60px 30px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    max-width: 500px;
    margin: 40px auto;
}

.ndb2c-login-prompt p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 24px;
}

.ndb2c-login-prompt .button {
    margin: 0 8px;
}

/* ═══════════════════════════════════════════════════════════════
   物流追蹤項目
   ═══════════════════════════════════════════════════════════════ */
.ndb2c-tracking-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ndb2c-tracking-item:last-child {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════
   頁面層級 (body class)
   ═══════════════════════════════════════════════════════════════ */
body.ndb2c-page {
    background: #f5f6fa;
}

/* ═══════════════════════════════════════════════════════════════
   RWD 響應式 (擴充)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ndb2c-dashboard {
        padding: 10px;
    }

    .ndb2c-dashboard-section {
        padding: 16px;
    }

    .ndb2c-table {
        font-size: 0.82em;
    }

    .ndb2c-table th,
    .ndb2c-table td {
        padding: 8px 10px;
    }

    .ndb2c-quote-form {
        padding: 20px;
    }

    .ndb2c-login-prompt {
        padding: 40px 20px;
    }
}
