.address-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 18px; visibility: hidden; opacity: 0; transition: opacity .18s, visibility .18s; }
.address-modal.is-open { visibility: visible; opacity: 1; }
.address-dialog [hidden] { display: none !important; }
.address-modal-backdrop { position: absolute; inset: 0; background: rgba(7,24,16,.58); backdrop-filter: blur(5px); }
.address-dialog { position: relative; width: min(760px,100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.28); transform: translateY(12px) scale(.985); transition: transform .2s; }
.address-modal.is-open .address-dialog { transform: none; }
.address-dialog-head { min-height: 62px; display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 6px; padding: 12px 18px 8px; }
.address-dialog-head h2 { font-size: 23px; line-height: 1.2; }
.address-back[hidden] + h2 { grid-column: 1 / 3; }
.address-back { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #f1f3f0; color: var(--brand); cursor: pointer; font-size: 22px; font-weight: 800; }
.address-close { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #f1f3f0; color: var(--text); cursor: pointer; font-size: 26px; line-height: 1; }
.address-close:hover { background: #e7eae6; }
.address-dialog-body { min-height: 0; padding: 0 20px; overflow-y: auto; }
.address-saved-view { min-height: 0; padding: 0 20px 18px; overflow-y: auto; }
.address-saved-list { display: grid; gap: 7px; }
.address-saved-item { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) 24px; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.address-saved-item:hover, .address-saved-item:focus-visible { border-color: rgba(15,61,40,.34); background: var(--brand-soft); outline: 0; }
.address-saved-item.is-default { border-color: rgba(15,61,40,.24); }
.address-saved-item.is-selecting { border-color: var(--accent); background: #fff8e4; box-shadow: 0 0 0 3px rgba(230,168,0,.12); }
.address-saved-item:disabled { cursor: wait; opacity: .7; }
.address-saved-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.address-saved-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.address-saved-copy { min-width: 0; display: grid; gap: 3px; }
.address-saved-copy strong, .address-saved-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.address-saved-copy strong { font-size: 14px; }
.address-saved-copy small { color: var(--muted); font-size: 12px; }
.address-default-mark { color: var(--brand); font-size: 18px; font-weight: 900; text-align: center; }
.address-add-new { width: 100%; height: 46px; margin-top: 10px; border: 1.5px dashed rgba(15,61,40,.34); border-radius: 12px; background: #fff; color: var(--brand); cursor: pointer; font: inherit; font-size: 14px; font-weight: 800; }
.address-add-new:hover { background: var(--brand-soft); }
.address-add-new span { font-size: 18px; vertical-align: -1px; }
.address-saved-status { min-height: 18px; padding: 7px 2px 0; color: var(--muted); font-size: 12px; }
.address-saved-status:empty { min-height: 0; padding: 0; }
.address-saved-status.is-error { color: var(--red); }
.address-required-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 1px 6px; }
.address-required-note label { color: var(--text); font-size: 13px; font-weight: 650; }
.address-required-note label span { color: var(--red); }
.address-required-note small { color: var(--muted); font-size: 11px; }
.address-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.address-search-field { height: 46px; display: flex; flex: 1; align-items: center; gap: 9px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #f7f8f6; }
.address-search-field:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(230,168,0,.11); }
.address-search-field.is-invalid { border-color: var(--red); background: #fff7f5; box-shadow: 0 0 0 3px rgba(214,59,39,.1); }
.address-search-field svg, .address-search-btn svg { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.address-search-field svg { color: var(--muted); }
.address-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.address-search-btn { height: 46px; display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer; font-weight: 750; }
.address-search-btn:hover { background: var(--brand-dark); }
.address-map-wrap { position: relative; height: min(245px,34vh); min-height: 210px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #e8eeea; }
.address-map { width: 100%; height: 100%; }
.address-map-loading { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 9px; background: #eef2ed; color: var(--muted); font-size: 13px; }
.address-map-loading.is-hidden { display: none; }
.address-map-loading.is-error { padding: 20px; color: var(--red); text-align: center; }
.address-map-loading span { width: 18px; height: 18px; border: 2px solid rgba(15,61,40,.18); border-top-color: var(--brand); border-radius: 50%; animation: address-spin .7s linear infinite; }
.address-map-loading.is-error span { display: none; }
@keyframes address-spin { to { transform: rotate(360deg); } }
.address-map-reset { position: absolute; top: 10px; right: 10px; z-index: 3; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.94); color: var(--brand); box-shadow: 0 4px 12px rgba(0,0,0,.09); cursor: pointer; font-size: 12px; font-weight: 800; }
.address-center-target { position: absolute; left: 50%; top: 50%; z-index: 3; width: 38px; height: 50px; pointer-events: none; transform: translate(-50%,-100%); transition: transform .16s ease; }
.address-center-target svg { position: relative; z-index: 2; display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 7px rgba(0,0,0,.24)); }
.address-pin-shape { fill: var(--accent); stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.address-pin-ring { fill: #fff; }
.address-pin-dot { fill: var(--brand-dark); }
.address-pin-shadow { position: absolute; left: 50%; bottom: -5px; width: 20px; height: 6px; border-radius: 50%; background: rgba(15,61,40,.24); filter: blur(2px); transform: translateX(-50%); transition: width .16s ease, opacity .16s ease; }
.address-map-wrap.is-panning .address-center-target { transform: translate(-50%,-100%) translateY(-7px); }
.address-map-wrap.is-panning .address-pin-shadow { width: 26px; opacity: .48; }
.address-status { min-height: 24px; padding: 6px 2px 2px; color: var(--muted); font-size: 12px; }
.address-status:empty { min-height: 9px; padding-top: 0; }
.address-status.is-error { color: var(--red); }
.address-map-unavailable { padding: 22px; border: 1px dashed var(--line); border-radius: 14px; background: #f7f8f6; color: var(--muted); text-align: center; font-size: 13px; }
.address-modal-types { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 10px; }
.address-modal-types label { cursor: pointer; }
.address-modal-types input { position: absolute; opacity: 0; pointer-events: none; }
.address-modal-types span { height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 750; }
.address-modal-types input:checked + span { border-color: rgba(15,61,40,.28); background: var(--brand-soft); color: var(--brand); }
.address-details-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding-bottom: 4px; }
.address-details-grid label { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.address-details-grid label.is-wide { grid-column: span 2; }
.address-details-grid span { color: var(--muted); font-size: 11px; font-weight: 700; }
.address-details-grid input { width: 100%; height: 40px; min-width: 0; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fafbfa; color: var(--text); font: inherit; font-size: 13px; }
.address-details-grid input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(230,168,0,.09); }
.address-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px 17px; border-top: 1px solid rgba(0,0,0,.055); background: #fff; }
.address-dialog-actions .btn { min-width: 112px; justify-content: center; padding-block: 10px; }
.address-confirm { min-width: 160px !important; }
body.address-modal-open { overflow: hidden; }

@media (max-width: 600px) {
  .address-modal { align-items: end; padding: 0; }
  .address-dialog { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; transform: translateY(24px); }
  .address-dialog-head { min-height: 54px; padding: 9px 14px 6px 16px; }
  .address-dialog-head h2 { font-size: 20px; }
  .address-dialog-body { padding-inline: 14px; }
  .address-saved-view { padding-inline: 14px; }
  .address-search-btn { width: 46px; padding: 0; justify-content: center; }
  .address-search-btn span { display: none; }
  .address-map-wrap { height: 220px; min-height: 205px; }
  .address-details-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .address-details-grid label.is-wide { grid-column: span 2; }
  .address-dialog-actions { padding: 10px 14px 14px; }
  .address-dialog-actions .btn { flex: 1; min-width: 0; padding-inline: 10px; }
  .address-confirm { min-width: 0 !important; }
}
