/* ===========================================================
   ZNAKTECH Software Boxes — реалистичные 3D-коробки (v3.8)
   =========================================================== */

.znaktech-boxes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 30px;
}

/* ===== Поиск ===== */
.znaktech-search {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

.znaktech-search i.fa-search {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #a0a6b5;
  pointer-events: none;
}

#znaktechSearchInput {
  width: 340px;
  padding: 10px 14px 10px 40px;
  font-size: 1rem;
  color: #1c2c4c;
  background: #fff;
  border: 1.5px solid #d3d7df;
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: none;
}

#znaktechSearchInput:focus {
  border-color: #c01c54;
  box-shadow: 0 0 0 3px rgba(192, 28, 84, 0.12);
}

#znaktechSearchInput::placeholder {
  color: #9ea6b9;
}

/* ===== Список подсказок ===== */
.suggestions-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  background: #fff;
  border: 1px solid #d3d7df;
  border-radius: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  z-index: 20;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08);
}

.suggestions-list li {
  padding: 10px 16px;
  color: #1c2c4c;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestions-list li:hover {
  background: rgba(192, 28, 84, 0.07);
}

/* ===== Коробка — базовая тень ===== */
.software-box {
  position: relative;
  width: 260px;
  height: 340px;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1200px;
  transform: rotateY(-25deg) rotateX(5deg);
  box-shadow:
    -3px 6px 15px rgba(0, 0, 0, 0.35),
    10px 0 18px rgba(156, 28, 128, 0.18);
  transition: transform 0.6s ease, box-shadow 0.5s ease;
}

/* ===== Glow-тень под коробкой ===== */
.software-box::after {
  content: "";
  position: absolute;
  bottom: -32px;
  left: 0;
  width: 100%;
  height: 60px;
  background: radial-gradient(
    ellipse at center,
    rgba(156, 28, 128, 0.18) 0%,
    rgba(0, 0, 0, 0.0) 80%
  );
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

/* ===== Hover-анимация (мягче) ===== */
.software-box:hover {
  transform: rotateY(-18deg) rotateX(3deg) translateY(-8px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(156, 28, 128, 0.25);
}

/* ===== Лицевая грань ===== */
.face.front {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #121a31 0%, var(--box-color, #1f284a) 85%);
  border-radius: 0;
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.05),
    0 12px 25px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backface-visibility: hidden;
}

/* ===== Логотип ЗНАКТЕХ ===== */
.face.front::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/lzntech.svg') no-repeat center 26%;
  background-size: 72%;
  opacity: 1;
  mix-blend-mode: lighten;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2))
          brightness(1.2)
          contrast(1.2);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.software-box:hover .face.front::before {
  opacity: 1;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.3))
          brightness(1.3)
          contrast(1.25);
}

/* ===== Контент внутри коробки ===== */
.face.front .inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 45px;
  z-index: 2;
  color: #fff;
  text-align: center;
}

.face.front img.icon,
.face.front i {
  width: 44px;
  height: auto;
  margin-bottom: 10px;
  display: block;
  color: #ffffff;
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.5));
}

.face.front h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 6px 0 10px 0;
  letter-spacing: 0.4px;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.face.front p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #ffffff;
  opacity: 1;
  text-align: center;
  max-width: 90%;
  margin: 0 auto;
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ===== Логотип «Честный ЗНАК» ===== */
.chestny-znak {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  background: url('../images/chestniy-znak.svg') no-repeat center/contain;
  filter: drop-shadow(0 0 4px rgba(255, 240, 0, 0.6));
  z-index: 3;
  transition: filter 0.3s ease;
}

.software-box:hover .chestny-znak {
  filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.9));
}

/* ===== Глянец ===== */
.face.front::after {
  content: "";
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 40%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.12) 30%,
    rgba(255, 255, 255, 0.03) 80%,
    rgba(255, 255, 255, 0) 100%
  );
  filter: blur(6px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* ===== Боковая грань ===== */
.face.side {
  position: absolute;
  top: 0;
  left: 100%;
  width: 60px;
  height: 100%;
  background: linear-gradient(180deg, #c01c54 0%, #be195a 100%);
  transform: rotateY(90deg) translateX(-1px);
  transform-origin: left center;
  backface-visibility: hidden;
  left: 99.7%;
}

/* ===== Адаптив ===== */
@media (max-width: 768px) {
  .software-box {
    width: 220px;
    height: 300px;
  }

  .face.front h3 {
    font-size: 1.15rem;
  }

  .face.front p {
    font-size: 0.85rem;
  }

  #znaktechSearchInput, .suggestions-list {
    width: 300px;
  }
}

@media (max-width: 480px) {
  .software-box {
    width: 190px;
    height: 260px;
  }

  .face.front h3 {
    font-size: 1rem;
  }

  .face.front p {
    font-size: 0.8rem;
  }

  #znaktechSearchInput, .suggestions-list {
    width: 260px;
  }
}

/* ===========================================================
   🔹 Состояния FRONT / ANGLED
   =========================================================== */
.software-box {
  transition: transform 0.6s ease, box-shadow 0.5s ease;
  will-change: transform;
}

.software-box.angled {
  transform: rotateY(-25deg) rotateX(5deg) translateY(0);
}

.software-box.front {
  transform: rotateY(0deg) rotateX(0deg) translateY(-8px);
}

/* ===========================================================
   🔹 Мини-блок отраслей (подключаемый шорткод)
   =========================================================== */
.znak-industries-mini {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 10px;
  font-size: 16px;
  line-height: 1.1;
  margin-top: 10px;
}

.znak-industries-mini div {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #555;
  background: #f1f3f5;
  border-radius: 6px;
  padding: 3px 8px;
  transition: all 0.2s ease;
  border: 1px solid #e0e0e0;
  cursor: pointer;
}

.znak-industries-mini div:hover {
  background: #e7e7e7;
  border-color: #d5d5d5;
  color: #333;
}

.znak-industries-mini i {
  font-size: 1.55rem;
  color: #a5b0b9;
}

.znak-industries-mini div.active {
  background: #e3e3e3;
  border-color: #c0c0c0;
  color: #222;
}

.znak-industries-mini div.active i {
  color: #666;
}

.znak-industries-mini .znak-intro,
.znak-industries-mini .znak-plan {
  border: 1px dashed #bfbfbf;
  background: #f4f4f4;
}

/* ===========================================================
   🔹 Эффект лёгкого «распада» и плавного появления (CSS)
   =========================================================== */
.dust-hide {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dust-in {
  opacity: 0;
  animation: dustFadeIn 0.4s forwards ease;
}

.dust-out {
  position: absolute;
  animation: dustFadeOut 0.7s forwards ease;
  pointer-events: none;
  left: 0;
  right: 0;
  margin: auto;
  text-align: center;
}

@keyframes dustFadeOut {
  0% {
    opacity: 1;
    filter: blur(0px);
    transform: translate(0, 0) scale(1);
  }
  50% {
    opacity: 1;
    filter: blur(2px);
    transform: translate(0px, -10px) scale(1.02);
  }
  100% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(20px, -30px) scale(0.9) rotate(3deg);
  }
}

@keyframes dustFadeIn {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translate(-10px, 10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate(0, 0);
  }
}

/* ===========================================================
   🔥 Firefox-only: fix jagged side edge
   =========================================================== */
@-moz-document url-prefix() {

  /* Разрешаем выход 3D, но стабилизируем */
  .software-box {
    overflow: visible;
  }

  .face.front {
    overflow: visible;
    transform: translateZ(1px);
  }

  /* 🔑 КЛЮЧ: не даём Firefox крутить ровно 90deg */
  .face.side {
    transform: rotateY(88deg) translateX(1px);
    backface-visibility: hidden;
    will-change: transform;
  }

  /* Лёгкое сглаживание грани */
  .face.side {
    filter: blur(0.85px);
  }
}


