/* Окно выбора адреса доставки ПК-витрины (include/desktop-delivery-modal.php,
   desktop/js/delivery-address.js). Поле адреса, подсказки, карточка зоны, детали
   и тип адреса — общие .da-* из style-main.css; здесь раскладка окна и отличия. */

/* Над шторкой корзины (9998) и подложкой модалок (10005) — как #checkout-modal */
#delivery-modal.dd-modal { z-index: 10010; }

#delivery-modal .dd-dialog {
  max-width: 1040px;
  width: calc(100vw - 64px);
  margin-left: auto;
  margin-right: auto;
}
/* #id в селекторе — перебить мобильное #delivery-modal .modal-content из style-main.css */
#delivery-modal .dd-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  height: min(680px, calc(100vh - 64px));
  max-height: none;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 62px rgba(0, 0, 0, .24);
}

/* ── Карта ── */
.dd-map-col { position: relative; min-height: 0; background: #eef0f3; }
.dd-map { position: absolute; inset: 0; }
.dd-map-hint {
  position: absolute; top: 16px; left: 16px; z-index: 10;
  background: #fff; border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  pointer-events: none;
}
.dd-map-hint strong { display: block; font-size: 13px; font-weight: 600; color: var(--restar-ink, #242832); }
.dd-map-hint span { display: block; margin-top: 2px; font-size: 12px; color: var(--restar-muted, #7b818e); }
.dd-map-pin {
  position: absolute; top: 50%; left: 50%; z-index: 10;
  transform: translate(-50%, -100%);
  font-size: 42px; line-height: 1;
  color: rgba(var(--theme-color), 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.dd-map-status {
  position: absolute; left: 50%; bottom: 20px; z-index: 11;
  transform: translateX(-50%);
  background: #fff; border-radius: 10px; padding: 8px 14px;
  font-size: 13px; color: var(--restar-ink, #242832);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  max-width: calc(100% - 32px); text-align: center;
}

/* ── Панель ── */
.dd-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.dd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 22px 14px;
}
.dd-head h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--restar-ink, #242832); }
.dd-close {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: #f4f2ef; color: var(--restar-ink, #242832);
  font-size: 20px; cursor: pointer;
}
.dd-close:hover { background: #ebe7e2; }
.dd-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 22px 14px; }
.dd-label { margin: 4px 0 8px; font-size: 13px; font-weight: 600; color: var(--restar-ink, #242832); }

/* Сохранённые адреса */
.dd-saved { margin-bottom: 14px; }
.dd-saved-list {
  border: 1px solid rgba(var(--dashed-line), 1);
  border-radius: 12px;
  overflow: hidden;
}
.dd-saved-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: 0; border-bottom: 1px solid rgba(var(--dashed-line), .7);
  background: #fff; text-align: left; cursor: pointer;
}
.dd-saved-item:last-child { border-bottom: 0; }
.dd-saved-item:hover { background: rgba(var(--theme-color), .05); }
.dd-saved-item.is-active { background: rgba(var(--theme-color), .08); }
.dd-saved-item > i:first-child { font-size: 18px; color: rgba(var(--theme-color), 1); flex-shrink: 0; }
.dd-saved-text {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--restar-muted, #7b818e);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-saved-text b { display: block; font-size: 13px; font-weight: 600; color: var(--restar-ink, #242832); }
.dd-saved-default { font-size: 15px; color: rgba(var(--theme-color), 1); flex-shrink: 0; }

/* Зона доставки */
.dd-zone { margin-bottom: 16px; }
.dd-zone-hint {
  margin-bottom: 16px; padding: 10px 12px;
  border: 1.5px dashed rgba(var(--dashed-line), 1); border-radius: 12px;
  font-size: 13px; color: var(--restar-muted, #7b818e);
}

/* Детали адреса: 4 поля в ряд, при «Частном доме» — необязательные и бледнее */
.dd-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.dd-details .da-detail-input { min-width: 0; padding: 10px; }
.dd-details--optional .da-detail-input { opacity: .55; }
.dd-comment { width: 100%; margin-bottom: 16px; }

/* Тип адреса — компактные кнопки в строку */
.dd-type-row { flex-wrap: nowrap; margin-bottom: 4px; }
.dd-type-row .da-type-btn { flex-direction: row; justify-content: center; gap: 6px; padding: 9px 6px; min-width: 0; }
.dd-type-row .da-type-btn i { font-size: 16px; }
.dd-type-row .da-type-btn.active::after { display: none; }

/* ── Низ панели ── */
.dd-foot { padding: 14px 22px 20px; border-top: 1px solid var(--restar-line, #ece8e3); }
.dd-error { margin-bottom: 10px; font-size: 13px; color: #e74c3c; }
.dd-submit {
  width: 100%; height: 50px;
  border: 0; border-radius: 12px;
  background: rgba(var(--theme-color), 1); color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.dd-submit:hover:not(:disabled) { opacity: .9; }
.dd-submit:disabled { opacity: .45; cursor: not-allowed; }

/* Узкое окно (ПК-версия закреплена на маленьком экране): карта сверху, панель снизу */
@media (max-width: 860px) {
  #delivery-modal .dd-dialog { width: calc(100vw - 24px); }
  #delivery-modal .dd-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 280px minmax(0, 1fr);
    height: calc(100vh - 32px);
  }
  .dd-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dd-type-row { flex-wrap: wrap; }
}

/* Зона «по тарифу Яндекса»: пояснение к цене доставки в оформлении (checkout.js) */
.co-delivery-note { color: #8a909a; font-size: 12px; font-weight: 400; }
div.co-delivery-note { margin-top: 2px; text-align: right; }
