/* Dedicated checkout page layout aligned with site container widths. */

.af-checkout-page {
  max-width: 1170px;
  margin: 28px auto;
  padding: 0 15px 36px;
}

.af-checkout-page__header {
  margin-bottom: 16px;
}

.af-checkout-page__header h1 {
  margin: 0;
  color: #1f2937;
}

.af-checkout-page__header p {
  margin: 8px 0 0;
  color: #64748b;
}

.af-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.af-checkout-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  padding: 18px;
}

.af-checkout-card__title {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 1.5rem;
}

.af-checkout-card--summary {
  position: sticky;
  top: 14px;
}

.af-checkout-rows {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.af-checkout-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 10px;
}

.af-checkout-row img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.af-checkout-row-title {
  font-weight: 600;
  color: #0f172a;
}

.af-checkout-row-meta {
  margin-top: 2px;
  color: #64748b;
  font-size: 1.15rem;
}

.af-checkout-row-price {
  font-weight: 600;
  color: #0f172a;
}

.af-wizard-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.af-wizard-progress__item {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #64748b;
}

.af-wizard-progress__item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e2e8f0;
  font-weight: 700;
}

.af-wizard-progress__item.is-active span {
  background: #d65982;
  color: #fff;
}

.af-wizard-progress__item.is-done span {
  background: #22c55e;
  color: #fff;
}

.af-wizard-progress__item small {
  font-size: 1.35rem;
  font-weight: 600;
}

.af-wizard-form {
  display: grid;
  gap: 10px;
}

.af-wizard-step {
  display: none;
}

.af-wizard-step.is-active {
  display: block;
}

.af-wizard-step h3 {
  margin: 0 0 12px;
  color: #1f2937;
  font-size: 2rem;
}

.af-wizard-step label {
  display: block;
  margin: 0 0 6px;
  color: #334155;
  font-weight: 600;
}

.af-wizard-step input,
.af-wizard-step select,
.af-wizard-step textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 12px;
}

/* Keep focused controls neutral: no black border, no glow. */
.af-wizard-step input:focus,
.af-wizard-step select:focus,
.af-wizard-step textarea:focus {
  outline: none;
  border-color: #cbd5e1;
  box-shadow: none;
}

/* Show success state for validated fields (name/email/phone). */
.af-wizard-step input.af-field-valid,
.af-wizard-step input.af-field-valid:focus {
  border-color: #16a34a;
  box-shadow: none;
}

.af-wizard-radio-grid,
.af-wizard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.af-wizard-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid #d0d9e5;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #f8fafc;
}

/* Keeps JS hidden toggles effective despite explicit display:flex rule. */
.af-wizard-radio[hidden] {
  display: none !important;
}

/* Give each delivery option its own soft background tone. */
.af-wizard-radio-grid .af-wizard-radio:nth-child(1) {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.af-wizard-radio-grid .af-wizard-radio:nth-child(2) {
  background: #fff4ec;
  border-color: #fed7aa;
}

.af-wizard-radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.af-wizard-radio span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 1.4rem;
  font-weight: 600;
}

.af-wizard-radio span::after {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
}

.af-wizard-radio:has(input:checked) {
  border-color: #d65982;
  background: #fce8f0;
}

.af-wizard-radio:has(input:checked) span::after {
  content: '✓';
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  border-color: #16a34a;
  background: #16a34a;
}

/* Keep all payment options in one visual style without per-item tones. */
.af-wizard-step[data-step="3"] .af-wizard-radio {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.af-wizard-step[data-step="3"] .af-wizard-radio:has(input:checked) {
  border-color: #d65982;
  background: #fce8f0;
}

/* Shows fixed pickup point and discount when pickup method is selected. */
.af-pickup-fixed-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ecfdf3;
  color: #166534;
  font-size: 1.3rem;
  font-weight: 500;
}

/* Explains surprise delivery default when recipient differs from customer. */
.af-recipient-surprise-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 1.2rem;
  font-weight: 500;
}

.af-delivery-calc-status {
  margin: -4px 0 10px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.3rem;
  font-weight: 500;
}

.af-delivery-calc-status::before {
  content: '•';
  margin-right: 6px;
}

.af-delivery-calc-status--pending::before {
  content: '';
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid #93c5fd;
  border-top-color: #1d4ed8;
  border-radius: 999px;
  display: inline-block;
  vertical-align: -1px;
  animation: af-spin 0.8s linear infinite;
}

.af-delivery-calc-status--error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.af-delivery-calc-map {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

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

.af-wizard-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}

.af-wizard-checkbox input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.af-wizard-actions {
  position: relative;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
}

.af-step-toast {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  max-width: 420px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #fda4af;
  background: #fff1f2;
  color: #be123c;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.14);
}

.af-step-toast::after {
  content: '';
  position: absolute;
  right: 26px;
  top: 100%;
  width: 12px;
  height: 12px;
  background: #fff1f2;
  border-right: 1px solid #fda4af;
  border-bottom: 1px solid #fda4af;
  transform: rotate(45deg);
}

.af-wizard-btn {
  min-width: 170px;
  border: 1px solid #d65982;
  border-radius: 10px;
  background: #d65982;
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
}

.af-wizard-btn--ghost {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

/* Keep intl-tel-input control width and z-index stable inside wizard fields. */
.iti {
  width: 100%;
  display: block;
  margin-bottom: 12px;
}

.iti input[type="tel"] {
  width: 100%;
  padding-left: 52px;
}

.iti__dropdown-content {
  z-index: 30;
}

/* Restore proper spacing for intl-tel-input search icon and text. */
.af-wizard-step .iti__search-input {
  margin-bottom: 0;
  padding-left: 36px;
}

/* Improve flatpickr visuals to match checkout card design. */
.flatpickr-calendar {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.flatpickr-months,
.flatpickr-weekdays {
  background: #f8fafc;
}

.flatpickr-current-month {
  font-weight: 600;
}

.flatpickr-day {
  border-radius: 8px;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #d65982;
  border-color: #d65982;
}

.flatpickr-day.today {
  border-color: #16a34a;
}

.flatpickr-day:hover {
  background: #fde8f1;
  border-color: #fde8f1;
}

@media (max-width: 991px) {
  .af-checkout-layout,
  .af-wizard-radio-grid,
  .af-wizard-grid-2 {
    grid-template-columns: 1fr;
  }

  .af-checkout-card--summary {
    position: static;
  }

  .af-wizard-progress {
    padding: 10px 8px;
  }

  .af-wizard-progress__item small {
    display: none;
  }

  .af-wizard-actions {
    flex-direction: column-reverse;
    padding-top: 12px;
  }

  .af-step-toast {
    position: static;
    max-width: none;
    margin-bottom: 8px;
    font-size: 1.3rem;
  }

  .af-step-toast::after {
    display: none;
  }

  .af-wizard-btn {
    width: 100%;
  }
}
