/* Asset version: 2026.10.18-2 — vehicle contact card with message form. */

.contact-widget--form {
  --vc-gap: clamp(16px, 2.4vw, 28px);
  --vc-radius: 18px;
  --vc-field-radius: 11px;
  --vc-line: rgba(0, 19, 40, .12);
  --vc-muted: #5b6573;
  --vc-ink: #0d1b31;
  --vc-accent: var(--accent, #0a6cff);
  --vc-accent-hover: var(--accentHover, #1a7bff);
  right: var(--vc-gap);
  bottom: var(--vc-gap);
}

.contact-widget--form .contact-card {
  box-sizing: border-box;
  width: min(500px, calc(100vw - 2 * var(--vc-gap)));
  max-width: none;
  /* Bottom-anchored; the navigation and top of the page stay visible. */
  max-height: calc(100dvh - var(--nav-h, 85px) - 2 * var(--vc-gap));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border-radius: var(--vc-radius);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .18), 0 32px 80px rgba(0, 0, 0, .22);
  color: var(--vc-ink);
  transform: translateY(10px) scale(.985);
  scrollbar-width: thin;
}

.contact-widget--form.open .contact-card { transform: none; }

.contact-widget--form .card-chrome {
  margin: 0 0 16px;
  padding-right: 40px;
}

.contact-widget--form .card-chrome h3 {
  font-size: 22px;
  line-height: 1.15;
  color: var(--vc-ink);
}

.contact-widget--form .contact-card-vehicle {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--vc-muted);
}

.contact-widget--form .contact-card-vehicle[hidden] { display: none; }

.contact-widget--form .contact-card-vehicle-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-widget--form .contact-card-vehicle-price {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--vc-ink);
}

.contact-widget--form .contact-close {
  top: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background-color .15s ease;
}

.contact-widget--form .contact-close svg { width: 20px; height: 20px; }
.contact-widget--form .contact-close:hover { background: rgba(0, 19, 40, .06); }

.contact-widget--form .contact-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-widget--form .contact-link {
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--vc-field-radius);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--vc-line), 0 4px 12px rgba(0, 0, 0, .04);
}

.contact-widget--form .contact-link:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(0, 19, 40, .18), 0 10px 22px rgba(0, 0, 0, .08);
}

.contact-widget--form .contact-link.email { grid-column: 1 / -1; }
.contact-widget--form .contact-link .label { font-size: 12px; }

.contact-widget--form .contact-link .value {
  font-size: 16px;
  min-width: 0;
  white-space: nowrap;
}

.contact-widget--form .contact-icon { margin-left: 0; }

/* Message form */
.contact-form {
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--vc-line);
}

.contact-form[hidden],
.contact-form-done[hidden] { display: none; }

.contact-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-field {
  position: relative;
  display: block;
  min-width: 0;
}

.contact-field--wide { grid-column: 1 / -1; }

.contact-field input,
.contact-field textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin: 0;
  padding: 22px 14px 8px;
  border: 1px solid rgba(0, 19, 40, .16);
  border-radius: var(--vc-field-radius);
  background: #fff;
  color: var(--vc-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.contact-field textarea {
  height: 112px;
  min-height: 72px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--vc-accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, .18);
}

.contact-field [aria-invalid="true"] {
  border-color: #d0342c;
  box-shadow: 0 0 0 3px rgba(208, 52, 44, .14);
}

/* Floating label: sits inside the empty field, moves up once it has focus or text. */
.contact-field-label {
  position: absolute;
  left: 15px;
  top: 16px;
  color: var(--vc-muted);
  font-size: 16px;
  line-height: 1.2;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .15s ease, color .15s ease;
}

.contact-field input:focus + .contact-field-label,
.contact-field input:not(:placeholder-shown) + .contact-field-label,
.contact-field textarea:focus + .contact-field-label,
.contact-field textarea:not(:placeholder-shown) + .contact-field-label {
  transform: translateY(-9px) scale(.75);
}

.contact-field input:focus + .contact-field-label,
.contact-field textarea:focus + .contact-field-label { color: var(--vc-accent); }

.contact-form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.contact-form-privacy {
  color: var(--vc-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-form-privacy:hover { color: var(--vc-ink); }

.contact-form-submit {
  position: relative;
  min-width: 148px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--vc-field-radius);
  background: var(--vc-accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}

.contact-form-submit:hover { background: var(--vc-accent-hover); }
.contact-form-submit:active { transform: translateY(1px); }

.contact-form-submit:focus-visible {
  outline: 2px solid var(--vc-accent);
  outline-offset: 3px;
}

.contact-form-submit[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
}

.contact-form-submit[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: contact-spin .7s linear infinite;
}

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

.contact-form-status {
  margin: 10px 0 0;
  font-size: 14px;
  color: #b42318;
}

.contact-form-status:empty { display: none; }

.contact-form-done {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--vc-line);
  font-size: 18px;
  font-weight: 700;
  color: var(--vc-ink);
  outline: none;
}

.contact-form-done svg {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

/* Phones: full width, centred, sliding up from the bottom edge. */
@media (max-width: 639.98px) {
  .contact-widget--form { --vc-gap: 12px; }
  .contact-widget--form.open { left: var(--vc-gap); }

  .contact-widget--form .contact-card {
    width: 100%;
    padding: 18px 16px 16px;
    transform-origin: bottom center;
    transform: translateY(16px);
  }

  .contact-widget--form.open .contact-card { transform: none; }
  .contact-widget--form .card-chrome { margin-bottom: 12px; }
  .contact-widget--form .contact-card-body,
  .contact-form-fields { gap: 8px; }
  .contact-widget--form .contact-link { gap: 2px; padding: 10px 12px; }
  .contact-widget--form .contact-link .value { font-size: 15px; }
  .contact-form { margin-top: 12px; padding-top: 12px; }
  .contact-form-fields { grid-template-columns: 1fr; }
  .contact-field input { padding-top: 20px; padding-bottom: 6px; }
  .contact-field-label { top: 15px; }
  .contact-field textarea { height: 84px; }
  .contact-form-actions { margin-top: 10px; }
  .contact-form-submit { flex: 1 1 auto; }
}

@media (max-width: 399.98px) {
  .contact-widget--form .contact-link.phone .contact-icon { display: none; }
}

@media (max-width: 319.98px) {
  .contact-widget--form .contact-card-body { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-widget--form .contact-card,
  .contact-field-label,
  .contact-form-submit { transition: none; }
  .contact-form-submit[aria-busy="true"]::after { animation-duration: 2s; }
}

/* Shared action order follows DOM and keyboard order: WhatsApp, form, email, phone. */
.contact-widget--form .contact-form { margin: 16px 0; padding: 0; border-top: 0; }
.contact-widget--form .contact-link { display: flex; }
.contact-widget--form .contact-link.email { margin-bottom: 10px; }
.contact-widget--form .contact-form-done { margin: 16px 0; padding: 0; border-top: 0; }
.contact-widget--form .contact-link.whatsapp .value { white-space: normal; line-height: 1.3; }
