/* =========================
   AFF GATE – Chap Gate UI
   Thay .cg-gate bằng wrapper thực tế nếu khác
   ========================= */
.cg-shopee-gate{
  --cg-border: #e5e7eb;
  --cg-bg: #ffffff;
  --cg-card: #f8fafc;
  --cg-text: #0f172a;
  --cg-muted: #64748b;
  --cg-brand: #ee4d2d;      /* Shopee cam */
  --cg-brand-dark: #d83e21;
  --cg-radius: 14px;
  --cg-shadow: 0 8px 24px rgba(2,8,23,.06);
  background: var(--cg-card);
  border: 1px solid var(--cg-border);
  border-radius: var(--cg-radius);
  padding: 20px;
  margin: 24px auto;
  box-shadow: var(--cg-shadow);
  color: var(--cg-text);
}

.cg-shopee-gate .row {    text-align: center;}
.cg-shopee-gate .row h2 {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 5px;
}
.cg-shopee-gate .row h3{
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  text-align: center;
}
.cg-shopee-gate .row p{
  font-size: 14px;
  color: var(--cg-muted);
  margin: 0;
  text-align: center; /* căn giữa dòng “Nhấn nút để tiếp tục đọc.” */
}
.cg-shopee-gate .row .media {
    padding: 20px;
    margin: 10px;
}

/* Biến TẤT CẢ link bên trong gate thành nút đẹp –
   phù hợp khi plugin chỉ in ra 1 link “Mở Shopee”. */
.cg-shopee-cta{
      text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--cg-brand);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  letter-spacing: .2px;
  transition: background .15s ease, transform .1s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.06) inset;
}
.cg-shopee-cta:hover{ background: var(--cg-brand-dark); }
.cg-shopee-cta:active{ transform: translateY(1px); }



/* Responsive */
@media (max-width: 640px){
.cg-shopee-gate{ padding: 16px; }
.cg-shopee-cta{ height: 42px; min-width: 200px; }
}

.cg-shopee-gate h1.uk-h2.uk-heading-divider {
    text-align: center;
}
/* ???????????????????????????????????????????? */

/* CG VIP Shop - Colorful & Clean */
.cg-vip-shop {
    position: relative;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Card Styles --- */
.cg-plan-card {
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.cg-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    border-color: transparent;
}

/* Tier Colors */
.cg-tier-1 .cg-card-header { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.cg-tier-2 .cg-card-header { background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%); }
.cg-tier-3 .cg-card-header { background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }

.cg-tier-1 .uk-button-primary { background-image: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.cg-tier-2 .uk-button-primary { background-image: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25); }
.cg-tier-3 .uk-button-primary { background-image: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }

/* Header */
.cg-card-header {
    padding: 20px 15px;
    text-align: center;
    color: #fff;
    position: relative;
}
.cg-plan-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cg-badge-popular {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 10px; font-weight: bold;
    padding: 2px 8px; border-radius: 20px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

/* Body */
.cg-card-body { padding: 20px; text-align: center; }
.cg-price-box .uk-h1 { font-size: 2.2rem; font-weight: 800; color: #333; margin: 0; line-height: 1; }
.cg-price-unit { font-size: 0.9rem; color: #666; vertical-align: super; }
.cg-wallet-price {
    background: #f3f4f6; color: #4b5563;
    padding: 4px 12px; border-radius: 20px;
    display: inline-flex; align-items: center;
    font-size: 0.85rem; font-weight: 500;
    margin-top: 8px;
}
.cg-benefit-list { margin: 15px 0 0 0; padding: 0; list-style: none; text-align: left; display: inline-block; }
.cg-benefit-list li { font-size: 0.9rem; color: #555; margin-bottom: 6px; display: flex; align-items: center; }
.cg-benefit-list li .uk-icon { color: #16a34a; margin-right: 8px; width: 16px; }

/* Footer & Buttons */
.cg-card-footer { padding: 0 20px 20px 20px; }
.cg-vip-shop .uk-button {
    font-weight: 600; text-transform: none; font-size: 14px;
    border-radius: 8px; height: 40px; line-height: 38px;
    width: 100%; box-sizing: border-box; /* Fix lệch width */
}
/* Fix lỗi lệch nút khi dùng grid */
.cg-btn-stack { display: flex; flex-direction: column; gap: 8px; }

.transform-scale { transform: scale(1.05); z-index: 2; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border:none; }
@media (max-width: 959px) { .transform-scale { transform: scale(1); margin-bottom: 20px; } }


/* --- NEW MODAL STYLES (Fix lệch VietQR) --- */
.cg-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
}
.cg-modal-backdrop {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.cg-modal-content {
    background: #fff;
    width: min(400px, 92vw);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 10;
}
.cg-close {
    position: absolute; right: 12px; top: 12px;
    background: transparent; border: none; cursor: pointer;
    color: #94a3b8; transition: color 0.2s;
    padding: 4px;
}
.cg-close:hover { color: #334155; }

/* QR Scan Area */
.cg-qr-frame {
    display: inline-block;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
#cg-qr-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    width: 220px; /* Cố định width để không bị nhảy */
    height: 220px;
    object-fit: contain;
}

/* Info Box */
.cg-transfer-info {
    border: 1px solid #f1f5f9;
}
.cg-info-row {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 8px !important;
}
.cg-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0 !important;
}
.cg-label { white-space: nowrap; margin-right: 10px; }
.cg-value { text-align: right; word-break: break-all; justify-content: flex-end; width: 100%; }
.cg-copy-btn {
    width: 28px; height: 28px;
    border: 1px solid #cbd5e1;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.cg-copy-btn:hover { border-color: #3b82f6; color: #3b82f6; }

/* Account Table */
.cg-table-orders { width:100%; border-collapse: collapse; margin-top: 15px; }
.cg-table-orders th { text-align: left; color: #666; font-size: 0.85rem; padding: 10px; border-bottom: 2px solid #eee; }
.cg-table-orders td { padding: 12px 10px; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.cg-status-label { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; text-transform: uppercase; font-weight: bold; }
.cg-vip-order[data-status="paid"] .cg-status-label { background: #dcfce7; color: #166534; }
.cg-vip-order[data-status="pending"] .cg-status-label { background: #fef9c3; color: #854d0e; }
