.address-summary-section {
  position: relative;
}

.js__addressSummaryBlock,
.address-summary-block {
  position: relative;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 0;
  box-shadow: none;
  color: var(--text);
}

.js__addressSummaryBlock.block {
  padding: 16px;
  border: 2px solid var(--border);
}

.js__addressSummaryBlock .option-main {
  margin-bottom: 8px;
}

.address-summary-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.address-summary-address,
.address-summary-phone,
.address-summary-country {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.address-edit-btn {
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.js__addressSummaryBlock .address-edit-btn {
  background: var(--white);
  padding: 8px 14px;
}

.address-edit-btn:hover,
.address-edit-btn:focus {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--white);
  outline: none;
}

/* Overlay */

.address-overlay,
.terms-overlay,
.address-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.address-modal {
  z-index: 10100;
}

.address-modal[hidden] {
  display: none;
}

.address-overlay .block,
.terms-overlay .block,
.address-modal .block,
.address-overlay__content,
.address-modal__content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  color: var(--text);
}

.terms-overlay .block {
  height: auto;
  max-height: 80vh;
}

/* Overlay header */

.address-overlay__header,
.block__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.address-overlay__close,
.address-modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-overlay__close:hover,
.address-overlay__close:focus,
.address-modal__close:hover,
.address-modal__close:focus {
  background: var(--bg);
  color: var(--dark);
  outline: none;
}

/* Address list */

.address-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 4px;
}

.address-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: none;
  color: var(--text);
}

.address-card.selected {
  border-color: var(--teal);
  background: rgba(18, 78, 102, 0.04);
}

.address-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.address-card__details,
.address-card__phone {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.address-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.address-card__icons {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}

.address-card__edit-btn,
.address-card__remove-btn,
.address-card__select-btn,
.address-card__add-btn {
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.address-card__edit-btn,
.address-card__remove-btn {
  width: 36px;
  height: 36px;
  padding: 6px;
}

.address-card__edit-btn:hover,
.address-card__edit-btn:focus,
.address-card__select-btn:hover,
.address-card__select-btn:focus {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--white);
  outline: none;
}

.address-card__select-btn {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.address-card__select-btn:hover,
.address-card__select-btn:focus {
  background: var(--teal);
  color: #fff;
  opacity: 0.9;
}

.address-card__remove-btn {
  color: #E84241;
}

.address-card__remove-btn:hover,
.address-card__remove-btn:focus {
  border-color: #E84241;
  background: rgba(232, 66, 65, 0.08);
  color: #E84241;
  outline: none;
}

.address-card__add-btn {
  width: 100%;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  color: var(--teal);
}

.address-card__add-btn:hover,
.address-card__add-btn:focus {
  border-color: var(--teal);
  background: rgba(18, 78, 102, 0.04);
  outline: none;
}

/* Modal form */

.address-modal form {
  display: flex;
  flex-direction: column;
}

.address-modal input,
.address-modal select {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}

.address-modal input:focus,
.address-modal select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 78, 102, 0.12);
}

.address-modal select[name="country"] option {
  background: var(--white);
  color: var(--text);
}

.address-modal__save-btn,
.address-modal .button,
.address-modal .button--big {
  width: 100%;
  min-height: 48px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(232, 150, 0, 0.2);
}

.address-modal__save-btn:hover,
.address-modal .button:hover,
.address-modal .button--big:hover {
  background: var(--gold-hover);
}

/* Mobile */

@media (max-width: 768px) {
  .address-overlay,
  .terms-overlay,
  .address-modal {
    padding: 16px;
  }

  .address-card {
    flex-direction: column;
  }

  .address-card__actions {
    align-items: stretch;
  }

  .address-card__icons {
    justify-content: flex-end;
  }

  .address-card__select-btn {
    width: 100%;
    justify-content: center;
  }
}