/**
 * Lightweight storefront motion — GPU-friendly opacity/transform only.
 * No external animation libraries.
 */

/* —— Page shell fade-in after load / shell swap —— */
#poAppMain.po-main-enter {
  animation: po-main-enter 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.site-footer.po-reveal {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.site-footer.po-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes po-main-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* —— Section scroll reveal (light, slow) —— */
.po-reveal {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition:
    opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: calc(var(--po-reveal-i, 0) * 45ms);
  contain: layout style;
}

.po-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  /* padding-top: 8px; */
}

.po-reveal.po-reveal--instant {
  transition-duration: 0.75s;
  transition-delay: 0ms;
}

/* —— Inline content skeletons (testimonials, cards) —— */
.po-inline-skeleton {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  min-height: 12rem;
  padding: 0.25rem 0;
}

.po-testimonials-skeleton {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.65rem;
  min-height: 14rem;
  padding: 0.5rem 0;
}

.po-testimonials-skeleton__card {
  flex: 0 0 28%;
  max-width: 11rem;
  min-height: 10.5rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, #e8ece9 0%, #f4f7f5 48%, #e8ece9 100%);
  background-size: 200% 100%;
  animation: po-skeleton-flow 1.4s ease-in-out infinite;
}

.po-testimonials-skeleton__card--center {
  flex: 0 0 34%;
  max-width: 13rem;
  min-height: 11.5rem;
  opacity: 1;
}

.po-testimonials-skeleton__card:not(.po-testimonials-skeleton__card--center) {
  opacity: 0.72;
  transform: scale(0.94);
}

.po-inline-skeleton__line {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8ece9 0%, #f4f7f5 48%, #e8ece9 100%);
  background-size: 200% 100%;
  animation: po-skeleton-flow 1.4s ease-in-out infinite;
}

.po-inline-skeleton__line--wide {
  width: 88%;
}

.po-inline-skeleton__line--mid {
  width: 72%;
}

.po-inline-skeleton__line--short {
  width: 48%;
}

.po-inline-skeleton__block {
  display: block;
  min-height: 8rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, #e8ece9 0%, #f4f7f5 48%, #e8ece9 100%);
  background-size: 200% 100%;
  animation: po-skeleton-flow 1.4s ease-in-out infinite;
}

@keyframes po-skeleton-flow {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Testimonials content fade-in when loaded */
.po-content-fade-in {
  animation: po-content-fade-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes po-content-fade-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* —— Light glass on images only (videos excluded in JS) —— */
.po-img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #eef2ef;
}

.po-img-frame--cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.relative > .po-img-frame--cover,
[class*="aspect-"] > .po-img-frame--cover,
.home-hero-frame > .po-img-frame--cover,
.home-hero-mobile > .po-img-frame--cover,
.ss-showcase__cell > .po-img-frame--cover,
.pd-main-image-wrap > .po-img-frame--cover,
.pd-thumb > .po-img-frame--cover,
.pd-related-card__media > .po-img-frame--cover {
  position: absolute;
  inset: 0;
}

.po-img-frame > img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.po-img-frame--cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.po-img-frame > img.h-full {
  height: 100%;
}

.po-img-glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(236, 242, 238, 0.45) 50%,
    rgba(255, 255, 255, 0.5) 100%
  );
  opacity: 1;
  transition: opacity 0.4s ease;
}

.po-img-frame.is-loading .po-img-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 42%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 58%
  );
  background-size: 220% 100%;
  animation: po-glass-shimmer 1.8s ease-in-out infinite;
}

.po-img-frame.is-loaded .po-img-glass {
  opacity: 0;
}

.po-img-frame.is-loaded {
  background: transparent;
}

.po-img-frame.is-loaded > img {
  opacity: 1;
}

/* Badges/overlays stay above glass — they sit beside .po-img-frame, not inside it */
a:has(> .po-img-frame) > .absolute,
a:has(> .po-img-frame) > span.absolute,
.relative:has(> .po-img-frame) > span.absolute {
  z-index: 6;
}

.t-showcase-card__sound-btn,
.t-showcase-card__ext {
  z-index: 8;
}

@keyframes po-glass-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .po-img-glass,
  .po-img-glass::after {
    animation: none !important;
  }

  .po-img-frame > img {
    transition: none;
  }

  #poAppMain.po-main-enter,
  .po-reveal,
  .po-content-fade-in {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .po-testimonials-skeleton__card,
  .po-inline-skeleton__line,
  .po-inline-skeleton__block {
    animation: none !important;
    background: #e8ece9 !important;
  }

  .po-img-frame.is-loaded .po-img-glass {
    opacity: 0;
  }

  .po-img-frame > img,
  .po-img-frame.is-loaded > img {
    opacity: 1;
  }
}
