/* Pre-order Form — Modal overlay */

.preorder-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.preorder-overlay[hidden] { display: none; }

.preorder-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.preorder-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(170deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.preorder-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.preorder-panel__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.preorder-panel__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.preorder-panel__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ─── Form ─── */
.preorder-form {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.preorder-form__label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.preorder-form__input {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  min-height: 44px;
  transition: border-color var(--transition);
}

.preorder-form__input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.25);
}

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

/* Quantity +/- */
.preorder-form__qty {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.preorder-form__qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.preorder-form__qty-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.preorder-form__qty-input {
  width: 60px;
  text-align: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  min-height: 44px;
  -moz-appearance: textfield;
}

.preorder-form__qty-input::-webkit-inner-spin-button,
.preorder-form__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* Submit button */
.preorder-form__submit {
  padding: 14px;
  background: var(--text-primary);
  color: var(--bg-start);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  min-height: 48px;
  transition: background var(--transition), transform var(--transition);
}

.preorder-form__submit:hover {
  background: #ffffff;
  transform: scale(1.02);
}

.preorder-form__submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Status messages */
.preorder-form__status {
  text-align: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.preorder-form__status--success {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.preorder-form__status--error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Mobile: full width */
@media (max-width: 480px) {
  .preorder-panel {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
  }

  .preorder-overlay {
    align-items: flex-end;
    padding: 0;
  }
}
