.address-pin-widget {
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
}

.address-pin-widget__header,
.address-pin-widget__actions,
.address-pin-widget__search-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.address-pin-widget__header {
  margin-bottom: 16px;
}

.address-pin-widget__map-group {
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  background: var(--theme-surface);
}

.address-pin-widget__search-panel {
  position: relative;
  z-index: 2;
  padding: 14px;
  border-radius: 10px 10px 0 0;
  background: var(--theme-surface);
}

.address-pin-widget__search-label {
  color: var(--theme-text);
  font-size: 15px;
  font-weight: 700;
}

.address-pin-widget__locate {
  padding: 8px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-surface-alt);
  color: var(--theme-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.address-pin-widget__locate:hover,
.address-pin-widget__locate:focus-visible {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
}

.address-pin-widget__search {
  position: relative;
  z-index: 3;
  margin-top: 10px;
}

.address-pin-widget__search input,
.address-pin-widget__search gmp-place-autocomplete {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--theme-border);
  border-radius: 7px;
  background-color: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  font-size: 16px;
}

.address-pin-widget__search input {
  padding: 10px 14px;
}

.address-pin-widget__search input::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

.address-pin-widget__search gmp-place-autocomplete {
  --gmp-mat-color-surface: var(--theme-surface);
  --gmp-mat-color-on-surface: var(--theme-text);
  --gmp-mat-color-on-surface-variant: var(--theme-muted);
}

html[data-theme="light"] .address-pin-widget__search gmp-place-autocomplete {
  color-scheme: light;
}

html[data-theme="dark"] .address-pin-widget__search gmp-place-autocomplete {
  color-scheme: dark;
}

.address-pin-widget__search-hint {
  margin: 8px 0 0;
  color: var(--theme-muted);
  font-size: 13px;
  line-height: 1.4;
}

.address-pin-widget__map-wrap {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-top: 1px solid var(--theme-border);
  border-radius: 0 0 10px 10px;
  background: #f3f4f6;
}

.address-pin-widget__map {
  width: 100%;
  height: 100%;
}

.address-pin-widget__center-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid #b91c1c;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -100%) rotate(-45deg);
  background: #fff;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.address-pin-widget__actions {
  margin-top: 12px;
}

.address-pin-widget__handoff {
  min-width: 210px;
  flex: 1;
}

.address-pin-widget__location,
.address-pin-widget__estimate {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.address-pin-widget__estimate {
  color: var(--theme-muted);
}

.address-estimate-button {
  padding: 8px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  background: var(--theme-surface);
  color: var(--theme-accent);
  font-size: 13px;
}

.address-book__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.address-book__field--wide { grid-column: 1 / -1; }
.address-book__field { min-width: 0; }
.address-book__field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; }
.address-book__field label span { color: var(--theme-muted); font-weight: 400; font-size: 11px; }
.address-book__field input, .address-book__field textarea { width: 100%; border-radius: 8px; font-size: 14px; }
.address-book__modal-hint { color: var(--theme-muted); font-size: 12px; }
.modal-header:has(.address-book__modal-hint) { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.modal-header:has(.address-book__modal-hint) .modal-title,
.modal-header .address-book__modal-hint { grid-column: 1; }
.modal-header:has(.address-book__modal-hint) .btn-close { grid-column: 2; grid-row: 1 / 3; }

@media (max-width: 575px) {
  .address-book__fields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .address-book__field input, .address-book__field textarea { font-size: 16px; }
  .address-pin-widget__search-heading {
    align-items: flex-start;
  }

  .address-pin-widget__locate {
    width: 100%;
    text-align: center;
  }
}
