/* AVM contextuele verkoop-leadpop-up (/auto-verkopen/, /camper-verkopen/ en verwante
   verkoop-/waardebepalingslandingspagina's). Volledig zelfstandig bestand, net als
   chat-widget.css, zodat dit los van main.css meegroeit/verwijderd kan worden. Kleuren,
   radius- en shadowwaarden zijn 1:1 overgenomen uit de bestaande tokens in main.css
   (--ink/--green/--paper/--soft/--line) en het bestaande chatpaneel (avm-chat-panel).
   Body-scroll-lock volgt exact hetzelfde patroon als .gallery-fullscreen-open. */

/* Zelfde behandeling als body.gallery-fullscreen-open: voorkomt dat de zwevende
   WhatsApp-knop of de chat-toggle boven onze modal blijven zweven/klikbaar zijn. */
body.avm-lead-popup-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
body.avm-lead-popup-open .floating-whatsapp,
body.avm-lead-popup-open .avm-chat-toggle,
body.avm-lead-popup-open .avm-chat-attention { display: none !important; }

.avm-lead-popup-backdrop {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: rgba(7, 20, 27, .72);
  animation: avmLeadPopupFade .18s ease-out;
}
.avm-lead-popup-backdrop[hidden] { display: none; }

@keyframes avmLeadPopupFade { from { opacity: 0; } to { opacity: 1; } }

.avm-lead-popup {
  position: relative;
  display: flex;
  width: min(880px, 100%);
  max-height: min(92vh, 720px);
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px #06121c33, 0 2px 10px #06121c26;
  animation: avmLeadPopupRise .22s ease-out;
}
@keyframes avmLeadPopupRise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.avm-lead-popup-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; border: none;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 2px 10px #06121c26;
  cursor: pointer;
}
.avm-lead-popup-close:hover { background: var(--soft); }
.avm-lead-popup-close svg { width: 18px; height: 18px; }

.avm-lead-popup-media { position: relative; flex: 0 0 38%; min-width: 0; background: var(--soft); }
.avm-lead-popup-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avm-lead-popup-body {
  flex: 1 1 auto; min-width: 0; overflow-y: auto;
  padding: 34px 34px 28px;
}

.avm-lead-popup-eyebrow { color: var(--ink); opacity: .68; margin-bottom: 10px; }
.avm-lead-popup h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.15; margin: 0 0 10px; color: var(--ink); }
.avm-lead-popup-text { color: var(--muted); font-size: .9375rem; line-height: 1.5; margin: 0 0 22px; }

.avm-lead-popup-form { display: flex; flex-direction: column; gap: 14px; }
.avm-lead-popup-row { display: flex; flex-direction: column; gap: 6px; }
.avm-lead-popup-row label { font-size: .8125rem; font-weight: 700; color: var(--ink); }
.avm-lead-popup-row .avm-lead-popup-optional { font-weight: 500; color: var(--muted); }
.avm-lead-popup-row input {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font: inherit; font-size: .9375rem; color: var(--ink); background: var(--paper);
  min-height: 46px;
}
.avm-lead-popup-row input:focus-visible { outline: 3px solid #527d22; outline-offset: 1px; }
.avm-lead-popup-row input[aria-invalid="true"] { border-color: #b4373a; }
.avm-lead-popup-row-error { font-size: .8125rem; color: #b4373a; margin: 0; }

.avm-lead-popup-form .button {
  justify-content: center; width: 100%; margin-top: 4px;
  min-height: 52px;
}
.avm-lead-popup-form .button[disabled] { opacity: .65; cursor: not-allowed; }

.avm-lead-popup-subcta { font-size: .8125rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.avm-lead-popup-privacy { font-size: .75rem; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.avm-lead-popup-privacy a { color: inherit; text-decoration: underline; }

.avm-lead-popup-error-banner {
  font-size: .8125rem; color: #7a2325; background: #fbe9e9; border: 1px solid #f0c4c5;
  border-radius: 10px; padding: 10px 12px; margin: 0 0 14px;
}
.avm-lead-popup-error-banner[hidden] { display: none; }

.avm-lead-popup-success { text-align: center; padding: 20px 0 4px; }
.avm-lead-popup-success[hidden] { display: none; }
.avm-lead-popup-success-icon {
  width: 52px; height: 52px; border-radius: 999px; background: var(--green);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
}
.avm-lead-popup-success-icon svg { width: 26px; height: 26px; color: var(--ink); }
.avm-lead-popup-success h3 { font-size: 1.25rem; font-weight: 800; margin: 0 0 8px; color: var(--ink); }
.avm-lead-popup-success p { font-size: .9375rem; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.avm-lead-popup-success .button { width: 100%; justify-content: center; }

@media (max-width: 760px) {
  .avm-lead-popup-backdrop { padding: 0; align-items: flex-end; }
  .avm-lead-popup {
    flex-direction: column;
    width: 100%; max-width: 100%;
    max-height: min(94vh, 100%);
    border-radius: 20px 20px 0 0;
  }
  .avm-lead-popup-media { flex: 0 0 auto; height: 112px; }
  .avm-lead-popup-body { padding: 22px 20px 24px; }
  .avm-lead-popup h2 { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .avm-lead-popup-backdrop, .avm-lead-popup { animation: none; }
}

/* SOH: variant van de bestaande modal; uitsluitend op de EV-pagina. */
.avm-soh-backdrop { padding: 16px; align-items: center; }
.avm-soh-popup { width: min(640px, 100%); max-height: calc(100dvh - 32px); border-radius: 20px; }
.avm-soh-popup .avm-lead-popup-body { padding: 30px 28px 26px; }
.avm-soh-popup .eyebrow { padding-right: 36px; font-size: .7rem; margin: 0 0 14px; }
.avm-soh-popup h2 { padding-right: 24px; font-size: 1.55rem; line-height: 1.2; }
.avm-soh-popup p, .avm-soh-popup li { line-height: 1.5; }
.avm-soh-popup .avm-soh-price { border-radius: 12px; padding: 14px 16px; background: var(--ink); color: var(--paper); margin: 18px 0; }
.avm-soh-price strong { font-size: 1.7rem; white-space: nowrap; }
.avm-soh-included { border-radius: 12px; background: var(--soft); padding: 16px; }
.avm-soh-included p { font-size: .8rem; margin: 8px 0 0; }
.avm-soh-popup ul { padding-left: 20px; margin: 16px 0; }
.avm-soh-popup .avm-soh-disclaimer, .avm-soh-summary, #avm-soh-rdw { font-size: .8rem; color: var(--muted); margin: 8px 0; }
.avm-soh-actions { display: grid; gap: 12px; margin-top: 18px; }
.avm-soh-actions .button { width: 100%; justify-content: center; min-height: 48px; white-space: normal; text-align: center; border-radius: 12px; }
.avm-soh-popup [hidden] { display: none; }
.avm-soh-popup input, .avm-soh-popup textarea { min-width: 0; width: 100%; font-size: 16px; }
.avm-soh-popup textarea { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-family: inherit; resize: vertical; }
.avm-soh-popup :focus-visible { outline: 3px solid #527d22; outline-offset: 2px; }
@media (min-width: 761px) {
  #soh-test .avm-soh-actions { display: flex; flex-wrap: wrap; }
  #soh-test .avm-soh-actions .button { width: auto; }
}
@media (max-width: 760px) {
  .avm-soh-backdrop { padding: 12px; align-items: center; }
  .avm-soh-popup { max-height: calc(100dvh - 24px); border-radius: 18px; }
  .avm-soh-popup .avm-lead-popup-body { padding: 22px 18px; }
  .avm-soh-popup .avm-soh-offer { font-size: .875rem; }
  .avm-soh-popup .avm-soh-offer > p { margin: 12px 0; }
  .avm-soh-popup .avm-soh-price, .avm-soh-popup .avm-soh-included { padding: 12px; }
  .avm-soh-popup ul { margin: 12px 0; }
  .avm-soh-popup h2 { font-size: 1.25rem; }
  .avm-soh-popup .avm-lead-popup-close { top: 10px; right: 10px; }
}

/* SOH op mobiel: compacte kaart onderin, max. ca. 80% schermhoogte; sluitknop blijft buiten het scrollgebied. */
@media (max-width: 760px) {
  .avm-soh-backdrop { padding: 0; align-items: flex-end; }
  .avm-soh-popup { width: 100%; max-height: 80vh; max-height: 80dvh; border-radius: 18px 18px 0 0; }
  .avm-soh-popup .avm-lead-popup-body { padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .avm-soh-popup .avm-soh-offer > ul { display: none; }
  .avm-soh-popup .avm-soh-actions { margin-top: 14px; gap: 10px; }
}
