/* ICV Counter Section — classic bg image (index & default) */
.icv-counter {
  --icv-counter-primary: #004369;
  --icv-counter-accent: rgba(0, 125, 197, 0.85);
  --icv-counter-dark: #091f2f;

  position: relative;
  margin: 0;
  padding: 78px 0 86px;
  overflow: hidden;
  background: var(--icv-counter-primary) url(../img/banners/counter-bg.jpg) no-repeat center center;
  background-size: cover;
}

.icv-counter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 35, 68, 0.82) 0%,
    rgba(0, 52, 92, 0.72) 50%,
    rgba(0, 35, 68, 0.82) 100%
  );
  z-index: 0;
}

.icv-counter::after {
  display: none;
  content: none;
}

/* Soft gradient variant (e.g. request-a-quote) */
.icv-counter--soft {
  background:
    radial-gradient(ellipse 70% 90% at 0% 0%, rgba(0, 125, 197, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(0, 125, 197, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, var(--icv-counter-dark) 0%, var(--icv-counter-primary) 52%, #005a8c 100%);
}

.icv-counter--soft::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  background-color: transparent;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 20%, transparent 75%);
  pointer-events: none;
}

.icv-counter--soft::after {
  display: block;
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -160px;
  right: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 125, 197, 0.35) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.icv-counter .container {
  position: relative;
  z-index: 2;
}

.icv-counter__overlay {
  position: absolute;
  top: -20%;
  width: 28%;
  height: 140%;
  background: rgba(0, 67, 105, 0.55);
  z-index: 1;
  pointer-events: none;
}

.icv-counter__overlay--left {
  left: -8%;
  transform: skewX(-18deg);
}

.icv-counter__overlay--right {
  right: -8%;
  transform: skewX(18deg);
}

.icv-counter--soft .icv-counter__overlay {
  top: auto;
  width: auto;
  height: auto;
  background: none;
  border-radius: 50%;
  filter: blur(2px);
}

.icv-counter--soft .icv-counter__overlay--left {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(0, 125, 197, 0.22) 0%, transparent 70%);
  transform: none;
}

.icv-counter--soft .icv-counter__overlay--right {
  width: 220px;
  height: 220px;
  right: 8%;
  top: -80px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  transform: none;
}

.icv-counter__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 24px;
}

.icv-counter__item {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  opacity: 0;
  transform: translate3d(0, 48px, 0);
  will-change: transform, opacity;
}

.icv-counter.icv-counter--visible .icv-counter__item,
.icv-counter.is-animation-ready .icv-counter__item {
  animation: icvCounterRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.icv-counter.is-animation-ready .icv-counter__item:nth-child(1) {
  animation-delay: 0.05s;
}

.icv-counter.is-animation-ready .icv-counter__item:nth-child(2) {
  animation-delay: 0.18s;
}

.icv-counter.is-animation-ready .icv-counter__item:nth-child(3) {
  animation-delay: 0.31s;
}

.icv-counter.is-animation-ready .icv-counter__item:nth-child(4) {
  animation-delay: 0.44s;
}

@keyframes icvCounterRise {
  from {
    opacity: 0;
    transform: translate3d(0, 48px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.icv-counter__icon-wrap {
  --icv-icon-layer: rgba(210, 230, 245, 0.55);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 0 10px 10px;
  border-radius: 10px;
  background: rgba(20, 55, 90, 0.55);
  border: 1px solid rgba(210, 230, 245, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 1;
}

.icv-counter__icon-wrap::before,
.icv-counter__icon-wrap::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--icv-icon-layer);
  background: transparent;
  pointer-events: none;
  z-index: -1;
}

.icv-counter__icon-wrap::before {
  top: 5px;
  left: -5px;
  opacity: 0.85;
}

.icv-counter__icon-wrap::after {
  top: 10px;
  left: -10px;
  opacity: 0.55;
}

.icv-counter--soft .icv-counter__icon-wrap {
  margin: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.icv-counter--soft .icv-counter__icon-wrap::before {
  inset: -5px;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(126, 200, 239, 0.28);
  opacity: 0.85;
}

.icv-counter--soft .icv-counter__icon-wrap::after {
  display: none;
}

.icv-counter__icon {
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

.icv-counter--soft .icv-counter__icon {
  font-size: 28px;
}

.icv-counter__content {
  min-width: 0;
}

.icv-counter__number {
  margin: 0 0 4px;
  color: #fff;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.icv-counter__label {
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.icv-counter--soft .icv-counter__label {
  color: rgba(255, 255, 255, 0.86);
}

/* Remove gap when placed after testimonials */
.icv-testimonials + .icv-counter {
  margin-top: 0;
}

@media (max-width: 991px) {
  .icv-counter {
    padding: 64px 0 72px;
  }

  .icv-counter__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 20px;
  }

  .icv-counter__overlay {
    width: 22%;
  }
}

@media (max-width: 575px) {
  .icv-counter {
    padding: 56px 0 64px;
  }

  .icv-counter__grid {
    grid-template-columns: 1fr;
    gap: 28px;
    max-width: 320px;
    margin: 0 auto;
  }

  .icv-counter__item {
    gap: 16px;
  }

  .icv-counter__icon-wrap {
    width: 64px;
    height: 64px;
  }

  .icv-counter--soft .icv-counter__icon-wrap {
    border-radius: 14px;
  }

  .icv-counter--soft .icv-counter__icon-wrap::before {
    inset: -4px;
    border-radius: 16px;
  }

  .icv-counter__icon {
    font-size: 26px;
  }

  .icv-counter--soft .icv-counter__icon {
    font-size: 24px;
  }

  .icv-counter__overlay {
    display: none;
  }
}
