/* Address modal - Knuspr split layout (mapa à esquerda + wizard à direita) */
.addr-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.addr-overlay.open { display: flex; }

.addr-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  animation: addr-pop .2s ease;
  position: relative;
}

.addr-modal--split {
  display: flex;
  height: min(560px, 88vh);
}

@keyframes addr-pop {
  from { opacity: 0; transform: scale(.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.addr-modal__close {
  position: absolute;
  top: .85rem;
  right: .85rem;
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  transition: border-color .15s, transform .15s;
}
.addr-modal__close:hover { border-color: #999; transform: rotate(90deg); }

/* ── COLUNA ESQUERDA: mapa + estatísticas ── */
.addr-modal__map-col {
  position: relative;
  flex: 0 0 42%;
  min-width: 0;
  background: #e8e8e8;
}
.addr-modal__map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e8e8e8;
}
.addr-modal__map .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
}

.addr-map-stats {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 500;
  display: flex;
  gap: .6rem;
  pointer-events: none;
}
.addr-map-stat {
  background: #fff;
  border-radius: 12px;
  padding: .55rem .8rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.addr-map-stat__num {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a1d1b;
}
.addr-map-stat__lbl {
  font-size: .68rem;
  font-weight: 600;
  color: #777;
  margin-top: .1rem;
}

/* ── COLUNA DIREITA: wizard + conteúdo ── */
.addr-modal__content-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Passos do wizard */
.addr-steps {
  display: flex;
  gap: 1.25rem;
  padding: 1.1rem 1.5rem .5rem;
  border-bottom: 1px solid #eee;
}
.addr-step {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding-bottom: .55rem;
  font-size: .78rem;
  font-weight: 700;
  color: #b5b5b5;
  position: relative;
  white-space: nowrap;
}
.addr-step__num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e2e2e2;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 800;
}
.addr-step--active { color: #1a1d1b; }
.addr-step--active .addr-step__num { background: #F25C54; }
.addr-step--done { color: #82AD49; }
.addr-step--done .addr-step__num { background: #82AD49; }
.addr-step--active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: #F25C54;
  border-radius: 2px;
}

.addr-modal__body {
  padding: 1.4rem 1.5rem 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.addr-modal__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1d1b;
  margin: 0 0 .4rem;
  line-height: 1.2;
}
.addr-modal__desc {
  font-size: .9rem;
  color: #666;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.addr-modal__label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: #555;
  margin-bottom: .4rem;
}

.addr-input-wrap {
  position: relative;
  margin-bottom: .45rem;
}

.addr-modal__input {
  width: 100%;
  padding: .8rem 2.8rem .8rem 2.6rem;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  font: inherit;
  font-size: .92rem;
  color: #333;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") .85rem center no-repeat;
  transition: border-color .15s, box-shadow .15s;
}
.addr-modal__input:focus {
  outline: none;
  border-color: #F25C54;
  box-shadow: 0 0 0 3px rgba(242, 92, 84,.12);
}
.addr-modal__input::placeholder { color: #aaa; }

.addr-locate-btn {
  position: absolute;
  top: 50%;
  right: .45rem;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #fff7f0;
  color: #F25C54;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
}
.addr-locate-btn:hover {
  background: #F25C54;
  color: #fff;
}
.addr-locate-btn:disabled,
.addr-locate-btn.is-busy {
  opacity: .65;
  cursor: wait;
}
.addr-locate-btn.is-busy svg {
  animation: addr-locate-spin .9s linear infinite;
}

.addr-locate-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0 0 .75rem;
  padding: 0;
  border: none;
  background: none;
  color: #F25C54;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.addr-locate-link:hover { text-decoration: underline; }
.addr-locate-link:disabled,
.addr-locate-link.is-busy {
  opacity: .65;
  cursor: wait;
  text-decoration: none;
}
.addr-locate-link.is-busy svg {
  animation: addr-locate-spin .9s linear infinite;
}

@keyframes addr-locate-spin {
  to { transform: rotate(360deg); }
}

.addr-geocode-hint {
  margin: -.25rem 0 .85rem;
  font-size: .78rem;
  color: #888;
  min-height: 1.1em;
}

/* Dropdown de país */
.addr-country-select {
  margin: 0 0 1.1rem;
  text-align: left;
}
.addr-country-select[hidden] { display: none; }
.addr-country-select__label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: #555;
  margin-bottom: .4rem;
}
.addr-country-select__input {
  width: 100%;
  padding: .7rem .9rem;
  font: inherit;
  font-size: .9rem;
  color: #1a1d1b;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.addr-country-select__input:hover { border-color: #ccc; }
.addr-country-select__input:focus {
  outline: none;
  border-color: #F25C54;
  box-shadow: 0 0 0 3px rgba(242, 92, 84,.12);
}

.addr-modal__login {
  font-size: .82rem;
  color: #666;
  margin: 0 0 1rem;
}
.addr-modal__login a {
  color: #1a1d1b;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Portes / zona ── */
.addr-delivery-info {
  margin: .25rem 0 0;
  padding: .9rem 1rem;
  text-align: left;
  background: #f6fbf7;
  border: 1px solid #d8eadc;
  border-radius: 12px;
}
.addr-delivery-info[hidden] { display: none !important; }
.addr-delivery-info__title {
  font-size: .8125rem;
  font-weight: 800;
  color: #82AD49;
  margin-bottom: .45rem;
  letter-spacing: -0.01em;
}
.addr-delivery-info__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1.25rem;
  margin-bottom: .4rem;
}
.addr-delivery-info__price { font-size: .875rem; color: #333; }
.addr-delivery-info__price strong { font-size: 1.05rem; font-weight: 800; color: #111; }
.addr-delivery-info__free { font-size: .8125rem; color: #555; }
.addr-delivery-info__meta { font-size: .78rem; color: #666; margin: 0; line-height: 1.45; }
.addr-delivery-info__pill {
  display: inline-block;
  padding: .08rem .35rem;
  border-radius: 4px;
  background: #EAF3DC;
  color: #82AD49;
  font-weight: 700;
  font-size: .72rem;
}

.addr-delivery-info__title--warn { color: #b45309; }

.addr-step-panel[hidden] { display: none !important; }

/* ── Made in Market Plus (passo 2) ── */
.addr-plus__logo {
  display: block;
  width: min(200px, 70%);
  height: auto;
  margin: 0 0 .75rem;
}
.addr-plus__badge {
  display: inline-block;
  margin-bottom: .55rem;
  padding: .22rem .65rem;
  border-radius: 999px;
  background: #5c2b12;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.addr-plus .addr-modal__title { margin-bottom: .35rem; }
.addr-plus__list {
  margin: .85rem 0 1rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.addr-plus__list li {
  font-size: .88rem;
  color: #444;
  line-height: 1.45;
  padding: .7rem .85rem .7rem 2.35rem;
  position: relative;
  background: #fff8f3;
  border: 1px solid #ffe0cc;
  border-radius: 10px;
}
.addr-plus__list li::before {
  content: '✓';
  position: absolute;
  left: .85rem;
  top: .7rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #F25C54;
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.addr-plus__list li strong { color: #1a1d1b; }
.addr-plus__link {
  display: inline-block;
  font-size: .88rem;
  font-weight: 700;
  color: #F25C54;
  text-decoration: none;
}
.addr-plus__link:hover { text-decoration: underline; }

/* ── Porquê nós (passo 3) ── */
.addr-why-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.addr-why-list li {
  font-size: .88rem;
  color: #444;
  line-height: 1.45;
  padding-left: 1.35rem;
  position: relative;
}
.addr-why-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #82AD49;
  font-weight: 800;
}

.addr-back-btn {
  padding: .55rem .9rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  color: #555;
  cursor: pointer;
}
.addr-back-btn[hidden] { display: none; }
.addr-back-btn:hover { border-color: #bbb; }

/* ── Rodapé com botão Continuar ── */
.addr-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.5rem;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.addr-modal__footer-note {
  font-size: .74rem;
  color: #999;
  line-height: 1.3;
}
.addr-go-btn {
  padding: .8rem 2rem;
  background: #F25C54;
  color: #fff;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.addr-go-btn:hover { background: #e65c00; }

/* Marcador laranja (tipo Knuspr) */
.addr-leaflet-divicon { background: transparent !important; border: none !important; }
.addr-leaflet-pin {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}
.addr-leaflet-pin__inner {
  width: 26px;
  height: 26px;
  background: #F25C54;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* ── Responsivo: empilha mapa em cima, conteúdo em baixo ── */
@media (max-width: 720px) {
  .addr-modal--split {
    flex-direction: column;
    height: auto;
    max-height: 92vh;
  }
  .addr-modal__map-col {
    flex: 0 0 180px;
    height: 180px;
  }
  .addr-modal__content-col { flex: 1 1 auto; min-height: 0; }
  .addr-steps { gap: .85rem; padding: .9rem 1.1rem .4rem; overflow-x: auto; }
  .addr-step__lbl { font-size: .72rem; }
  .addr-modal__body { padding: 1.1rem 1.1rem .9rem; }
  .addr-modal__title { font-size: 1.2rem; }
  .addr-modal__footer { padding: .75rem 1.1rem; }
  .addr-map-stat__num { font-size: 1rem; }
}

/* ── Dark · Knuspr tangerine-dark ── */
html[data-theme="dark"] .addr-modal {
  background: #252525;
  color: #f2f4f4;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] .addr-modal__close {
  background: #1c2529;
  border-color: #374045;
  color: #f2f4f4;
}
html[data-theme="dark"] .addr-modal__title,
html[data-theme="dark"] .addr-modal h2,
html[data-theme="dark"] .addr-step__lbl {
  color: #f2f4f4;
}
html[data-theme="dark"] .addr-modal__sub,
html[data-theme="dark"] .addr-modal p,
html[data-theme="dark"] .addr-modal__hint {
  color: #b6bdc0;
}
html[data-theme="dark"] .addr-modal input,
html[data-theme="dark"] .addr-modal select,
html[data-theme="dark"] .addr-modal textarea,
html[data-theme="dark"] .addr-suggest,
html[data-theme="dark"] .addr-modal__footer {
  background: #1c2529;
  border-color: #374045;
  color: #f2f4f4;
}
html[data-theme="dark"] .addr-suggest__item:hover,
html[data-theme="dark"] .addr-option:hover {
  background: #374045;
}
html[data-theme="dark"] .addr-steps {
  border-bottom-color: #374045;
}
html[data-theme="dark"] .addr-modal__content-col {
  background: #252525;
}
html[data-theme="dark"] .addr-chip,
html[data-theme="dark"] .addr-saved {
  background: #1c2529;
  border-color: #374045;
  color: #f2f4f4;
}
