button.quick-buy-btn.button {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  min-width: 70%;
}

button.quick-buy-btn.button:hover {
  box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
}

.btn-subtext {
  font-size: 0.9rem;
  text-transform: capitalize;
  font-weight: normal;
}

/* =========================================================
   QUICK BUY POPUP - COMPLETE SCOPED STYLES
   Author: Van Danh Ho (optimized, no-theme-override)
   ========================================================= */

/* ---------- THEME VARIABLES ---------- */
:root {
  --qbp-primary: #1e73be;
  --qbp-primary-2: #2795f7;
  --qbp-accent: #ff6b6b;
  --qbp-gray-light: #f6f7f8;
  --qbp-border: #e6e6e6;
  --qbp-danger: #dc3545;
  --qbp-success: #28a745;
  --qbp-text: #222;
  --qbp-radius: 8px;
  --qbp-gap: 6px;
  /* global small spacing */
}

/* ========== SCOPE RESET ========== */
/* Force scoped rules to win against theme defaults */
.qbp-modal * {
  box-sizing: border-box !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.qbp-modal-content input,
.qbp-modal-content textarea,
.qbp-modal-content select,
.qbp-modal-content label,
.qbp-modal-content button {
  margin: 0 !important;
}

/* ========== OVERLAY / MODAL WRAPPER ========== */
.qbp-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999999999;
  -webkit-tap-highlight-color: transparent;
}

.qbp-modal.qbp-hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ========== MODAL CONTENT ========== */
.qbp-modal-content {
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  overflow: hidden;
  border-radius: calc(var(--qbp-radius));
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: none !important;
  /* avoid theme box-shadow */
  outline: 0;
  transform: translateY(0);
  animation: qbp-fadeIn 220ms ease;
}

.qbp-modal-content button,
.qbp-modal-content input {
  margin: 0 !important;
}

/* header */
.qbp-modal-content .qbp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  /* keep existing inline gradient if set on element; fallback: */
  background: linear-gradient(90deg, var(--qbp-primary-2) 0%, var(--qbp-primary) 100%);
  color: #fff;
  gap: var(--qbp-gap);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.qbp-modal-content .qbp-product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin: 0;
  padding-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qbp-modal-content .qbp-close-btn {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  font-size: 20px !important;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

/* ========== BODY (GRID) ========== */
.qbp-modal-content .qbp-modal-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  padding: 10px 12px;
  align-items: start;
  overflow: auto;
}

/* left column (image) */
.qbp-modal-content .qbp-col-left {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--qbp-gray-light);
  border-radius: calc(var(--qbp-radius) - 2px);
  padding: 8px;
  min-height: 160px;
}

.qbp-modal-content .qbp-product-image {
  width: 100%;
  height: auto;
  max-width: 240px;
  border-radius: 4px;
  display: block;
  border: 1px solid var(--qbp-border);
  object-fit: cover;
}

/* right column (form) */
.qbp-modal-content .qbp-col-right {
  display: flex;
  flex-direction: column;
}

/* ========== PRICE & INFO ========== */
.qbp-modal-content .qbp-product-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--qbp-accent);
  padding: 8px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.06), rgba(255, 82, 82, 0.03));
  border: 1px solid rgba(255, 107, 107, 0.06);
  margin: 6px 0;
}

/* strike/ins */
.qbp-modal-content .qbp-product-price del {
  color: #9b9b9b;
  font-size: 0.95rem;
  opacity: 0.8;
  text-decoration: line-through;
}

.qbp-modal-content .qbp-product-price ins {
  text-decoration: none;
  background: linear-gradient(45deg, var(--qbp-accent), #ff8a8a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ========== FORM LAYOUT ========== */
/* reduce spacing: use smaller gap variables */
.qbp-modal-content .qbp-form {
  display: flex;
  flex-direction: column;
  gap: var(--qbp-gap);
  margin: 0;
  padding: 0;
}

/* groups */
.qbp-form-group.soluong {
  display: flex;
  justify-content: space-between
}

/* Quantity Controls */
.qbp-quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--qbp-border);
  border-radius: 4px;
  overflow: hidden;
  max-width: 120px;
  flex: 0 0 68%;
  background: #fff;
}

.qbp-qty-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: #f5f5f5 !important;
  color: #333 !important;
  font-size: 16px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s !important;
}

.qbp-qty-btn:hover {
  background: #e0e0e0 !important;
}

.qbp-modal-content input.qbp-qty-input {
  flex: 1 !important;
  width: 100% !important;
  height: 32px !important;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  text-align: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.qbp-modal-content input.qbp-qty-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: #fff !important;
}

.qbp-qty-input::-webkit-outer-spin-button,
.qbp-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
}

.qbp-modal-content .qbp-form-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qbp-form-group.qbp-variant-group {
  display: flex;
  justify-content: space-between
}

.qbp-modal-content .qbp-form-group label {
  flex: 0 0 28%;
  font-size: 13px;
  color: var(--qbp-text);
  font-weight: 600;
}

.qbp-modal-content .qbp-form-group select {
  flex: 0 0 68%;
  font-size: 13px;
  color: var(--qbp-text);
  font-weight: 600;
}

/* ========== INPUTS (no shadows, no external overrides) ========== */
.qbp-modal-content input.qbp-input,
.qbp-modal-content textarea.qbp-input,
.qbp-modal-content select.qbp-variant-select {
  width: 100% !important;
  padding: 7px 10px !important;
  font-size: 13px !important;
  color: var(--qbp-text) !important;
  background: #fff !important;
  border: 1px solid var(--qbp-border) !important;
  border-radius: 4px;
  outline: none !important;
  box-shadow: none !important;
  /* remove shadow */
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  transition: border-color 120ms linear !important;
}

/* ensure theme focus styles do not apply */
.qbp-modal-content input.qbp-input:focus,
.qbp-modal-content textarea.qbp-input:focus,
.qbp-modal-content select.qbp-variant-select:focus {
  border-color: var(--qbp-primary) !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  background: #fff !important;
  outline: none !important;
}

/* invalid state simplified */
.qbp-modal-content .qbp-input:invalid {
  border-color: #e0d6d6 !important;
}

/* textarea specifics */
.qbp-modal-content textarea.qbp-input {
  min-height: 48px !important;
  height: 48px !important;
  resize: none !important;
}

/* ========== VARIANTS (compact) ========== */
.qbp-modal-content .qbp-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* ========== COUPON (compact, inline, no-theme-override) ========== */
.qbp-modal-content .qbp-coupon-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Input gọn gàng, không shadow */
.qbp-modal-content .qbp-coupon-wrapper .qbp-input {
  flex: 1 1 auto !important;
  padding: 8px 10px !important;
  border: 1px solid #ccc !important;
  border-radius: 4px;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 14px !important;
  height: 38px !important;
}

.qbp-modal-content .qbp-coupon-wrapper .qbp-input:focus {
  border-color: #ff9a2b !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Nút áp dụng */
.qbp-modal-content .qbp-coupon-wrapper .qbp-apply-coupon-btn {
  flex: 0 0 auto !important;
  background: linear-gradient(90deg, #ff7a00, #ff9a2b) !important;
  color: #fff;
  border-radius: 4px;
  border: none !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  outline: none !important;
  white-space: nowrap !important;
}

.qbp-modal-content .qbp-coupon-wrapper .qbp-apply-coupon-btn:hover {
  opacity: 0.9 !important;
}

.qbp-modal-content .qbp-coupon-wrapper .qbp-apply-coupon-btn:active,
.qbp-modal-content .qbp-coupon-wrapper .qbp-apply-coupon-btn:focus {
  outline: none !important;
  box-shadow: none !important;
}


/* ========== TOTAL / SUBMIT ========== */
.qbp-modal-content .qbp-total-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  padding: 6px 10px;
  background: var(--qbp-gray-light);
  border-radius: 4px;
  margin-top: 6px;
}

.qbp-modal-content .qbp-price-value {
  color: var(--qbp-primary);
  font-size: 1.05rem;
}

/* full-width submit button (compact) */
.qbp-modal-content .qbp-submit-btn {
  width: 100%;
  padding: 8px 10px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--qbp-primary), var(--qbp-primary-2));
  color: #fff !important;
  font-weight: 700;
  border: none !important;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: none !important;
  font-size: 14px !important;
}

.qbp-modal-content .qbp-submit-btn:disabled {
  background: #d3d3d3 !important;
  cursor: not-allowed !important;
}

/* ========== BUTTON ROW (desktop fallback & mobile fixed) ========== */
.qbp-modal-content .qbp-button-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

/* scoped close button variant (inside content) */
.qbp-modal-content .qbp-close-btn[data-product-id] {
  background: #f1f1f1 !important;
  color: #333 !important;
  border-radius: 4px;
  padding: 9px 12px !important;
  border: none !important;
  cursor: pointer !important;
}

/* ========== FEEDBACK / MESSAGES / SPINNER ========== */
.qbp-modal-content .qbp-warning {
  color: var(--qbp-danger);
  font-size: 12px;
  margin-top: 6px;
  display: none;
}

.qbp-modal-content .qbp-warning.qbp-visible {
  display: block;
}

.qbp-modal-content .qbp-coupon-message {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
}

.qbp-modal-content .qbp-coupon-message.qbp-success {
  color: var(--qbp-success);
}

.qbp-modal-content .qbp-coupon-message.qbp-error {
  color: var(--qbp-danger);
}

/* toast message (global, still scoped visually) */
.qbp-message {
  position: fixed;
  top: 18px;
  right: 18px;
  background: var(--qbp-success);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: none !important;
  z-index: 120000;
  animation: qbp-slideIn 240ms ease;
}

.qbp-message.qbp-error {
  background: var(--qbp-danger);
}

/* spinner (no theme interference) */
.qbp-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qbp-spin 0.8s linear infinite;
  margin-right: 8px;
}

/* ========== KEYFRAMES ========== */
@keyframes qbp-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes qbp-slideIn {
  from {
    transform: translateX(120px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes qbp-fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESPONSIVE (mobile compact & bottom action) ========== */
@media (max-width: 768px) {
  button.quick-buy-btn.button {
    width: 100%;
  }

  .qbp-modal {
    align-items: flex-end;
    padding: 0;
  }

  .qbp-modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    overflow: auto;
    animation: qbp-slide-up 240ms ease-out;
  }

  /* Giảm padding của header */
  .qbp-modal-content .qbp-modal-header {
    padding: 6px 10px !important;
  }

  .qbp-modal-content .qbp-product-name {
    font-size: 0.9rem !important;
  }

  .qbp-modal-content .qbp-close-btn {
    font-size: 18px !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 28px !important;
  }

  /* Giảm padding của body */
  .qbp-modal-content .qbp-modal-body {
    display: flex;
    flex-direction: column;
    gap: 4px !important;
    padding: 8px 10px !important;
  }

  /* hide left column image for compactness */
  .qbp-modal-content .qbp-col-left {
    display: none;
  }

  /* Giảm kích thước text và padding của các input/select/textarea */
  .qbp-modal-content input.qbp-input,
  .qbp-modal-content textarea.qbp-input,
  .qbp-modal-content select.qbp-variant-select {
    padding: 5px 8px !important;
    font-size: 12px !important;
  }

  .qbp-modal-content textarea.qbp-input {
    min-height: 45px !important;
  }

  .qbp-modal-content .qbp-form-group label {
    font-size: 12px !important;
    flex: 0 0 28% !important;
  }

  .qbp-modal-content .qbp-form-group select {
    flex: 0 0 68% !important;
  }

  .qbp-form-group.soluong,
  .qbp-form-group.qbp-variant-group {
    gap: 4px !important;
  }

  .qbp-quantity-controls {
    flex: 0 0 68% !important;
    height: 28px !important;
  }



  .qbp-qty-btn,
  .qbp-qty-input {
    height: 28px !important;
    font-size: 14px !important;
  }

  /* fixed bottom footer for quick checkout (contains total price & submit button) */
  .qbp-modal-content .qbp-form-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 12px !important;
    background: #fff;
    border-top: 1px solid var(--qbp-border);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .qbp-modal-content .qbp-total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 !important;
    background: transparent !important;
    margin: 0 !important;
    border: none !important;
    font-size: 13px !important;
  }

  .qbp-modal-content .qbp-price-value {
    font-size: 14px !important;
  }

  .qbp-modal-content .qbp-button-row {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    width: 100% !important;
  }

  .qbp-modal-content .qbp-submit-btn {
    width: 100% !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
  }

  /* ensure form content not hidden behind fixed footer */
  .qbp-modal-content .qbp-form {
    margin-bottom: 95px !important;
  }

  /* Khi gõ phím trên mobile (bàn phím ảo bật lên) */
  .qbp-modal:focus-within {
    align-items: flex-start !important;
    /* Dịch popup lên sát đỉnh màn hình */
  }

  .qbp-modal:focus-within .qbp-modal-content {
    border-radius: 0 0 12px 12px !important;
    /* Đổi bo góc xuống dưới khi dính đỉnh */
    max-height: 100vh !important;
    /* Cho phép chiếm tối đa màn hình */
  }

  .qbp-modal-content .qbp-form:focus-within {
    margin-bottom: 0 !important;
    /* Không chừa khoảng trống margin-bottom cho footer fixed */
  }

  .qbp-modal-content .qbp-form:focus-within .qbp-form-footer {
    position: static !important;
    /* Đẩy footer xuống cuối luồng cuộn tự nhiên của form */
    border-top: none !important;
    padding: 10px 0 0 0 !important;
    box-shadow: none !important;
  }

  .qbp-modal-content .qbp-form:focus-within .qbp-submit-btn {
    border-radius: 6px !important;
  }
}

@keyframes qbp-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========== RESULT OVERLAY ========== */
.qbp-modal-content {
  position: relative !important;
}

.qbp-result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
  text-align: center;
  animation: qbp-fadeIn 200ms ease;
}

.qbp-result-content {
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qbp-result-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
}

.qbp-result-overlay.qbp-success .qbp-result-icon {
  background: #d4edda;
  color: #155724;
}

.qbp-result-overlay.qbp-error .qbp-result-icon {
  background: #f8d7da;
  color: #721c24;
}

.qbp-result-body {
  font-size: 15px;
  line-height: 1.5;
  color: #333;
}

.qbp-result-timer {
  font-size: 13px;
  color: #666;
}

.qbp-result-close-btn {
  margin-top: 8px !important;
  padding: 8px 24px !important;
  background: #1e73be !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

/* ========== CONTACT MODE STYLES ========== */
.qbp-contact-note-banner {
  background: #eef7ff;
  border: 1px solid #cce5ff;
  color: #004085;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.qbp-modal.qbp-mode-contact .khuyenmai,
.qbp-modal.qbp-mode-contact .qbp-total-price {
  display: none !important;
}

.quick-buy-btn.qbp-btn-contact .btn-text {
  letter-spacing: 0.2px;
}