/* ==========================================================================
   KIK SHOW — popup kontaktowy (prawy dolny róg, pojawia się po 7 s)
   Korzysta z tokenów ze styles.css.
   ========================================================================== */

.kik-pop {
  --pop-size: 300px;
  position: fixed; right: var(--s5); bottom: var(--s5); z-index: 95;
  width: var(--pop-size); aspect-ratio: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--s5);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden; isolation: isolate;
  transform-origin: 100% 100%;
  opacity: 0; transform: translate(24px, 24px) scale(.4) rotate(-8deg);
  pointer-events: none; visibility: hidden;
  transition:
    opacity 260ms var(--ease),
    transform 260ms var(--ease),
    visibility 0s linear 260ms;
}
.kik-pop[data-open="true"] {
  opacity: 1; transform: none; pointer-events: auto; visibility: visible;
  transition:
    opacity 320ms var(--ease),
    transform 700ms cubic-bezier(.34, 1.56, .64, 1),
    visibility 0s;
}

/* plamy farby w tle — jak splash z logo */
.kik-pop__splash {
  position: absolute; z-index: -1; pointer-events: none;
  border-radius: 58% 42% 63% 37% / 45% 55% 45% 55%;
  filter: blur(.5px);
  animation: kik-pop-blob 9s ease-in-out infinite alternate;
}
.kik-pop__splash--red    { width: 150px; height: 140px; top: -46px; right: -38px; background: oklch(0.585 0.212 27 / .9); }
.kik-pop__splash--yellow { width: 92px;  height: 88px;  top: 54px;  right: 64px;  background: oklch(0.855 0.160 85 / .85); animation-delay: -3s; animation-duration: 11s; }
.kik-pop__splash--cyan   { width: 120px; height: 112px; top: -30px; left: -44px;  background: oklch(0.720 0.130 225 / .55); animation-delay: -6s; animation-duration: 13s; }
.kik-pop__splash--dot    { width: 18px;  height: 18px;  top: 30px;  left: 92px;   background: var(--magenta); animation-duration: 7s; }
.kik-pop__splash--dot2   { width: 11px;  height: 11px;  top: 112px; right: 34px;  background: var(--green); animation-delay: -2s; animation-duration: 8s; }

@keyframes kik-pop-blob {
  0%   { border-radius: 58% 42% 63% 37% / 45% 55% 45% 55%; transform: translate(0, 0) rotate(0deg); }
  50%  { border-radius: 40% 60% 38% 62% / 60% 38% 62% 40%; transform: translate(-6px, 5px) rotate(12deg); }
  100% { border-radius: 52% 48% 45% 55% / 38% 62% 38% 62%; transform: translate(4px, -4px) rotate(-8deg); }
}

/* ikona telefonu w kółku, dzwoni co kilka sekund */
.kik-pop__icon {
  position: absolute; top: var(--s5); left: var(--s5);
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--surface); color: var(--red);
  border-radius: 50%; box-shadow: var(--shadow);
}
.kik-pop__icon svg { width: 26px; height: 26px; }
.kik-pop[data-open="true"] .kik-pop__icon svg { animation: kik-pop-ring 2.8s var(--ease) 900ms infinite; }
.kik-pop__icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--red); opacity: 0;
}
.kik-pop[data-open="true"] .kik-pop__icon::after { animation: kik-pop-wave 2.8s ease-out 900ms infinite; }

@keyframes kik-pop-ring {
  0%, 40%, 100% { transform: rotate(0); }
  5%  { transform: rotate(-16deg); }
  10% { transform: rotate(14deg); }
  15% { transform: rotate(-12deg); }
  20% { transform: rotate(10deg); }
  25% { transform: rotate(-6deg); }
  30% { transform: rotate(3deg); }
}
@keyframes kik-pop-wave {
  0%   { opacity: .55; transform: scale(1); }
  45%  { opacity: 0;   transform: scale(1.7); }
  100% { opacity: 0;   transform: scale(1.7); }
}

.kik-pop__close {
  position: absolute; top: var(--s3); right: var(--s3);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: oklch(1 0 0 / .92); color: var(--ink);
  border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.kik-pop__close:hover { background: var(--surface); transform: rotate(90deg); }
.kik-pop__close svg { width: 16px; height: 16px; }

/* treść wjeżdża kaskadowo po otwarciu */
.kik-pop__body > * {
  opacity: 0; transform: translateY(10px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}
.kik-pop[data-open="true"] .kik-pop__body > * { opacity: 1; transform: none; }
.kik-pop[data-open="true"] .kik-pop__body > :nth-child(1) { transition-delay: 260ms; }
.kik-pop[data-open="true"] .kik-pop__body > :nth-child(2) { transition-delay: 340ms; }
.kik-pop[data-open="true"] .kik-pop__body > :nth-child(3) { transition-delay: 420ms; }
.kik-pop[data-open="true"] .kik-pop__body > :nth-child(4) { transition-delay: 500ms; }

.kik-pop__eyebrow {
  font-family: var(--f-display); font-weight: 600;
  font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase;
  color: var(--red);
}
.kik-pop__title {
  font-family: var(--f-display); font-weight: 700;
  font-size: 1.55rem; line-height: 1.05; margin-block: 2px var(--s2);
}
.kik-pop__phone {
  display: block; width: fit-content;
  font-family: var(--f-display); font-weight: 800;
  font-size: 1.75rem; line-height: 1.1; letter-spacing: .01em;
  color: var(--ink); text-decoration: none; margin-bottom: var(--s3);
  background: linear-gradient(transparent 62%, oklch(0.855 0.160 85 / .55) 62%, oklch(0.855 0.160 85 / .55) 92%, transparent 92%);
}
.kik-pop__phone:hover { color: var(--red); }
.kik-pop__cta.btn { width: 100%; min-height: 48px; }
.kik-pop__cta svg { width: 18px; height: 18px; }

/* telefon: mniejszy kwadrat nad paskiem „Zadzwoń teraz” */
@media (max-width: 820px) {
  .kik-pop {
    --pop-size: min(248px, calc(100vw - 2rem));
    right: var(--s4);
    bottom: calc(88px + var(--s3) + env(safe-area-inset-bottom, 0px));
    padding: var(--s4);
  }
  .kik-pop__icon { top: var(--s4); left: var(--s4); width: 46px; height: 46px; }
  .kik-pop__icon svg { width: 22px; height: 22px; }
  .kik-pop__splash--red { width: 124px; height: 116px; }
  .kik-pop__splash--yellow { width: 74px; height: 70px; top: 44px; right: 52px; }
  .kik-pop__title { font-size: 1.3rem; }
  .kik-pop__phone { font-size: 1.45rem; margin-bottom: var(--s2); }
  .kik-pop__cta.btn { min-height: 44px; font-size: .98rem; }
}
