/* Frontpage motion: restrained hero crossfade and manual product carousel. */
.p1-hero::before {
  z-index: 1;
  background: linear-gradient(90deg, rgb(2 21 58 / 96%) 0%, rgb(2 38 92 / 76%) 48%, rgb(2 38 92 / 24%) 100%);
}

.p1-hero::after { z-index: 1; }
.hero-inner { z-index: 2; }

.hero-slide-stack,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  margin: 0;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 900ms ease, transform 6.4s ease-out;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
}

.carousel-arrow:focus-visible,
.product-carousel-viewport:focus-visible {
  outline: 3px solid rgb(79 151 255 / 42%);
  outline-offset: 2px;
}

.product-carousel-heading { align-items: end; }

.product-carousel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-position {
  min-width: 78px;
  color: var(--ink-600);
  font-size: .68rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.carousel-arrows { display: flex; gap: 7px; }

.carousel-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--brand-blue-dark);
  background: #fff;
  border: 1px solid #cfd9e8;
  border-radius: 13px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.carousel-arrow:hover:not(:disabled) {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  transform: translateY(-1px);
}

.carousel-arrow:disabled { opacity: .34; cursor: default; }
.carousel-arrow .ui-icon { width: 17px; height: 17px; }

.product-carousel-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: 1px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  touch-action: pan-y;
  cursor: grab;
}

.product-carousel-viewport::-webkit-scrollbar { display: none; }

.product-carousel-viewport.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}

.product-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.product-carousel-track .product-card {
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 0;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

.product-carousel-track .product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-carousel-track .product-price { margin-top: auto; }

.product-carousel-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 17px;
  color: var(--ink-600);
  font-size: .66rem;
}

.product-carousel-progress {
  width: 116px;
  height: 3px;
  overflow: hidden;
  background: #dce4ef;
  border-radius: 999px;
}

.product-carousel-progress span {
  width: 25%;
  height: 100%;
  display: block;
  background: var(--brand-blue);
  border-radius: inherit;
  transform-origin: left center;
  transition: width 120ms linear;
}

@media (max-width: 1050px) {
  .product-carousel-track .product-card { flex-basis: calc((100% - 18px) / 2); }
  .product-carousel-track { gap: 18px; }
}

@media (max-width: 760px) {
  .p1-hero::before { background: linear-gradient(180deg, rgb(2 24 60 / 60%) 0%, rgb(2 24 60 / 91%) 67%, rgb(2 20 50 / 97%) 100%); }
  .hero-slide img { object-position: 58% center; }
  .hero-inner { padding-bottom: 72px; }

  .product-carousel-heading { width: 100%; gap: 18px; }
  .product-carousel-head-actions { width: 100%; justify-content: space-between; }
  .carousel-arrows { display: none; }
  .carousel-position { min-width: 0; text-align: left; }
  .product-carousel-head-actions .btn { min-height: 40px; padding: 9px 12px; font-size: .68rem; }
  .product-carousel-track { gap: 12px; }
  .product-carousel-track .product-card { flex-basis: min(78vw, 320px); }
  .product-carousel-viewport { width: calc(100% + var(--page-gutter)); padding-right: var(--page-gutter); }
  .product-carousel-footer { margin-top: 14px; }
  .product-carousel-progress { width: 90px; }
}

@media (max-width: 380px) {
  .product-carousel-track .product-card { flex-basis: min(80vw, 286px); }
  .product-carousel-head-actions .btn { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .product-carousel-viewport { scroll-behavior: auto !important; transition: none !important; }
  .carousel-arrow { transition: none; }
}
