@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

:root {
  --sepay-primary: #6C3AED;
  --sepay-primary-hover: #5A2DC6;
  --sepay-accent: #FACC15;
  --sepay-bg: #ffffff;
  --sepay-text: #1A103C;
  --sepay-text-muted: #645F75;
  --sepay-border: #E5E7EB;
  --sepay-input-bg: #F9FAFB;
  --sepay-font: 'Be Vietnam Pro', sans-serif;
  --sepay-radius: 12px;
  --sepay-shadow: 0 10px 40px rgba(26, 16, 60, 0.15);
}

.sepay-qb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 16, 60, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  font-family: var(--sepay-font);
  color: var(--sepay-text);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sepay-qb-overlay.show {
  display: flex;
  opacity: 1;
}

.sepay-qb-modal {
  width: min(92vw, 500px);
  background: var(--sepay-bg);
  border-radius: calc(var(--sepay-radius) + 4px);
  box-shadow: var(--sepay-shadow);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sepay-qb-overlay.show .sepay-qb-modal {
  transform: translateY(0);
}

.sepay-qb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--sepay-border);
  background: var(--sepay-bg);
}

.sepay-qb-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--sepay-text);
}

.sepay-qb-close {
  border: 0;
  background: transparent;
  color: var(--sepay-text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  aspect-ratio: 1;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sepay-qb-close:hover {
  background: var(--sepay-input-bg);
  color: var(--sepay-primary);
}

.sepay-qb-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.sepay-qb-product {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--sepay-input-bg);
  border-radius: var(--sepay-radius);
  border: 1px solid var(--sepay-border);
}

.sepay-qb-product img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sepay-qb-product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sepay-qb-product-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
  line-height: 1.4;
  color: var(--sepay-text);
}

.sepay-qb-price {
  color: var(--sepay-primary);
  font-weight: 700;
  font-size: 16px;
}

.sepay-qb-field {
  margin: 16px 0;
}

.sepay-qb-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--sepay-text);
}

.sepay-qb-field input, .sepay-qb-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--sepay-border);
  border-radius: var(--sepay-radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--sepay-text);
  background: var(--sepay-bg);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.sepay-qb-field input:focus, .sepay-qb-field select:focus {
  outline: none;
  border-color: var(--sepay-primary);
  box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.15);
}

.sepay-qb-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.sepay-qb-btn {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--sepay-radius);
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sepay-qb-btn-primary {
  background: var(--sepay-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 58, 237, 0.25);
}

.sepay-qb-btn-primary:hover {
  background: var(--sepay-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 58, 237, 0.3);
}

.sepay-qb-btn-secondary {
  background: var(--sepay-input-bg);
  color: var(--sepay-text);
  border: 1px solid var(--sepay-border);
}

.sepay-qb-btn-secondary:hover {
  background: #E5E7EB;
}

.sepay-qb-note {
  font-size: 13px;
  color: var(--sepay-text-muted);
  margin-top: 16px;
  line-height: 1.5;
  text-align: center;
  background: var(--sepay-input-bg);
  padding: 10px;
  border-radius: 8px;
}

.sepay-qb-note strong {
  color: var(--sepay-primary);
}

.sepay-qb-error {
  background: #FEF2F2;
  color: #DC2626;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
  border-left: 4px solid #DC2626;
}

.sepay-qb-loading .sepay-qb-modal {
  opacity: 0.7;
  pointer-events: none;
}

/* Pay Modal Overrides */
.sepay-qb-pay-modal {
  width: min(96vw, 1000px);
  height: min(92vh, 740px);
}

.sepay-qb-pay-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sepay-qb-iframe {
  flex: 1;
  width: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.sepay-qb-pay-status {
  padding: 16px 20px;
  border-top: 1px solid var(--sepay-border);
  font-size: 14px;
  font-weight: 500;
  color: var(--sepay-primary);
  background: var(--sepay-input-bg);
  text-align: center;
}

/* Hiding theme elements on thankyou page */
#sepay-qb-pay-overlay .site-header-row,
#sepay-qb-pay-overlay.elementor-location-header,
#sepay-qb-pay-overlay.elementor-location-footer,
.entry-hero.page-hero-section .entry-header,
#sepay-qb-pay-overlay .woocommerce .woocommerce-order-downloads,
.woocommerce .woocommerce-customer-details,
.woocommerce .woocommerce-order-details,
.woocommerce ul.woocommerce-order-overview.woocommerce-thankyou-order-details,
body.woocommerce-order-received .single-content p {display: none}
body.woocommerce-order-received header.elementor-location-header,
body.woocommerce-order-received footer.elementor-location-footer { display: none !important; }
.woocommerce-sepay-bank-details {max-width: 950px; margin-top: 15px;}
.woocommerce-notice .woocommerce-notice--success .woocommerce-thankyou-order-received {display: none;}
body.woocommerce-order-received .entry-content-wrap {padding: 0px}

/* Mobile responsive */
@media (max-width: 480px) {
  .sepay-qb-header { padding: 16px; }
  .sepay-qb-body { padding: 16px; }
  .sepay-qb-product { padding: 12px; gap: 12px; }
  .sepay-qb-actions { flex-direction: column; }
}

/* Global Spinner */
.sepay-qb-global-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sepay-qb-global-loader.show {
  opacity: 1;
  pointer-events: all;
}

.sepay-qb-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--sepay-border);
  border-left-color: var(--sepay-primary);
  border-radius: 50%;
  animation: sepay-spin 0.9s linear infinite;
  box-shadow: 0 0 20px rgba(108, 58, 237, 0.25);
}

@keyframes sepay-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
