/*
 * Modal "Mua ngay" dùng chung cho mọi site.
 * Style trung tính — mỗi site override bằng CSS variables (khai báo trên :root
 * hoặc body của site đó), KHÔNG sửa trực tiếp file này.
 *
 * Variables có thể override:
 *   --buy-modal-accent        màu nhấn (nút, viền focus)       mặc định #2563eb
 *   --buy-modal-accent-text   màu chữ trên nền accent           mặc định #ffffff
 *   --buy-modal-bg            nền hộp modal                     mặc định #ffffff
 *   --buy-modal-text          màu chữ chính                     mặc định #111827
 *   --buy-modal-muted         màu chữ phụ                       mặc định #6b7280
 *   --buy-modal-border        màu viền                          mặc định #e5e7eb
 *   --buy-modal-radius        bo góc hộp modal                  mặc định 16px
 *   --buy-modal-font          font-family                       mặc định hệ thống
 */

.buy-modal-overlay {
  --buy-modal-accent: #2563eb;
  --buy-modal-accent-text: #ffffff;
  --buy-modal-bg: #ffffff;
  --buy-modal-text: #111827;
  --buy-modal-muted: #6b7280;
  --buy-modal-border: #e5e7eb;
  --buy-modal-radius: 16px;
  --buy-modal-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 15, 20, 0.6);
  font-family: var(--buy-modal-font);
  animation: buy-modal-fade-in 0.15s ease-out;
}

.buy-modal-overlay[hidden] {
  display: none;
}

@keyframes buy-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.buy-modal-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--buy-modal-bg);
  color: var(--buy-modal-text);
  border-radius: var(--buy-modal-radius);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: buy-modal-slide-up 0.2s ease-out;
}

@keyframes buy-modal-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.buy-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--buy-modal-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.buy-modal-close:hover,
.buy-modal-close:focus-visible {
  background: var(--buy-modal-border);
  color: var(--buy-modal-text);
}

.buy-modal-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.buy-modal-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--buy-modal-muted);
}

.buy-modal-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--buy-modal-accent);
  margin-bottom: 20px;
}

.buy-modal-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--buy-modal-border);
  border-radius: calc(var(--buy-modal-radius) - 4px);
  margin-bottom: 20px;
}

.buy-modal-qr-wrap img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.buy-modal-qr-note {
  font-size: 12px;
  color: var(--buy-modal-muted);
  text-align: center;
}

.buy-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.buy-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--buy-modal-border);
  background: transparent;
  color: var(--buy-modal-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.buy-modal-btn:hover,
.buy-modal-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.buy-modal-btn-primary {
  grid-column: 1 / -1;
  background: var(--buy-modal-accent);
  color: var(--buy-modal-accent-text);
  border-color: transparent;
}

.buy-modal-contact-email {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--buy-modal-muted);
  text-decoration: none;
  margin-top: 4px;
}

.buy-modal-contact-email:hover {
  color: var(--buy-modal-accent);
}

@media (prefers-color-scheme: dark) {
  .buy-modal-overlay {
    --buy-modal-bg: #1a1a1f;
    --buy-modal-text: #f3f4f6;
    --buy-modal-muted: #9ca3af;
    --buy-modal-border: #33333a;
  }
}
