/* ============================
   ORDER WIZARD & MODAL - COMPLETE
   ============================ */

/* --- MODAL BASE --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  overflow: auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-card, #1a1a2e);
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius-lg, 16px);
  position: relative;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-content.wizard-container {
  padding: 0;
  max-width: 620px;
  border: 1px solid var(--border-accent, rgba(234,88,12,0.3));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- MODAL HEADER --- */
.modal-header {
  background: var(--gradient-hero, linear-gradient(135deg, #EA580C, #C2410C));
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: white;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.4;
}

.modal-close {
  background: rgba(0,0,0,0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(0,0,0,0.5);
}

/* --- WIZARD PROGRESS --- */
.wizard-progress {
  padding: 1.25rem 2rem 0.75rem;
  background: var(--bg-card, #1a1a2e);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
}

.progress-bar-bg {
  position: absolute;
  top: 2.35rem;
  left: 4.5rem;
  right: 4.5rem;
  height: 2px;
  background: rgba(255,255,255,0.1);
  z-index: 1;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary, #EA580C);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 2px;
}

.step-dots {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  margin-bottom: 0.5rem;
  padding: 0 1.5rem;
}

.step-dot {
  width: 36px;
  height: 36px;
  background: var(--bg-card, #1a1a2e);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  transition: all 0.4s ease;
  z-index: 5;
  position: relative;
}

.step-dot.active {
  background: var(--primary, #EA580C);
  border-color: var(--primary, #EA580C);
  color: white;
  box-shadow: 0 0 15px rgba(234, 88, 12, 0.4);
}

.step-dot.completed {
  background: var(--primary-dark, #C2410C);
  border-color: var(--primary-dark, #C2410C);
  color: white;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  margin-top: 0.35rem;
}

.step-labels span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  width: 33.33%;
  text-align: center;
}

/* --- FORM AREA --- */
#orderForm {
  padding: 1.5rem 2rem 2rem;
}

/* --- WIZARD STEPS --- */
.wizard-step {
  animation: wizardFadeIn 0.35s ease;
}

.wizard-step[style*="display: none"],
.wizard-step[style*="display:none"] {
  animation: none;
}

/* --- FORM GROUPS --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary, #fff);
}

.form-group input,
.form-group textarea,
.form-group .form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group .form-control:focus {
  border-color: var(--primary, #EA580C);
  box-shadow: 0 0 0 3px rgba(234,88,12,0.15);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255,255,255,0.3);
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

/* --- INPUT GROUP (kupon) --- */
.input-group {
  display: flex;
  gap: 0;
}

.input-group input {
  flex: 1;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.input-group .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  white-space: nowrap;
}

/* --- MODAL FOOTER / BUTTON ROW --- */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.modal-footer .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* --- BUTTONS --- */
.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary, #aaa);
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-outline-secondary:hover {
  border-color: var(--text-primary, #fff);
  color: var(--text-primary, #fff);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary, #EA580C);
  border: 1px solid var(--primary, #EA580C);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  transition: all 0.3s;
}

.btn-outline-primary:hover {
  background: var(--primary, #EA580C);
  color: white;
}

/* --- ORDER SUMMARY BOX (Step 2) --- */
.order-summary-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-sm, 8px);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.order-summary-box h5 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.summary-row .summary-label {
  color: var(--text-secondary, #aaa);
}

.summary-row .summary-value {
  color: white;
  font-weight: 600;
}

.summary-row.discount-row {
  color: #22c55e;
}

.summary-row.discount-row .summary-value {
  color: #22c55e;
}

.summary-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 0.75rem 0;
}

.summary-row.total-row {
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

.summary-row.total-row .summary-label {
  color: white;
  font-weight: 700;
}

.summary-row.total-row .summary-value {
  color: var(--primary-light, #F97316);
  font-weight: 800;
  font-size: 1.2rem;
}

/* --- COUPON MESSAGE --- */
#coupon-message {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

#coupon-message.success {
  color: #22c55e;
  font-weight: 600;
}

#coupon-message.error {
  color: #ef4444;
  font-weight: 600;
}

/* --- PAYMENT CARDS (Step 3) --- */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-option {
  position: relative;
  cursor: pointer;
  display: block;
}

.payment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.payment-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-sm, 8px);
  transition: all 0.3s;
  text-align: center;
  height: 100%;
}

.payment-option input[type="radio"]:checked + .payment-card-inner {
  border-color: var(--primary, #EA580C);
  background: rgba(234,88,12,0.08);
  box-shadow: 0 0 20px rgba(234,88,12,0.15);
}

.payment-card-inner:hover {
  border-color: var(--primary-light, #F97316);
  transform: translateY(-2px);
}

.payment-card-inner .pay-icon {
  font-size: 1.75rem;
  color: var(--primary, #EA580C);
  margin-bottom: 0.5rem;
}

.payment-card-inner h6 {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.payment-card-inner small {
  color: var(--text-muted, #888);
  font-size: 0.75rem;
}

/* --- HAVALE INFO --- */
.havale-info-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm, 8px);
  padding: 1rem;
  margin-bottom: 1rem;
}

.havale-info-box h6 {
  color: #f59e0b;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.havale-info-box p {
  color: var(--text-secondary, #aaa);
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.5;
}

/* --- ORDER RESULT --- */
#order-result {
  padding: 1.25rem;
  border-radius: var(--radius-sm, 8px);
  margin: 1rem 2rem 2rem;
}

/* --- PayTR iframe --- */
#paytr-iframe-container {
  border-radius: var(--radius-sm, 8px);
  margin-top: 1rem;
}

#paytr-iframe-container iframe {
  width: 100%;
  min-height: 450px;
  border: none;
  border-radius: var(--radius-sm, 8px);
}

/* --- SUBMIT BUTTON --- */
#btn-submit-order {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  padding: 0.85rem 2rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- ANIMATIONS --- */
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- TRACK / HAVALE MODAL FORM STYLES --- */
#trackForm .form-group,
#havaleForm .form-group {
  margin-bottom: 1rem;
}

#trackForm .btn,
#havaleForm .btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  .modal-content.wizard-container {
    margin: 2% auto;
    width: 95%;
  }

  #orderForm {
    padding: 1rem 1.25rem 1.5rem;
  }

  .wizard-progress {
    padding: 1rem 1rem 0.5rem;
  }

  .step-dots {
    padding: 0 0.5rem;
  }

  .progress-bar {
    left: 2.5rem;
    right: 2.5rem;
  }

  .payment-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
