/* LeadForm modal */
.leadform-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}
.leadform-overlay.is-open {
  display: flex;
}
body.leadform-open-body {
  overflow: hidden;
}

.leadform-modal {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: leadformIn 0.25s ease;
}

@keyframes leadformIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.leadform-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}
.leadform-close:hover { background: #e0e0e0; }

.leadform-body {
  display: flex;
  flex-wrap: nowrap;
}

/* Левая колонка */
.leadform-left {
  flex: 0 0 400px;
  width: 400px;
  min-width: 400px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-height: 420px;
}
.leadform-left--card {
  background: #fff;
  justify-content: flex-start;
  align-items: center;
  padding: 25px 0 0 25px;
  box-sizing: border-box;
}

.leadform-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.leadform-photo--card {
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  border: 1px solid #ccc;
  border-radius: 20px;
}
.leadform-photo--empty {
  background: #e8e8e8;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.leadform-managers {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  justify-content: center;
  gap: 8px;
}

/* Правая колонка */
.leadform-right {
  flex: 1 1 auto;
  padding: 28px 28px 24px;
  min-width: 0;
}

.leadform-title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  color: #111;
}

.leadform-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
}
.leadform-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.leadform-phone {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
}
.leadform-phone a {
  color: #111;
  text-decoration: none;
}
.leadform-phone a:hover { color: #2563eb; }

.leadform-messengers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.leadform-msg {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #ddd;
  color: #333;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.leadform-msg:hover { background: #f5f5f5; border-color: #bbb; }
.leadform-msg--wa { border-color: #25d366; color: #128c7e; }
.leadform-msg--tg { border-color: #2aabee; color: #229ed9; }
.leadform-msg--max { border-color: #7c3aed; color: #6d28d9; }

/* Тема товара */
.leadform-theme {
  display: none;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px;
  background: #fafafa;
  border-radius: 10px;
}
.leadform-theme.is-visible {
  display: flex;
}
.leadform-theme-img {
  display: none;
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.leadform-theme-img.is-visible {
  display: block;
}
.leadform-theme-text {
  font-size: 14px;
  color: #333;
  line-height: 1.35;
  margin-top: 5px;
  margin-bottom: 5px;
}

/* Поля */
.leadform-field {
  margin-top: 20px;
  margin-bottom: 0;
}
.leadform-field:first-of-type {
  margin-top: 0;
}
.leadform-field textarea,
.leadform-field input[type="tel"],
.leadform-field input[type="text"],
.leadform-field input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  background: #f7f7f7;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  resize: vertical;
}
.leadform-field textarea:focus,
.leadform-field input[type="tel"]:focus,
.leadform-field input[type="text"]:focus,
.leadform-field input[type="email"]:focus {
  border-color: #bbb;
  background: #fff;
}

/* Чипы */
.leadform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.leadform-chip {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #eee;
  opacity: 0.5;
  font-size: 13px;
  cursor: pointer;
  color: #444;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.leadform-chip:hover {
  opacity: 1;
}

/* Согласие */
.leadform-agree {
  margin-bottom: 8px;
}
.leadform-agree label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: normal;
}
.leadform-agree input { margin-top: 3px; }
.leadform-agree-text {
  margin: 4px 0 0 24px;
  font-size: 12px;
  color: #777;
  line-height: 1.4;
}
.leadform-agree-text a { color: #2563eb; }

.leadform-captcha {
  margin-bottom: 15px;
}
.leadform-captcha label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #555;
}

.leadform-required {
  font-size: 12px;
  color: #9ca3af;
  margin: 12px 0 12px;
}

.leadform-error,
.leadform-success {
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.leadform-error {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}
.leadform-success {
  background: #f0fdf4;
  color: #15803d;
  font-size: 14px;
}
.leadform-error.is-visible,
.leadform-success.is-visible {
  display: block;
}

.leadform-submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background-color: var(--lf-btn-bg, #facc15);
  color: var(--lf-btn-color, #111);
  transition: background 0.15s, transform 0.1s, filter 0.15s;
}
.leadform-submit:hover {
  filter: brightness(0.92);
}
.leadform-submit:active { transform: scale(0.99); }
.leadform-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Мобилка */




.leadform-modal--no-photo .leadform-body { flex-direction: column; }
.leadform-modal--no-photo .leadform-right { max-width: 480px; margin: 0 auto; width: 100%; }
.leadform-modal--no-photo { max-width: 520px; }

@media (max-width: 700px) {
  .leadform-overlay.is-open {
    align-items: flex-start;
    padding: 12px;
  }
  .leadform-modal {
    margin: 0 auto 24px;
    max-height: none;
  }
  .leadform-body {
    flex-direction: column;
  }
  .leadform-left,
  .leadform-left--card {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 200px;
    max-height: 240px;
    padding: 12px 12px 0;
  }
  .leadform-photo--fill {
    object-fit: cover;
    max-height: 240px;
  }
  .leadform-right {
    padding: 16px;
  }
  .leadform-title {
    font-size: 18px;
  }
}
