/**
 * Спільні правила верстки (мобільні + блок брендів).
 * Підключайте після /assets/tw-built.css (зібраний Tailwind).
 */

/* Слот логотипу: фіксований «холст», зображення лише object-fit — ряд не стрибає */
.tz-brand-slot {
  box-sizing: border-box;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.75rem;
  height: 2.625rem;
  padding: 0.125rem 0.375rem;
}

@media (min-width: 480px) {
  .tz-brand-slot {
    width: 7.75rem;
    height: 3rem;
  }
}

@media (min-width: 768px) {
  .tz-brand-slot {
    width: 9rem;
    height: 3.375rem;
    padding: 0.25rem 0.5rem;
  }
}

@media (min-width: 1024px) {
  .tz-brand-slot {
    width: 10rem;
    height: 3.5rem;
  }
}

.tz-brand-slot img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

@keyframes tzCtaWave {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 106, 91, 0.42);
    transform: translateY(0) scale(1);
  }
  40% {
    box-shadow: 0 0 0 9px rgba(0, 106, 91, 0.16);
    transform: translateY(-1px) scale(1.03);
  }
  75% {
    box-shadow: 0 0 0 14px rgba(0, 106, 91, 0);
    transform: translateY(0) scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 106, 91, 0);
    transform: translateY(0) scale(1);
  }
}

.tz-cta-wave {
  animation: tzCtaWave 2.2s infinite;
  will-change: transform, box-shadow;
  /* Tailwind `transition` на тих самих кнопках задає transform/box-shadow у transition-property —
     це змагається з keyframes і «глушить» пульс. Залишаємо лише те, що потрібно для hover:bg-* . */
  transition-property: background-color, color, border-color, opacity;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.tz-cta-wave:hover {
  animation-play-state: paused;
  transform: translateY(-1px) scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .tz-cta-wave {
    animation: none !important;
    will-change: auto;
    transition-property: background-color, color, border-color, opacity, transform, box-shadow;
    transition-duration: 0.2s;
  }
  .tz-cta-wave:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 44px rgba(11, 91, 211, 0.28);
  }
}

/* Pixel-pass for mobile header (iPhone/Samsung) */
@media (max-width: 767px) {
  .tz-cta-wave {
    animation: tzCtaWave 1.6s infinite;
  }
  .tz-mobile-header-wrap {
    padding-top: max(0.4rem, env(safe-area-inset-top, 0px));
  }
  .tz-mobile-logo {
    height: clamp(3.1rem, 8.8vw, 3.8rem);
  }
  .tz-mobile-address {
    border-radius: 1rem;
    padding: 0.65rem 0.85rem;
  }
  .tz-mobile-phone-chip {
    min-height: 2.1rem;
    font-size: 0.77rem;
    line-height: 1;
  }
}

/* Маркізи: вертикальне центрування смуги */
.tz-marquee,
.tz-marquee-rev {
  display: flex;
  align-items: center;
}

/* Модалка квізу — не виходить за екран на малих висотах */
#quiz-root .tz-quiz-dialog {
  max-height: min(90vh, 40rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Місце під плаваючу кнопку «Записатися» на мобільних */
@media (max-width: 767px) {
  body.tz-scroll-book-pad {
    padding-bottom: max(5.25rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Footer phone readability on narrow screens (360/390/430) */
.tz-footer-phone {
  white-space: nowrap;
}

.tz-footer-phone-owner {
  font-weight: 600;
}

@media (max-width: 430px) {
  .tz-footer-phone {
    width: 100%;
    justify-content: space-between;
    min-height: 2.45rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    line-height: 1.1;
  }
  .tz-footer-phone-num {
    font-size: 0.95rem;
  }
  .tz-footer-phone-owner {
    font-size: 0.83rem;
    text-align: right;
  }
}

@media (min-width: 431px) and (max-width: 767px) {
  .tz-footer-phone {
    min-height: 2.35rem;
    padding: 0.48rem 0.72rem;
    font-size: 0.88rem;
  }
}
