/* Плавающая кнопка и приглашение связаться — MIR Logistic */

.jd3-float-contact {
  position: fixed;
  right: 1rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 99980;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 1rem 0.7rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0a0907;
  background: linear-gradient(135deg, #e8d48b 0%, #d4af37 45%, #c9a227 100%);
  border: 1px solid rgba(255, 250, 240, 0.25);
  box-shadow: 0 10px 32px rgba(212, 175, 55, 0.38);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.jd3-float-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(212, 175, 55, 0.5);
  color: #0a0907;
}

.jd3-float-contact svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.jd3-float-contact.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

@media (max-width: 767px) {
  body:not(.jd3-catalog-page) .jd3-float-contact {
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .jd3-float-contact-text-long {
    display: none;
  }
}

@media (min-width: 768px) {
  .jd3-float-contact-text-short {
    display: none;
  }
}

/* Приглашение через 25 секунд */
.jd3-engage[hidden] {
  display: none !important;
}

.jd3-engage:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.jd3-engage {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
  overflow: hidden;
}

.jd3-engage.is-visible {
  pointer-events: auto;
}

.jd3-engage-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.28s;
}

.jd3-engage.is-visible .jd3-engage-backdrop {
  opacity: 1;
}

.jd3-engage-card {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  max-width: 100%;
  max-height: min(90vh, 100dvh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.35rem 1.15rem 1.15rem;
  border-radius: 1.1rem;
  background: #16140f;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.28s, transform 0.28s;
}

.jd3-engage.is-visible .jd3-engage-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.jd3-engage-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--_color-grey---100, #f1f5f9);
  color: var(--_color-grey---600, #475569);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.jd3-engage-close:hover {
  background: var(--_color-grey---200, #e2e8f0);
  color: var(--_color-grey---800, #1e293b);
}

.jd3-engage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  color: var(--_color-accent---500, #c9a227);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.jd3-engage-title {
  margin: 0 2rem 0.45rem 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--_color-grey---800, #1e293b);
  overflow-wrap: anywhere;
}

.jd3-engage-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--_color-grey---600, #475569);
  overflow-wrap: anywhere;
}

.jd3-engage-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.jd3-engage-actions .jd3-ex-contact-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  min-width: 0;
  font-size: 0.88rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.jd3-engage-actions .jd3-ex-contact-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jd3-engage-order {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--_color-accent---400, #d4af37);
  border-radius: 0.85rem;
  background: transparent;
  color: var(--_color-accent---500, #c9a227);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.jd3-engage-order:hover {
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.18);
}

body.jd3-engage-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 767px) {
  .jd3-engage:not([hidden]) {
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }

  .jd3-engage-card {
    width: 100%;
    max-height: min(88vh, 100dvh - 1.5rem);
    padding: 1.15rem 1rem 1rem;
    border-radius: 1rem;
  }

  .jd3-engage-title {
    font-size: 1.05rem;
    margin-right: 1.75rem;
  }

  .jd3-engage-text {
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .jd3-engage-actions .jd3-ex-contact-btn {
    min-height: 2.65rem;
    font-size: 0.84rem;
  }

  .jd3-engage-order {
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
  }
}

@media (max-width: 479px) {
  .jd3-float-contact {
    right: 0.75rem;
    max-width: calc(100vw - 1.5rem);
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }

  .jd3-engage-badge {
    font-size: 0.68rem;
    margin-bottom: 0.5rem;
  }

  .jd3-engage-close {
    top: 0.45rem;
    right: 0.45rem;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 1.2rem;
  }
}

.jd3-tg-chat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
}

.jd3-tg-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.jd3-tg-chat-inline.jd3-ex-contact-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
