/*
 * Home features strip (Доставка / Сеть магазинов / 1509 / EkoMIX)
 * Sits AFTER .home-hero-row so it spans catalog + hero.
 * Desktop horizontal alignment (relative to .home-hero-row, -10px vs .container):
 *   left  = catalog card edge  (row + 8px)
 *   right = hero side-banners edge (row - 6px)
 * Catalog-clearance margin-top is set by column_left.twig JS (fix_home_layout).
 * Note: UniShop html font-size is 10px -> sizes in px only.
 */

.home-features {
  --hf-blue-deep: #1f5fcf;
  --hf-blue: #2f7ae6;
  --hf-brand: #4998fd;
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 0 20px;
  box-sizing: border-box;
}

.home-features__inner {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .home-features {
    margin-bottom: 30px;
  }

  .home-features__inner {
    margin: 0 -10px;
    padding: 0 5px 0 8px;
  }
}

/* ---- Blue panel ---- */
.home-features__panel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(520px 220px at 8% -30%, rgba(255, 255, 255, 0.28), transparent 70%),
    radial-gradient(480px 240px at 100% 130%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(110deg, var(--hf-blue-deep) 0%, var(--hf-blue) 52%, var(--hf-brand) 100%);
  box-shadow: 0 14px 34px rgba(31, 95, 207, 0.28), 0 2px 6px rgba(31, 95, 207, 0.18);
  isolation: isolate;
}

/* subtle diagonal texture */
.home-features__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.045) 0,
    rgba(255, 255, 255, 0.045) 2px,
    transparent 2px,
    transparent 14px
  );
}

/* big soft ring, decorative */
.home-features__panel::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 260px;
  height: 260px;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, 0.07);
}

/* ---- Tile (glass card) ---- */
.home-features__tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px 18px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 30, 92, 0.26);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff !important;
  text-decoration: none !important;
  transition: transform 0.28s ease, background-color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.home-features__tile:hover,
.home-features__tile:focus-visible {
  transform: translateY(-4px);
  background: rgba(8, 30, 92, 0.38);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 24px rgba(8, 30, 92, 0.32);
  color: #fff !important;
  text-decoration: none !important;
}

.home-features__tile:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* ---- Icon disc ---- */
.home-features__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  color: #2467d6;
  box-shadow: 0 6px 14px rgba(8, 30, 92, 0.28);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-features__icon i {
  display: block;
  font-size: 22px;
  line-height: 1;
  color: #2467d6;
}

/* pulse ring */
.home-features__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  opacity: 0;
  animation: hf-pulse 3.4s ease-out infinite;
  pointer-events: none;
}

.home-features__tile:nth-child(2) .home-features__icon::after { animation-delay: 0.6s; }
.home-features__tile:nth-child(3) .home-features__icon::after { animation-delay: 1.2s; }
.home-features__tile:nth-child(4) .home-features__icon::after { animation-delay: 1.8s; }

.home-features__tile:hover .home-features__icon,
.home-features__tile:focus-visible .home-features__icon {
  transform: scale(1.1) rotate(-8deg);
}

/* ---- Text ---- */
.home-features__text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.home-features__text strong {
  display: block;
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  letter-spacing: 0.1px;
}

.home-features__desc {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
}

/* ---- Hover arrow (does not take layout width) ---- */
.home-features__arrow {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.home-features__tile:hover .home-features__arrow,
.home-features__tile:focus-visible .home-features__arrow {
  opacity: 0.9;
  transform: translateX(0);
}

/* ---- Fade-up on scroll into view (class added by inline script) ---- */
.home-features--anim:not(.is-in) .home-features__tile {
  opacity: 0;
}

.home-features--anim.is-in .home-features__tile {
  animation: hf-up 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) backwards;
}

.home-features--anim.is-in .home-features__tile:nth-child(2) { animation-delay: 0.09s; }
.home-features--anim.is-in .home-features__tile:nth-child(3) { animation-delay: 0.18s; }
.home-features--anim.is-in .home-features__tile:nth-child(4) { animation-delay: 0.27s; }

@keyframes hf-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hf-pulse {
  0%   { opacity: 0.75; transform: scale(1); }
  60%  { opacity: 0;    transform: scale(1.5); }
  100% { opacity: 0;    transform: scale(1.5); }
}

/* ---- Responsive: 4 -> 2 -> 1 ---- */
@media (max-width: 1199px) {
  .home-features__panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .home-features__panel {
    padding: 12px;
    gap: 12px;
    border-radius: 16px;
  }
}

@media (max-width: 599px) {
  .home-features__panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .home-features__tile {
    min-height: 80px;
    padding: 14px;
    gap: 14px;
  }

  .home-features__icon {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .home-features__icon i {
    font-size: 19px;
  }

  .home-features__arrow {
    opacity: 0.7;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-features__tile,
  .home-features__icon,
  .home-features__arrow {
    transition: none !important;
  }

  .home-features__icon::after {
    animation: none !important;
    display: none;
  }

  .home-features--anim:not(.is-in) .home-features__tile {
    opacity: 1;
  }

  .home-features--anim.is-in .home-features__tile {
    animation: none !important;
  }

  .home-features__tile:hover,
  .home-features__tile:focus-visible,
  .home-features__tile:hover .home-features__icon {
    transform: none;
  }
}
