.wpqb-modal[hidden] {
  display: none !important;
}

body.wpqb-modal-open {
  overflow: hidden;
}

.wpqb-open-quickbuy {
  margin-top: 10px;
}

.wpqb-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.wpqb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.62);
}

.wpqb-modal__dialog {
  position: relative;
  max-width: 960px;
  width: calc(100% - 32px);
  margin: 32px auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 22px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.wpqb-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.wpqb-modal__content {
  max-height: calc(100vh - 64px);
  overflow: auto;
}

.wpqb-modal__loading {
  padding: 56px 24px;
  text-align: center;
  font-size: 16px;
}

.wpqb-sheet__header {
  padding: 18px 24px;
  background: #0f766e;
  color: #ffffff;
}

.wpqb-sheet__title {
  padding-right: 48px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

.wpqb-sheet__body {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
  padding: 24px;
}

.wpqb-sheet__product,
.wpqb-sheet__form {
  min-width: 0;
}

.wpqb-product-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

.wpqb-product-card__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #f8fafc;
}

.wpqb-product-card__name {
  margin-bottom: 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: #111827;
}

.wpqb-product-card__price {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
  color: #0f766e;
}

.wpqb-product-card__price .price {
  color: inherit;
}

.wpqb-product-card__stock,
.wpqb-product-card__stock p {
  margin: 0;
  color: #4b5563;
}

.wpqb-form {
  margin: 0;
}

.wpqb-form__section {
  margin-bottom: 20px;
}

.wpqb-form__heading {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.wpqb-fields {
  display: grid;
  gap: 12px;
}

.wpqb-fields--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wpqb-field {
  display: grid;
  gap: 8px;
}

.wpqb-field__label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.wpqb-field__control {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

.wpqb-field__control--textarea {
  min-height: 92px;
  resize: vertical;
}

.wpqb-radios {
  display: grid;
  gap: 10px;
}

.wpqb-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #111827;
}

.wpqb-radio input {
  margin: 0;
}

.wpqb-coupon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.wpqb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.wpqb-button:disabled,
.wpqb-qty__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wpqb-button--primary {
  width: 100%;
  background: #14532d;
  color: #ffffff;
}

.wpqb-button--ghost {
  background: #e7f5f4;
  color: #115e59;
}

.wpqb-qty {
  margin-bottom: 18px;
}

.wpqb-qty__controls {
  display: inline-grid;
  grid-template-columns: 44px minmax(90px, 110px) 44px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.wpqb-qty__button {
  width: 44px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 20px;
  cursor: pointer;
}

.wpqb-qty__input {
  width: 100%;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  text-align: center;
}

.wpqb-message {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.wpqb-message--hint {
  background: #f8fafc;
  color: #334155;
}

.wpqb-message--error {
  background: #fef2f2;
  color: #991b1b;
}

.wpqb-message--success {
  background: #ecfdf5;
  color: #166534;
}

.wpqb-totals {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.wpqb-totals__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #374151;
}

.wpqb-totals__row strong {
  color: #111827;
}

.wpqb-totals__row--total {
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  font-size: 18px;
}

.wpqb-feedback {
  min-height: 20px;
  margin-bottom: 12px;
  font-size: 14px;
}

.wpqb-feedback--error {
  color: #991b1b;
}

.wpqb-feedback--success {
  color: #166534;
}

.wpqb-success {
  padding: 56px 24px;
  text-align: center;
}

.wpqb-success__title {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.35;
}

.wpqb-success__order {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #14532d;
}

@media (max-width: 782px) {
  .wpqb-modal__dialog {
    width: calc(100% - 16px);
    margin: 8px auto;
    border-radius: 16px;
  }

  .wpqb-modal__content {
    max-height: calc(100vh - 16px);
  }

  .wpqb-sheet__body {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 18px;
  }

  .wpqb-fields--two,
  .wpqb-product-card {
    grid-template-columns: 1fr;
  }

  .wpqb-product-card__media {
    max-width: 180px;
  }

  .wpqb-coupon {
    grid-template-columns: 1fr;
  }
}
