/* ============================================
   FLOATING WIDGETS — звонок + калькулятор
   ============================================ */

/* ── Контейнер обоих кнопок ── */
.floating-widgets {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* ── Кнопка звонка (красная) ── */
.call-widget {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e31f26;
  color: #fff;
  text-decoration: none;
  box-shadow:
    0 4px 20px rgba(227, 31, 38, 0.35),
    0 0 0 0 rgba(227, 31, 38, 0);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.call-widget:hover {
  background: #c41920;
  transform: scale(1.08);
  box-shadow:
    0 6px 28px rgba(227, 31, 38, 0.45),
    0 0 0 0 rgba(227, 31, 38, 0);
  color: #fff;
  animation: none;
}

.call-widget:active {
  transform: scale(0.96);
}

/* SVG иконка */
.call-widget__icon {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

/* ── Пульсирующие круги ───────────────────────────────────── */
.call-widget__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.call-widget__pulse--1 {
  width: 96px;
  height: 96px;
  background: rgba(227, 31, 38, 0.18);
  animation: callPulse1 2.4s ease-out infinite;
  z-index: 1;
}

.call-widget__pulse--2 {
  width: 128px;
  height: 128px;
  background: rgba(227, 31, 38, 0.10);
  animation: callPulse2 2.4s ease-out infinite 0.4s;
  z-index: 0;
}

@keyframes callPulse1 {
  0%   { transform: translate(-50%, -50%) scale(0.7); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

@keyframes callPulse2 {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

/* ── Анимация покачивания кнопки ──────────────────────────── */
.call-widget {
  animation: callWiggle 3s ease-in-out infinite;
}

@keyframes callWiggle {
  0%, 100% { transform: rotate(0deg); }
  5%       { transform: rotate(-8deg); }
  10%      { transform: rotate(8deg); }
  15%      { transform: rotate(-6deg); }
  20%      { transform: rotate(4deg); }
  25%      { transform: rotate(0deg); }
}

/* ── Мобильная адаптация ──────────────────────────────────── */
@media (max-width: 768px) {
  .call-widget {
    width: 56px;
    height: 56px;
  }

  .call-widget__icon {
    width: 24px;
    height: 24px;
  }

  /* На мобильных: без пульсации — экономим ресурсы */
  .call-widget__pulse {
    display: none;
  }

  /* Без анимации покачивания на мобильных */
  .call-widget {
    animation: none;
  }
}

/* ── Скрываем виджеты при открытом модальном окне ─────────── */
/* z-index модалки 10000 > виджетов 9000, автоматически перекрывает */

/* ── Кнопка калькулятора (синяя, над трубкой) ─────────────── */
.calc-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--color-brand-blue, #2196f3);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.35);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.calc-float-btn:hover {
  background: #1976d2;
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(33, 150, 243, 0.45);
}
.calc-float-btn:active {
  transform: scale(0.96);
}
.calc-float-btn__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Подпись «Калькулятор цен» */
.calc-float-btn__label {
  position: absolute;
  right: calc(100% + 8px);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.2s, transform 0.2s;
}
.calc-float-btn:hover .calc-float-btn__label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Модальное окно калькулятора ──────────────────────────── */
.calc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 10000);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: calcFadeIn 0.25s ease;
}
/* [hidden] атрибут имеет встроенную специфичность, но мы добавляем body для надёжности */
body .calc-modal-overlay[hidden] {
  display: none;
}
.calc-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: calcSlideUp 0.3s ease;
}
.calc-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.calc-modal__close:hover {
  color: #333;
}
.calc-modal__icon {
  margin-bottom: 16px;
}
.calc-modal__icon svg {
  display: inline-block;
}
.calc-modal__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #1a1a2e;
}
.calc-modal__text {
  font-size: 15px;
  color: #666;
  margin: 0 0 24px;
  line-height: 1.5;
}
.calc-modal__btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-modal__go {
  display: inline-block;
  padding: 14px 24px;
  background: var(--color-brand-blue, #2196f3);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.calc-modal__go:hover {
  background: #1976d2;
  transform: translateY(-1px);
  color: #fff;
}
.calc-modal__cancel {
  padding: 10px;
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  transition: color 0.15s;
}
.calc-modal__cancel:hover {
  color: #555;
}

@keyframes calcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes calcSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .floating-widgets {
    right: 16px;
    bottom: 16px;
    gap: 10px;
  }
  .calc-float-btn {
    width: 44px;
    height: 44px;
  }
  .calc-float-btn__icon {
    width: 20px;
    height: 20px;
  }
  .calc-modal {
    padding: 28px 20px 20px;
    border-radius: 14px;
  }
}
