/* علامت فیلدهای اجباری و برچسب اختیاری */
.required-star {
  color: #e53935;
  font-weight: 700;
}
.field-optional {
  font-weight: 400;
  font-size: 0.8em;
  color: var(--dnd-muted);
}

#dnd-address-form input::placeholder {
    font-size: 11px;
}

/* فیلدهای عددی/انگلیسی: متن چپ‌چین، placeholder راست‌چین بمونه */
.form-control.field-ltr {
  direction: ltr;
  text-align: left;
}
.form-control.field-ltr::placeholder {
  direction: rtl;
  text-align: right;
}

/* ===== Searchable select (استان / شهر) ===== */
.dnd-ss { position: relative; }

/* select اصلی مخفی میشه ولی برای اعتبارسنجی مرورگر سر جاش می‌مونه */
.dnd-ss__native {
  position: absolute !important;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dnd-ss__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: right;
  cursor: pointer;
  background-color: #fff;
}
.dnd-ss__btn.is-placeholder .dnd-ss__label { color: #8a8f98; }
.dnd-ss__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dnd-ss__arrow { flex-shrink: 0; transition: transform 0.15s; }
.dnd-ss.is-open .dnd-ss__arrow { transform: rotate(180deg); }

.dnd-ss__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 60;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.dnd-ss__panel[hidden] { display: none; }

.dnd-ss__search {
  width: 100%;
  margin-bottom: 6px;
  padding: 9px 12px;
  font-size: 16px; /* جلوگیری از زوم خودکار در iOS */
  border: 1px solid var(--dnd-border);
  border-radius: 8px;
  outline: none;
}
.dnd-ss__search:focus { border-color: var(--dnd-primary); }

.dnd-ss__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.dnd-ss__item {
  padding: 9px 12px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}
.dnd-ss__item:hover,
.dnd-ss__item.is-active { background: #f3f4f6; }
.dnd-ss__item.is-selected { font-weight: 700; color: var(--dnd-primary); }

.dnd-ss__empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #8a8f98;
}


/* توضیح زمان ارسال (مرحله‌ی ۳) */
.shipping-time-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 1.25rem;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #f5dfa8;
  border-radius: var(--dnd-radius-md);
  color: #8a5a00;
}
.shipping-time-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.shipping-time-note p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.9;
}

.qty-btn.is-trash {
  color: var(--dnd-danger);
  border-color: var(--dnd-danger-soft);
}

.qty-btn.is-trash:hover {
  background: var(--dnd-danger-soft);
  border-color: var(--dnd-danger);
  color: var(--dnd-danger);
}

/**
 * DND Multi-Step Checkout Styles
 */

.dnd-checkout-container {
  min-height: 100vh;
  background: var(--dnd-bg-soft);
  /* padding-bottom: 100px; */
  font-family: inherit;
}

/* Progress Steps */
.dnd-progress-steps {
  background: var(--dnd-white);
  padding: 2rem 0;
  /* margin-bottom: 2rem; */
  /* box-shadow: var(--dnd-shadow); */
}

.checkout-content {
  padding-top: 2rem;
}

.progress-wrapper {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 0 2rem;
}

.progress-wrapper::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--dnd-border);
  z-index: 0;
}

.progress-fill {
  position: absolute;
  top: 24px;
  right: 10%;
  height: 2px;
  width: 0%;
  background: var(--dnd-primary);
  z-index: 0;
  transition: width 0.35s ease;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dnd-white);
  border: 2px solid var(--dnd-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dnd-muted);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.step.active .step-icon,
.step.completed .step-icon {
  background: var(--dnd-primary);
  border-color: var(--dnd-primary);
  color: var(--dnd-white);
}

.step.completed .step-icon svg {
  display: none;
}

.step.completed .step-icon::after {
  content: "✓";
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.step-label {
  font-size: 0.875rem;
  color: var(--dnd-muted);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--dnd-primary);
  font-weight: 600;
}

/* Checkout Steps */
.checkout-step {
  display: none;
  background: var(--dnd-white);
  border-radius: var(--dnd-radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  /* box-shadow: var(--dnd-shadow); */
}

.checkout-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dnd-text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--dnd-border);
}

/* Cart Items */
.cart-item {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem;
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  gap: 1rem;
  position: relative;
}

.cart-item:hover {
  box-shadow: var(--dnd-shadow);
}

/* ستون راست: عکس محصول + دکمه‌های عملیات زیر عکس */
.cart-item-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 100px;
}

.cart-item-image-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}

.cart-item-image {
  width: 90px;
  height: 90px;
  object-fit: cover;
  /*border-radius: var(--dnd-radius-md);*/
  display: block;
}

.cart-item-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--dnd-danger);
  color: var(--dnd-white);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #f7f8fa;
  border-radius: 50px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--dnd-border);
  background: var(--dnd-white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--dnd-text);
  padding: 0;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--dnd-bg-soft);
  border-color: var(--dnd-primary);
  color: var(--dnd-primary);
}

.qty-input {
  width: 26px;
  text-align: center;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dnd-text);
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item-remove {
  color: var(--dnd-danger);
  background: #f7f8fa;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: absolute;
  top: 10px;
  right: 10px;
}

.cart-item-remove:hover {
  background: var(--dnd-danger-soft);
}

/* ستون چپ: عنوان، توضیحات، قیمت */
.cart-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.cart-item-title {
  font-weight: 600;
  color: var(--dnd-text);
  font-size: 1rem;
  line-height: 1.5;
}

.cart-item-title-en {
  font-size: 0.8125rem;
  color: var(--dnd-muted);
  font-weight: 400;
  direction: ltr;
  text-align: right;
}

.cart-item-meta {
  font-size: 0.8125rem;
  color: var(--dnd-muted);
  line-height: 1.8;
}

.cart-item-price {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 600;
  color: var(--dnd-primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.price-sale {
  color: var(--dnd-primary);
}

.price-old {
  text-decoration: line-through;
  color: var(--dnd-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

/* Empty Cart */
.empty-cart-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--dnd-muted);
}

.empty-cart-message svg {
  margin-bottom: 1rem;
}

.empty-cart-message p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Coupon Section */
.coupon-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--dnd-bg-soft);
  border-radius: var(--dnd-radius-md);
}

.coupon-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.coupon-header span {
  font-weight: 600;
  color: var(--dnd-text);
}

/* Step Navigation */
.step-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--dnd-border);
}

/* Address Cards */
.address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.address-card {
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: var(--dnd-white);
}

.address-card:hover {
  border-color: var(--dnd-primary);
  box-shadow: var(--dnd-shadow);
}

.address-card.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
}

.address-card.selected::after {
  content: "✓";
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 24px;
  height: 24px;
  background: var(--dnd-primary);
  color: var(--dnd-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.address-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.address-card-title {
  font-weight: 600;
  color: var(--dnd-text);
  font-size: 1rem;
  margin: 0;
}

.address-card-actions {
  display: flex;
  gap: 0.5rem;
}

.address-card-actions button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.address-card-body p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--dnd-text);
}

.address-card-body p {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

/* Pickup Location Box (Step 2) */
.pickup-info {
  border: 2px dashed var(--dnd-primary);
  border-radius: var(--dnd-radius-md);
  background: var(--dnd-primary-soft);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.pickup-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--dnd-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pickup-info h4 {
  color: var(--dnd-text);
  margin-bottom: 0.5rem;
}

.pickup-info p {
  max-width: 420px;
  margin: 0 auto 1rem;
  line-height: 1.7;
}

/* Address Options */
.address-options {
  margin-bottom: 2rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--dnd-primary);
}

.form-check-label {
  font-weight: 500;
  color: var(--dnd-text);
  cursor: pointer;
}

/* Redesigned Address/Pickup Type Selector */
.address-type-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.address-type-card {
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  padding: 1rem 1.25rem;
  position: relative;
  background: var(--dnd-white);
  transition: all 0.25s ease;
}

.address-type-card__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.address-type-card > div[id]:not(.address-type-card__header) {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dnd-border);
}

.address-type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.address-type-card:hover {
  border-color: var(--dnd-primary);
  box-shadow: var(--dnd-shadow);
}

.address-type-card.active,
.address-type-card:has(input:checked) {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
}

.address-type-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dnd-primary-soft);
  color: var(--dnd-primary);
  transition: all 0.25s ease;
}

.address-type-card.active .address-type-icon,
.address-type-card:has(input:checked) .address-type-icon {
  background: var(--dnd-primary);
  color: var(--dnd-white);
}

.address-type-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--dnd-text);
  margin-bottom: 0.15rem;
}

.address-type-text small {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--dnd-text-muted, #8a8f98);
  line-height: 1.5;
}

.address-type-check {
  margin-inline-start: auto;
  width: 20px;
  height: 20px;
  border: 2px solid var(--dnd-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.address-type-card.active .address-type-check,
.address-type-card:has(input:checked) .address-type-check {
  border-color: var(--dnd-primary);
}

.address-type-card.active .address-type-check::after,
.address-type-card:has(input:checked) .address-type-check::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--dnd-primary);
}

/* Shipping Methods */
.shipping-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shipping-method {
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
}

.shipping-method:hover {
  border-color: var(--dnd-primary);
  box-shadow: var(--dnd-shadow);
}

.shipping-method.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
}

.shipping-method-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.shipping-method-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.shipping-method-title,
.payment-method-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.method-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--dnd-border);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

.shipping-method.selected .method-radio,
.payment-method.selected .method-radio {
  border-color: var(--dnd-primary);
}

.shipping-method.selected .method-radio::after,
.payment-method.selected .method-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dnd-primary);
}

.shipping-method-name {
  font-weight: 600;
  color: var(--dnd-text);
  font-size: 1rem;
  margin: 0;
}

.shipping-method-cost {
  font-weight: 700;
  color: var(--dnd-primary);
  font-size: 1.125rem;
}

.shipping-method-desc {
  font-size: 0.875rem;
  color: var(--dnd-muted);
}

.shipping-method-packaging {
  font-size: 0.8125rem;
  color: var(--dnd-muted);
  margin-top: 0.35rem;
}

/* Delivery Schedule */
.delivery-schedule {
  margin-top: 2rem;
}

.section-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dnd-text);
  margin-bottom: 1rem;
}

.date-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.date-option {
  padding: 1rem 0.5rem;
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
}

.date-option:hover {
  border-color: var(--dnd-primary);
}

.date-option.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary);
  color: var(--dnd-white);
}

.date-option-day {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.date-option-date {
  font-weight: 600;
  font-size: 1rem;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.time-slot {
  padding: 0.75rem;
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
  font-weight: 500;
}

.time-slot:hover {
  border-color: var(--dnd-primary);
}

.time-slot.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary);
  color: var(--dnd-white);
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-method {
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
}

.payment-method:hover {
  border-color: var(--dnd-primary);
}

.payment-method.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
}

.payment-method-name {
  font-weight: 600;
  color: var(--dnd-text);
  margin: 0;
}

.payment-method-desc {
  font-size: 0.875rem;
  color: var(--dnd-muted);
  margin: 0;
}

/* Order Summary */
.order-summary-sidebar {
  position: sticky;
  top: 2rem;
}

.order-summary-box {
  background: var(--dnd-white);
  border-radius: var(--dnd-radius-md);
  padding: 1.5rem;
  /* box-shadow: var(--dnd-shadow); */
}

.order-summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dnd-text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--dnd-border);
}

.order-summary-items {
  margin-bottom: 1.5rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--dnd-border);
}

.summary-item-image {
  width: 44px;
  height: 44px;
  /*border-radius: var(--dnd-radius-md);*/
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--dnd-border);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.summary-item-name {
  font-weight: 500;
  color: var(--dnd-text);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item-qty {
  font-size: 0.75rem;
  color: var(--dnd-muted);
}

.summary-item-price {
  font-weight: 600;
  color: var(--dnd-text);
  font-size: 0.875rem;
}

.order-summary-totals {
  border-top: 2px solid var(--dnd-border);
  padding-top: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.summary-row.total {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dnd-primary);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--dnd-border);
  margin-bottom: 0;
}

.summary-row.discount .summary-discount {
  color: var(--dnd-danger);
}

/* Fixed Bottom Bar (Mobile) */
.checkout-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dnd-white);
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1030;
  display: none;
}

.checkout-bottom-bar.visible {
  display: block;
}

.bottom-bar-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.bottom-bar-total {
  flex: 1;
}

.bottom-bar-label {
  font-size: 0.75rem;
  color: var(--dnd-muted);
  margin-bottom: 0.25rem;
}

.bottom-bar-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dnd-text);
}

.bottom-bar-btn {
  flex: 1;
  padding: 1rem 2rem;
  font-size: 1rem;
  justify-content: center;
}

/* Notification Toast */
.dnd-notification {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--dnd-white);
  padding: 1rem 2rem;
  border-radius: var(--dnd-radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
}

.dnd-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.dnd-notification.success {
  border-right: 4px solid var(--dnd-primary);
}

.dnd-notification.error {
  border-right: 4px solid var(--dnd-danger);
}

.notification-message {
  font-weight: 500;
  color: var(--dnd-text);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid var(--dnd-border);
  border-top-color: var(--dnd-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Modal Styles (for DNDModalBase) */
.dnd-modal__overlay {
  z-index: 10000;
  opacity: 0;
}

.is-active .dnd-modal__dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  box-shadow: 0 0 75px #00000054;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--dnd-border);
}

/* Fullscreen variant (address modal — same full-page takeover as the
   categories / search modal). DNDModalBase adds `dnd-modal--fullscreen`
   to the wrapper when initialized with `fullscreen: true`. */
@media (max-width: 991.98px) {
  #dnd-address-modal.dnd-modal--fullscreen .dnd-modal__overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
  }

  #dnd-address-modal.dnd-modal--fullscreen .dnd-modal__dialog {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 10001;
  }

  #dnd-address-modal.dnd-modal--fullscreen.is-active .dnd-modal__dialog {
    transform: translateX(0);
  }

  #dnd-address-modal.dnd-modal--fullscreen .modal-header {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 14px 16px;
  }

  #dnd-address-modal.dnd-modal--fullscreen .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 0;
  }

  #dnd-address-modal.dnd-modal--fullscreen .modal-footer {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-top: 1px solid var(--dnd-border);
  }
}

/* Utility Classes */
.text-muted {
  color: var(--dnd-muted);
}
.text-primary {
  color: var(--dnd-primary);
}
.text-danger {
  color: var(--dnd-danger);
}
.mb-0 {
  margin-bottom: 0;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mt-4 {
  margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 991px) {
  .order-summary-sidebar {
    margin-bottom: 160px;
  }

  .checkout-bottom-bar {
    display: block;
    bottom: calc(54px + env(safe-area-inset-bottom, 0));
  }

  .step-navigation .btn-next-step,
  .step-navigation .btn-place-order {
    display: none;
  }
}

@media (max-width: 767px) {
  .progress-wrapper {
    padding: 0 0.5rem;
  }

  .step-icon {
    width: 40px;
    height: 40px;
  }

  .step-label {
    font-size: 0.75rem;
  }

  .checkout-step {
    padding: 1rem;
    width: 100vw;
    margin-right: -12px;
    margin-left: -12px;
    border-radius: 0;
  }

  .order-summary-box {
    width: 100vw;
    margin-right: -12px;
    border-radius: 0;
    margin-left: -12px;
  }
  .cart-item-media {
    width: 100px;
  }

  .cart-item-image-wrap,
  .cart-item-image {
    width: 70px;
    height: 70px;
  }

  .address-grid {
    grid-template-columns: 1fr;
  }

  .date-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .time-slots {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Loading state for containers */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--dnd-border);
  border-top-color: var(--dnd-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}

/* Pickup Delivery Message */
.pickup-delivery-message {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--dnd-primary-soft);
  border-radius: var(--dnd-radius-md);
  border: 2px solid var(--dnd-primary);
}

.pickup-message-icon {
  margin-bottom: 1.5rem;
}

.pickup-delivery-message h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dnd-primary);
  margin-bottom: 1rem;
}

.pickup-message-text {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--dnd-text);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.pickup-address-box {
  background: var(--dnd-white);
  padding: 1.5rem;
  border-radius: var(--dnd-radius-md);
  margin-top: 1.5rem;
  text-align: right;
}

.pickup-address-box strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--dnd-text);
}

.pickup-address-box p {
  margin: 0;
  color: var(--dnd-muted);
  font-size: 0.9375rem;
}

/* Time slots - updated style */
.time-slot {
  padding: 1rem 0.75rem;
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
  font-weight: 500;
  font-size: 0.9375rem;
}

.time-slot:hover {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
}

.time-slot.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary);
  color: var(--dnd-white);
}

/* Empty Cart State */
.empty-cart-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--dnd-white);
  border-radius: var(--dnd-radius-md);
}

.empty-cart-icon {
  margin-bottom: 2rem;
  opacity: 0.6;
}

.empty-cart-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dnd-text);
  margin-bottom: 1rem;
}

.empty-cart-description {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--dnd-muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
}

.empty-cart-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.empty-cart-actions .btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .empty-cart-state {
    padding: 3rem 1.5rem;
  }

  .empty-cart-title {
    font-size: 1.375rem;
  }

  .empty-cart-description {
    font-size: 0.9375rem;
  }

  .empty-cart-actions {
    flex-direction: column;
  }

  .empty-cart-actions .btn-lg {
    width: 100%;
  }
}

/* Time slot capacity styles */
.time-slot {
  position: relative;
  padding: 1rem 0.75rem;
  border: 2px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--dnd-white);
  font-weight: 500;
  font-size: 0.9375rem;
}

.time-slot:hover:not(.time-slot-full) {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
  color: var(--dnd-primary);
}

.time-slot.selected {
  border-color: var(--dnd-primary);
  background: var(--dnd-primary);
  color: var(--dnd-white);
}

.time-slot-full {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--dnd-bg-soft);
  border-color: var(--dnd-border);
}

.time-slot-full:hover {
  border-color: var(--dnd-danger);
  background: var(--dnd-danger-soft);
}

.time-slot-capacity {
  font-size: 0.75rem;
  color: var(--dnd-muted);
  margin-top: 0.25rem;
}

.time-slot.selected .time-slot-capacity {
  color: rgba(255, 255, 255, 0.8);
}

.time-slot-full-badge {
  font-size: 0.6875rem;
  color: var(--dnd-danger);
  margin-top: 0.25rem;
  font-weight: 600;
}

.time-slot.selected .time-slot-full-badge {
  color: var(--dnd-white);
}



/* ==========================================================================
   Address Select — redesign (آدرس‌های من / دریافت حضوری)
   ========================================================================== */

/* Row layout now = radio(input) + label.__main (icon+text) + [btn-change-address] + label.__check */
.address-type-card {
  position: relative;
}

.address-type-card__main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 auto;
  cursor: pointer;
  min-width: 0;
}

.btn-change-address {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  color: #16a34a;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-change-address:hover {
  text-decoration: underline;
}

/* Selected-address summary (زیر ردیف «آدرس‌های من») */
.selected-address-summary {
  padding: 0;
  margin-top: 0;
}

.selected-address-summary__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--dnd-text);
}

.selected-address-summary__row .icon {
  flex-shrink: 0;
  color: var(--dnd-muted);
  margin-top: 0.1rem;
}

.selected-address-summary__empty {
  padding: 1rem 0;
}

/* Pickup redesign */
.pickup-hint {
  display: inline-block;
  background: var(--dnd-bg-soft);
  color: var(--dnd-muted);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: var(--dnd-radius-pill);
  margin-bottom: 1rem;
}

.pickup-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  background: var(--dnd-white);
  padding: 1.25rem;
  text-align: start;
  margin-bottom: 2rem;
}

.pickup-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dnd-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pickup-info__body {
  flex: 1 1 auto;
  min-width: 0;
}

.pickup-info__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.pickup-info__top h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--dnd-text);
}

.pickup-distance {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--dnd-muted);
}

.pickup-info p {
  margin: 0 0 0.75rem;
  max-width: none;
  line-height: 1.7;
  font-size: 0.875rem;
}

.pickup-map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--dnd-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.pickup-map-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Address SELECT modal (bottom sheet) — #dnd-address-select-modal
   ========================================================================== */

.dnd-select-modal__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--dnd-border);
}

.dnd-select-modal__header h3 {
  flex: 1 1 auto;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dnd-text);
  text-align: center;
}

.btn-add-address-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: #16a34a;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.dnd-select-modal__body {
  overflow-y: auto;
}

.address-select-item {
  border-bottom: 1px solid var(--dnd-border);
  padding: 1rem 0.25rem;
  cursor: pointer;
}

.address-select-item:last-of-type {
  border-bottom: none;
}

.address-select-item__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.address-select-item__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--dnd-text);
  font-size: 0.95rem;
}

.address-select-item__label .icon {
  color: var(--dnd-muted);
}

.address-select-item .btn-edit-address {
  margin-inline-start: auto;
  background: none;
  border: none;
  padding: 0;
  color: #16a34a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.address-select-item__radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--dnd-border);
  border-radius: 50%;
  position: relative;
}

.address-select-item.selected .address-select-item__radio {
  border-color: #16a34a;
}

.address-select-item.selected .address-select-item__radio::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #16a34a;
}

.address-select-item__row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--dnd-muted);
  padding: 0.15rem 0;
}

.address-select-item__row .icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.address-select-item--add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dnd-primary);
  font-weight: 600;
}

.address-select-list__empty {
  text-align: center;
  padding: 1.5rem 0;
}

/* Bottom-sheet variant of DNDModalBase (slides up, rounded top corners) */
.dnd-modal--sheet .dnd-modal__overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.dnd-modal--sheet .dnd-modal__dialog {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  max-height: 85vh;
  border-radius: 20px 20px 0 0;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.25s ease;
  z-index: 10001;
  opacity: 1;
}

.dnd-modal--sheet.is-active .dnd-modal__dialog {
  transform: translateY(0);
}
