/* Pazhoohan Why Slider */

.why-slider {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 425px;
  overflow: hidden;
  border-radius: 22px;
  background: #112c4b;
  isolation: isolate;
}

.why-slider .why-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.045);
  transition:
    opacity 950ms cubic-bezier(.22,1,.36,1),
    transform 6500ms linear,
    visibility 950ms;
  will-change: opacity, transform;
}

.why-slider .why-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 1;
}

.why-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.why-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
  border-radius: inherit;
}

.why-slider-controls {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  direction: ltr;
}

.why-slider-arrows {
  display: flex;
  gap: 8px;
}

.why-slider-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 11px;
  background: rgba(10,30,55,.65);
  color: #fff;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition:
    background .2s ease,
    transform .2s ease;
}

.why-slider-arrow:hover {
  background: #bd985e;
  transform: translateY(-2px);
}

.why-slider-arrow svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.why-slider-dots {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 7px;
  align-items: center;
}

.why-slider-dot {
  position: relative;
  width: 24px;
  height: 5px;
  padding: 0;
  background: rgba(255,255,255,.4);
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: width .3s ease;
}

.why-slider-dot.is-active {
  width: 42px;
  background: rgba(255,255,255,.55);
}

.why-slider-dot.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #e5b76e;
  transform-origin: left;
  animation: whyProgress 6s linear forwards;
}

.why-slider.is-paused .why-slider-dot.is-active::after {
  animation-play-state: paused;
}

.why-slider-dot:focus-visible,
.why-slider-arrow:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@keyframes whyProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 800px) {
  .why-slider {
    min-height: 330px;
    border-radius: 18px;
  }

  .why-slider-controls {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }
}

@media (max-width: 520px) {
  .why-slider {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .why-slider-arrow {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .why-slider .why-slide {
    transform: none;
    transition: none;
  }

  .why-slider-dot.is-active::after {
    animation: none;
    transform: scaleX(1);
  }
}

/* Slider image proportions and controls refinement */

.why-grid {
  align-items: center;
}

.why-panel.why-slider {
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
}

.why-slider .why-slide {
  inset: 0;
  width: 100%;
  height: 100%;
}

.why-slider .why-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.why-slider-controls {
  bottom: 12px;
  left: 14px;
  right: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.why-slider-arrow {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(9, 29, 52, .75);
}

@media (max-width: 800px) {
  .why-panel.why-slider {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .why-panel.why-slider {
    aspect-ratio: 4 / 3;
  }
}
