/* ==========================================================================
   Quick Order — hero layout
   Left  : product story (header include)
   Right : a "checkout window" that holds the REAL order form
   Uses logical properties throughout, so it works in LTR and RTL.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.qo-wrap {
  position: relative;
  width: 100%;
  max-width: var(--main-width);
  margin-inline: auto;
  padding: 40px var(--padding-100) 48px;
  box-sizing: border-box;
  scroll-margin-top: 90px;
  color: var(--text-color);
  overflow: hidden;
}

.qo-wrap *,
.qo-wrap *::before,
.qo-wrap *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Layout grid — left story + right checkout window
   -------------------------------------------------------------------------- */
.qo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--spacing-4xl);
  align-items: start;
}

/* --------------------------------------------------------------------------
   Left column — intro & features
   -------------------------------------------------------------------------- */
.qo-intro {
  padding-block-start: var(--spacing-sm);
}

.qo-intro .website-section-header {
  text-align: start;
  padding: 0;
}

.qo-intro .newsletter__badge {
  margin-bottom: var(--spacing-xl);
}

.qo-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.qo-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qo-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.qo-feature-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.4;
}

.qo-help {
  margin-top: var(--spacing-lg, 24px);
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Right column — the checkout window
   -------------------------------------------------------------------------- */
.qo-visual {
  position: relative;
  padding-bottom: 34px;
}

/* soft glow behind the window */
.qo-visual::before {
  content: "";
  position: absolute;
  inset-block-start: -60px;
  inset-inline-end: -60px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

.qo-window {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-light);
  overflow: hidden;
}

.qo-window-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}

.qo-window-dots {
  display: flex;
  gap: var(--spacing-xs);
  flex: none;
}

.qo-window-dots span {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  display: block;
}

.qo-window-dots span:nth-child(1) { background: #f87171; }
.qo-window-dots span:nth-child(2) { background: #fbbf24; }
.qo-window-dots span:nth-child(3) { background: #34d399; }

.qo-window-url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px var(--spacing-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-badge);
}

.qo-window-url svg {
  width: 12px;
  height: 12px;
  flex: none;
}

.qo-window-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: var(--spacing-xs) 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.qo-window-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: var(--radius-full);
  background-color: var(--primary-color);
}

.qo-window-body {
  padding: var(--spacing-2xl);
}

.qo-form-head {
  margin: 0 0 var(--spacing-xs);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-color);
}

.qo-form-subhead {
  margin: 0 0 var(--spacing-xl);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Feedback alert
   -------------------------------------------------------------------------- */
.qo-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--error-color);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  animation: qo-alert-in var(--transition-normal);
}

.qo-alert[hidden] { display: none; }

.qo-alert--success {
  color: var(--success-color);
  background: var(--success-bg);
  border-color: var(--success-border);
}

.qo-alert__icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.qo-alert__icon svg {
  width: 18px;
  height: 18px;
}

.qo-alert__icon--success,
.qo-alert__icon--error { display: none; }

.qo-alert--success .qo-alert__icon--success { display: block; }
.qo-alert--success .qo-alert__icon--error   { display: none; }
.qo-alert--error .qo-alert__icon--error     { display: block; }

.qo-alert__text {
  flex: 1;
  min-width: 0;
}

.qo-alert__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: var(--opacity-70);
  transition: opacity var(--transition-fast);
}

.qo-alert__close:hover {
  opacity: 1;
  background: var(--primary-more-light);
}

.qo-alert__close svg {
  width: 14px;
  height: 14px;
}

@keyframes qo-alert-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */
.qo-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-sm) var(--spacing-lg);
}

.qo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.qo-field--full {
  grid-column: 1 / -1;
}

.qo-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-color);
}

.qo-label-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-muted);
}

.qo-required {
  color: var(--danger-color);
}

.qo-optional {
  font-weight: 400;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.qo-input-wrap {
  position: relative;
}

.qo-input-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}

.qo-input-icon svg {
  width: 17px;
  height: 17px;
}

.qo-input-icon--top {
  top: var(--spacing-md);
  transform: none;
}

.qo-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: var(--font-size-base);
  color: var(--text-color);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: var(--transition-main);
}

.qo-input::placeholder {
  color: var(--text-placeholder);
}

.qo-input:hover {
  border-color: var(--border-secondary);
}

.qo-input:focus {
  outline: none;
  background: var(--bg-primary);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.qo-textarea {
  height: auto;
  min-height: 88px;
  padding: var(--spacing-md) 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.qo-input[aria-invalid="true"],
.qo-field.has-error .qo-input,
.qo-input.is-invalid {
  border-color: var(--danger-color);
  background: var(--bg-primary);
}

.qo-error {
  display: block;
  font-size: var(--font-size-xs);
  line-height: 1.4;
  color: var(--danger-color);
}

.qo-error:empty {
  display: none;
}

/* --------------------------------------------------------------------------
   Quantity stepper
   -------------------------------------------------------------------------- */
.qo-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  background: var(--bg-primary);
}

.qo-step-btn {
  appearance: none;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 40px;
  height: 44px;
  font-size: var(--font-size-md);
  cursor: pointer;
}

.qo-step-btn:hover {
  background: var(--primary-light);
}

.qo-qty {
  width: 56px;
  text-align: center;
  padding: var(--spacing-md) 0;
  border: none;
  border-left: 1px solid var(--border-primary);
  border-right: 1px solid var(--border-primary);
  border-radius: 0;
  -moz-appearance: textfield;
}

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

/* --------------------------------------------------------------------------
   Submit
   -------------------------------------------------------------------------- */
.qo-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  height: 50px;
  padding: 0 var(--spacing-xl);
  font: inherit;
  font-size: var(--font-size-md);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-white);
  background: var(--primary-color);
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-main);
}

.qo-submit:hover:not(:disabled) {
  background: var(--primary-hover);
}

.qo-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.qo-submit:disabled {
  opacity: var(--opacity-70);
  cursor: not-allowed;
}

.qo-submit:disabled svg { display: none; }

.qo-submit:focus-visible,
.qo-alert__close:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.qo-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--text-white);
  border-radius: var(--radius-full);
  animation: qo-spin 0.7s linear infinite;
}

.qo-submit[aria-busy="true"] .qo-spinner,
.qo-form.is-loading .qo-spinner {
  display: inline-block;
}

.qo-form.is-loading .qo-submit-text {
  opacity: 0.85;
}

@keyframes qo-spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Floating total badge
   -------------------------------------------------------------------------- */
.qo-float {
  position: absolute;
  z-index: 2;
  inset-block-end: -28px;
  inset-inline-start: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--spacing-lg) 10px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-heavy);
}

.qo-float-thumb {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
}

.qo-float-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qo-float-copy {
  display: grid;
  line-height: 1.3;
}

.qo-float-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.qo-float-price {
  font-size: var(--font-size-md);
  font-weight: 800;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .qo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .qo-visual {
    padding-bottom: 0;
  }

  .qo-visual::before {
    display: none;
  }

  .qo-float {
    position: static;
    margin-top: var(--spacing-lg);
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .qo-wrap {
    padding: var(--spacing-4xl) var(--spacing-md);
  }

  .qo-window-body {
    padding: var(--spacing-lg);
  }

  .qo-form {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qo-input,
  .qo-submit {
    transition: none;
  }

  .qo-spinner {
    animation-duration: 2s;
  }
}