/* css/personalizaciya.css */

/* ─── HERO ─── */
.pers-hero {
  background: var(--surface);
  padding: 40px 0;
}

.pers-hero__head {
  text-align: center;
  margin-bottom: 32px;
}

.pers-hero__title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--ink);
}

.pers-hero__sub {
  font-size: 15px;
  color: var(--muted);
}

/* ─── КАРТЫ ─── */
.pers-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: visible;
}

.pers-card-wrap {
  position: relative;
  padding: 28px 32px;
  overflow: visible;
}

/* Разделитель между картами */
.pers-card-wrap:first-child {
  border-right: 1px solid var(--border);
}

.pers-card__frame {
  position: relative;
}

.pers-card__img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── ХОТСПОТ ─── */
.hotspot {
  position: absolute;
  z-index: 5;
  /* держит z-index:30 пока popup ещё виден (0.5s задержка + 0.25s фейд = 0.75s) */
  transition: z-index 0s 0.75s;
}

/* Активный хотспот поднимается поверх соседних точек — мгновенно */
.hotspot:hover,
.hotspot.is-open {
  z-index: 30;
  transition: z-index 0s;
}

.hotspot__dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 3px solid var(--red);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.18s, transform 0.18s;
  animation: hs-pulse 2.8s ease-out infinite;
}

@keyframes hs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.35); }
  60%  { box-shadow: 0 0 0 9px rgba(255, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

.hotspot:hover .hotspot__dot {
  background: rgba(255, 255, 255, 0.75);
  transform: translate(-50%, -50%) scale(1.25);
  animation-play-state: paused;
}

/* ─── ПОПАП ─── */
.hotspot__popup {
  position: absolute;
  z-index: 10;
  width: 174px;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px 14px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.94);
}

/* Медленное скрытие: 0.5s задержка перед началом исчезновения */
.hotspot__popup {
  transition: opacity 0.25s 0.5s, transform 0.25s 0.5s;
}

/* Показывать при наведении на ПК — быстрое появление, без задержки */
@media (hover: hover) {
  .hotspot:hover .hotspot__popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity 0.15s, transform 0.15s;
  }
}

/* Показывать при нажатии (мобильный + ПК) */
.hotspot.is-open .hotspot__popup {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  transition: opacity 0.15s, transform 0.15s;
}

/* Направления попапа */
.hotspot--dr .hotspot__popup { top: 14px;    left: 14px;  }   /* вниз-вправо */
.hotspot--dl .hotspot__popup { top: 14px;    right: 14px; }   /* вниз-влево  */
.hotspot--ur .hotspot__popup { bottom: 14px; left: 14px;  }   /* вверх-вправо */
.hotspot--ul .hotspot__popup { bottom: 14px; right: 14px; }   /* вверх-влево  */

.hotspot__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 5px;
}

.hotspot__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.hotspot__btn {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 0, 0, 0.3);
  line-height: 1;
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.hotspot__btn:hover {
  border-color: var(--red);
}

/* ─── ВИДЫ ПЕРСОНАЛИЗАЦИИ (карточки) ─── */
.izg-pers { padding: 40px 0 40px; }

.izg-pers__title {
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 32px;
}

.izg-pers__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.izg-perscard {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.izg-perscard:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.izg-perscard__img {
  width: 100%;
  background: var(--surface);
  overflow: hidden;
  transition: background .18s;
}

.izg-perscard__img img {
  width: 100%;
  height: auto;
  display: block;
}

.izg-perscard:hover .izg-perscard__img { background: #f5f5f5; }

.izg-perscard__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  padding: 14px 16px 16px;
}

/* ─── АДАПТИВ ─── */

@media (max-width: 900px) {
  .izg-pers__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .pers-cards {
    grid-template-columns: 1fr;
  }

  .pers-card-wrap {
    padding: 20px 24px;
  }

  .pers-card-wrap:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 560px) {
  .pers-hero__head {
    margin-bottom: 24px;
  }

  .pers-card-wrap {
    padding: 16px 18px;
  }

  .hotspot__popup {
    width: 155px;
  }

  .izg-pers__grid { grid-template-columns: repeat(2, 1fr); }
}
