/* ═══════════════════════════════════════════
   ORDER FORM STYLES
   ═══════════════════════════════════════════ */

.qt-order-section {
  background: linear-gradient(180deg, var(--qt-bg-soft) 0%, var(--qt-bg) 100%);
}

.qt-order-section__subtitle {
  text-align: center;
  color: var(--qt-text-secondary);
  font-size: var(--qt-fs-sm);
  margin-bottom: var(--qt-space-xl);
}

/* ── Form Layout ──────────────────────────── */
.qt-form {
  max-width: 520px;
  margin: 0 auto;
  background: var(--qt-bg-card);
  border-radius: var(--qt-radius-lg);
  padding: var(--qt-space-xl);
  box-shadow: var(--qt-shadow-lg);
  border: 1px solid var(--qt-border-light);
}

.qt-form__group {
  margin-bottom: var(--qt-space-md);
}

.qt-form__row {
  display: flex;
  gap: var(--qt-space-md);
}

.qt-form__group--half {
  flex: 1;
}

.qt-form__label {
  display: block;
  font-size: var(--qt-fs-sm);
  font-weight: var(--qt-fw-semibold);
  color: var(--qt-text);
  margin-bottom: var(--qt-space-xs);
}

.qt-required {
  color: var(--qt-primary);
}

/* ── Inputs ───────────────────────────────── */
.qt-form__input,
.qt-form__select,
.qt-form__textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--qt-border);
  border-radius: var(--qt-radius-md);
  font-size: var(--qt-fs-base);
  color: var(--qt-text);
  background: var(--qt-bg);
  transition: border-color var(--qt-transition-fast), box-shadow var(--qt-transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.qt-form__input:focus,
.qt-form__select:focus,
.qt-form__textarea:focus {
  outline: none;
  border-color: var(--qt-primary);
  box-shadow: 0 0 0 3px var(--qt-primary-glow);
}

.qt-form__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23616161' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.qt-form__select:disabled {
  background-color: var(--qt-bg-muted);
  opacity: 0.6;
  cursor: not-allowed;
}

.qt-form__textarea {
  resize: vertical;
  min-height: 60px;
}

/* ── Validation States ────────────────────── */
.qt-form__input.qt-invalid,
.qt-form__select.qt-invalid {
  border-color: var(--qt-danger);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

.qt-form__error {
  display: none;
  font-size: var(--qt-fs-xs);
  color: var(--qt-danger);
  margin-top: 4px;
}

.qt-form__error.qt-show {
  display: block;
}

/* ── Variants Selector ────────────────────── */
.qt-form__variants {
  display: flex;
  flex-direction: column;
  gap: var(--qt-space-sm);
}

.qt-variant-option {
  position: relative;
  display: block;
  cursor: pointer;
  border: 2px solid var(--qt-border);
  border-radius: var(--qt-radius-md);
  padding: 12px 16px;
  background: var(--qt-bg);
  transition: all var(--qt-transition-base);
  margin-bottom: 8px;
}

.qt-variant-option:last-child {
  margin-bottom: 0;
}

.qt-variant-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qt-variant-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qt-variant-radio {
  flex-shrink: 0;
}

.qt-variant-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--qt-border);
  border-radius: 50%;
  transition: all var(--qt-transition-base);
}

.qt-variant-check i {
  color: transparent;
  font-size: 11px;
}

.qt-variant-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.qt-variant-title {
  font-size: var(--qt-fs-sm);
  font-weight: var(--qt-fw-bold);
  color: var(--qt-text);
  margin-bottom: 2px;
}

.qt-variant-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qt-variant-price-new {
  font-weight: var(--qt-fw-extrabold);
  color: var(--qt-primary);
  font-size: var(--qt-fs-base);
}

.qt-variant-price-old {
  font-size: var(--qt-fs-xs);
  color: var(--qt-text-muted);
  text-decoration: line-through;
}

.qt-variant-discount {
  font-size: 11px;
  font-weight: var(--qt-fw-bold);
  background: var(--qt-danger);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
}

.qt-variant-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: linear-gradient(135deg, #FF9800, #FF5722);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(255,87,34,0.3);
  z-index: 2;
  animation: qt-pulse-subtle 2s infinite;
}

.qt-variant-option--active {
  border-color: var(--qt-primary);
  background: rgba(229, 57, 53, 0.03);
}

.qt-variant-option--active .qt-variant-check {
  background: var(--qt-primary);
  border-color: var(--qt-primary);
}

.qt-variant-option--active .qt-variant-check i {
  color: white;
}

.qt-variant-option--bestseller {
  border-color: #FF5722;
}

.qt-variant-option--bestseller.qt-variant-option--active {
  border-color: var(--qt-primary);
}

/* ── Quantity Selector ────────────────────── */
.qt-quantity {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--qt-border);
  border-radius: var(--qt-radius-md);
  overflow: hidden;
}

.qt-quantity__btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--qt-bg-soft);
  font-size: var(--qt-fs-lg);
  font-weight: var(--qt-fw-bold);
  cursor: pointer;
  transition: background var(--qt-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--qt-text);
}

.qt-quantity__btn:hover {
  background: var(--qt-bg-muted);
}

.qt-quantity__input {
  width: 60px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--qt-border);
  border-right: 1px solid var(--qt-border);
  text-align: center;
  font-size: var(--qt-fs-base);
  font-weight: var(--qt-fw-bold);
  -moz-appearance: textfield;
}

.qt-quantity__input::-webkit-outer-spin-button,
.qt-quantity__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Order Summary ────────────────────────── */
.qt-order-summary {
  background: var(--qt-bg-soft);
  border-radius: var(--qt-radius-md);
  padding: var(--qt-space-md);
  margin-bottom: var(--qt-space-lg);
  margin-top: var(--qt-space-lg);
}

.qt-order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: var(--qt-fs-sm);
  color: var(--qt-text-secondary);
}

.qt-order-summary__row + .qt-order-summary__row {
  border-top: 1px solid var(--qt-border-light);
}

.qt-order-summary__total {
  font-size: var(--qt-fs-md);
  font-weight: var(--qt-fw-bold);
  color: var(--qt-primary);
  padding-top: var(--qt-space-sm);
  border-top: 2px solid var(--qt-border) !important;
}

/* ── Submit Button ────────────────────────── */
.qt-form__submit {
  border: none;
  font-size: var(--qt-fs-md);
  padding: 16px;
}

.qt-form__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  animation: none;
}

.qt-form__guarantee {
  text-align: center;
  font-size: var(--qt-fs-xs);
  color: var(--qt-text-muted);
  margin-top: var(--qt-space-md);
  line-height: var(--qt-lh-relaxed);
}

/* ── Success Modal ────────────────────────── */
.qt-modal {
  position: fixed;
  inset: 0;
  z-index: var(--qt-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--qt-space-md);
}

.qt-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.qt-modal__content {
  position: relative;
  background: var(--qt-bg-card);
  border-radius: var(--qt-radius-xl);
  padding: var(--qt-space-2xl);
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--qt-shadow-xl);
  animation: qt-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes qt-modal-in {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.qt-modal__icon {
  font-size: 4rem;
  margin-bottom: var(--qt-space-md);
}

.qt-modal__title {
  font-size: var(--qt-fs-xl);
  margin-bottom: var(--qt-space-sm);
}

.qt-modal__text {
  font-size: var(--qt-fs-sm);
  color: var(--qt-text-secondary);
  margin-bottom: var(--qt-space-sm);
}

.qt-modal__order-code {
  font-family: monospace;
  font-size: var(--qt-fs-lg);
  font-weight: var(--qt-fw-bold);
  color: var(--qt-primary);
  margin-bottom: var(--qt-space-lg);
}

.qt-modal__close {
  min-width: 200px;
}

/* ── Loading Overlay ──────────────────────── */
.qt-form--loading {
  position: relative;
  pointer-events: none;
}

.qt-form--loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--qt-radius-lg);
  z-index: 10;
}

/* ── Responsive ───────────────────────────── */
@media (min-width: 768px) {
  .qt-form {
    padding: var(--qt-space-2xl);
  }
}

@media (max-width: 480px) {
  .qt-form__row {
    flex-direction: column;
    gap: 0;
  }

  .qt-form {
    padding: var(--qt-space-lg);
    border-radius: var(--qt-radius-md);
  }

  .qt-variant-option {
    min-width: 100%;
  }
}
