/* -------------------------------------------------------
   Product showcase (homepage "Our products" section)
   Behaviour lives in assets/js/product-showcase.js.
------------------------------------------------------- */
.product-showcase {
  --ps-base: var(--base-color, #dd6531);
  --ps-coral: #ef5f43;
  --ps-peach: #f38c4b;
  --ps-ink: var(--dark-gray, #292d36);
  --ps-muted: var(--medium-gray, #808291);
  --ps-duration: 6000ms;
  --ps-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ps-ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.25);
  position: relative;
  overflow: hidden;
  overflow: clip;
  background-color: var(--very-light-gray, #f7f7f7);
  background-image: radial-gradient(rgba(41, 45, 54, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Floating background glows */
.ps-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.ps-blob-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -100px;
  background: var(--ps-peach);
  animation: ps-drift 16s ease-in-out infinite;
}

.ps-blob-2 {
  width: 360px;
  height: 360px;
  bottom: -140px;
  left: -120px;
  background: var(--ps-coral);
  opacity: 0.22;
  animation: ps-drift 20s ease-in-out infinite reverse;
}

/* Heading */
.ps-head {
  max-width: 760px;
  margin: 0 auto 50px;
  text-align: center;
}

.ps-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ps-base);
  background: #fff;
  border: 1px solid rgba(221, 101, 49, 0.2);
  box-shadow: 0 6px 18px -10px rgba(221, 101, 49, 0.5);
}

.ps-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ps-base);
  animation: ps-pulse 1.8s ease-out infinite;
}

.ps-heading {
  margin: 0;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--ps-ink);
}

.ps-gradient-text {
  background: linear-gradient(90deg, var(--ps-base), var(--ps-coral), var(--ps-peach), var(--ps-base));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: ps-text-flow 7s linear infinite;
}

/* Layout */
.ps-wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 50px;
  align-items: center;
}

/* Tabs */
.ps-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px 14px 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  text-align: left;
  color: var(--ps-ink);
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--ps-ease-out);
}

.ps-tab:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateX(4px);
}

.ps-tab.is-active {
  background: #fff;
  border-color: rgba(221, 101, 49, 0.15);
  box-shadow: 0 18px 40px -22px rgba(41, 45, 54, 0.35);
  transform: translateX(8px);
}

.ps-tab:focus-visible {
  outline: 2px solid var(--ps-base);
  outline-offset: 2px;
}

.ps-tab-icon {
  flex: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 20px;
  color: var(--ps-ink);
  background: #fff;
  box-shadow: 0 6px 16px -10px rgba(41, 45, 54, 0.4);
  transition: color 0.35s ease, background 0.35s ease, transform 0.45s var(--ps-ease-spring), box-shadow 0.35s ease;
}

.ps-tab.is-active .ps-tab-icon {
  color: #fff;
  background: linear-gradient(135deg, var(--ps-base), var(--ps-peach));
  box-shadow: 0 10px 22px -10px rgba(221, 101, 49, 0.8);
  transform: rotate(-6deg) scale(1.05);
}

.ps-tab-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ps-tab-name {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.ps-tab-cat {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ps-muted);
}

.ps-tab-arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--ps-base);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.35s var(--ps-ease-out);
}

.ps-tab.is-active .ps-tab-arrow,
.ps-tab:hover .ps-tab-arrow {
  opacity: 1;
  transform: none;
}

/* Autoplay progress */
.ps-tab-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ps-base), var(--ps-peach));
  transform: scaleX(0);
  transform-origin: left center;
}

.ps-wrap.is-autoplay .ps-tab.is-active .ps-tab-progress {
  animation: ps-progress var(--ps-duration) linear forwards;
}

.ps-wrap.is-paused .ps-tab.is-active .ps-tab-progress {
  animation-play-state: paused;
}

/* Stage */
.ps-stage {
  position: relative;
}

.ps-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 50px;
  align-items: center;
}

.ps-panel[hidden] {
  display: none;
}

/* Media */
.ps-media {
  position: relative;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  perspective: 1000px;
}

/* Soft breathing glow behind the frame */
.ps-glow {
  position: absolute;
  inset: 12% 6% 0;
  z-index: 0;
  border-radius: 40px;
  background: radial-gradient(circle at 50% 60%, var(--ps-peach), var(--ps-base) 60%, transparent 75%);
  filter: blur(45px);
  opacity: 0.45;
  animation: ps-breathe 6s ease-in-out infinite;
  pointer-events: none;
}

/* Frame with a light trail travelling around its border */
.ps-frame {
  position: relative;
  z-index: 1;
  padding: 6px;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 60px -25px rgba(41, 45, 54, 0.55);
  transform: rotateX(var(--ps-rx, 0deg)) rotateY(var(--ps-ry, 0deg));
  transition: transform 0.4s var(--ps-ease-out);
  will-change: transform;
}

.ps-frame::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 220deg, var(--ps-peach) 290deg, var(--ps-base) 340deg, transparent 360deg);
  transform: translate(-50%, -50%);
  animation: ps-spin 5s linear infinite;
}

.ps-shot {
  position: relative;
  z-index: 1;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 600 / 730;
  background: var(--very-light-gray, #f7f7f7);
}

.ps-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: ps-kenburns 14s ease-in-out infinite alternate;
}

/* Darken the bottom of the shot so the caption reads well */
.ps-shot::after {
  content: "";
  position: absolute;
  inset: 55% 0 0;
  background: linear-gradient(to top, rgba(31, 34, 41, 0.55), transparent);
  pointer-events: none;
}

/* Frosted caption bar */
.ps-caption {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  text-align: left;
  color: #fff;
  background: rgba(41, 45, 54, 0.45);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.ps-caption-icon {
  flex: none;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--ps-base), var(--ps-peach));
  box-shadow: 0 8px 18px -8px rgba(221, 101, 49, 0.9);
}

.ps-caption-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.ps-caption-text strong {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.ps-caption-text span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* Info */
.ps-count {
  display: block;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ps-base);
}

.ps-count span {
  color: var(--ps-muted);
  font-weight: 500;
}

.ps-title {
  margin-bottom: 16px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.2;
  color: var(--ps-ink);
}

.ps-title span {
  font-weight: 700;
  color: var(--ps-base);
}

.ps-desc {
  margin-bottom: 28px;
  color: var(--ps-muted);
}

.ps-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--ps-ink);
  box-shadow: 0 16px 30px -16px rgba(41, 45, 54, 0.8);
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow 0.35s ease, transform 0.35s var(--ps-ease-out);
}

.ps-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, var(--ps-peach), var(--ps-coral));
  transform: translateX(-101%);
  transition: transform 0.5s var(--ps-ease-out);
}

.ps-cta:hover,
.ps-cta:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -16px rgba(221, 101, 49, 0.8);
}

.ps-cta:hover::before,
.ps-cta:focus-visible::before {
  transform: none;
}

.ps-cta:focus-visible {
  outline: 3px solid rgba(221, 101, 49, 0.35);
  outline-offset: 3px;
}

.ps-cta-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ps-ink);
  background: #fff;
  transition: transform 0.45s var(--ps-ease-spring);
}

.ps-cta:hover .ps-cta-icon {
  transform: rotate(45deg);
}

/* Panel enter animation (re-runs every time a panel becomes active) */
.ps-panel.is-active .ps-frame {
  animation: ps-reveal-img 0.9s var(--ps-ease-out) both;
}

.ps-panel.is-active .ps-caption {
  animation: ps-caption-in 0.7s var(--ps-ease-spring) 0.45s both;
}

.ps-panel.is-active .ps-glow {
  animation: ps-glow-in 1s ease 0.1s both, ps-breathe 6s ease-in-out 1.1s infinite;
}

.ps-panel.is-active .ps-info > * {
  animation: ps-rise 0.7s var(--ps-ease-out) both;
}

.ps-panel.is-active .ps-info > :nth-child(1) { animation-delay: 0.15s; }
.ps-panel.is-active .ps-info > :nth-child(2) { animation-delay: 0.25s; }
.ps-panel.is-active .ps-info > :nth-child(3) { animation-delay: 0.35s; }
.ps-panel.is-active .ps-info > :nth-child(4) { animation-delay: 0.45s; }

/* Scroll reveal (only hidden once JS is running) */
.ps-js .ps-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.9s var(--ps-ease-out);
}

.ps-js .ps-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.ps-js .ps-wrap.ps-reveal {
  transition-delay: 0.15s;
}

/* Keyframes */
@keyframes ps-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.12); }
}

@keyframes ps-pulse {
  0% { box-shadow: 0 0 0 0 rgba(221, 101, 49, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(221, 101, 49, 0); }
}

@keyframes ps-text-flow {
  to { background-position: 300% 0; }
}

@keyframes ps-progress {
  to { transform: scaleX(1); }
}

@keyframes ps-spin {
  to { transform: rotate(360deg); }
}

@keyframes ps-kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

@keyframes ps-reveal-img {
  from { clip-path: inset(0 0 100% 0 round 30px); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0 round 30px); opacity: 1; }
}

@keyframes ps-caption-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes ps-glow-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 0.45; transform: none; }
}

@keyframes ps-breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.06); }
}

@keyframes ps-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

/* Tablet: tabs become a swipeable row above the stage */
@media (max-width: 991px) {
  .ps-head {
    margin-bottom: 35px;
  }

  .ps-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 35px;
  }

  .ps-tabs {
    flex-direction: row;
    gap: 10px;
    margin: 0 -15px;
    padding: 6px 15px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .ps-tabs::-webkit-scrollbar {
    display: none;
  }

  .ps-tab {
    flex: none;
    width: auto;
    padding: 8px 18px 8px 8px;
    border-radius: 999px;
    background: #fff;
    border-color: rgba(41, 45, 54, 0.08);
    scroll-snap-align: start;
  }

  .ps-tab:hover,
  .ps-tab.is-active {
    transform: none;
  }

  .ps-tab-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    box-shadow: none;
    background: var(--very-light-gray, #f7f7f7);
  }

  .ps-tab-name {
    font-size: 16px;
  }

  .ps-tab-cat,
  .ps-tab-arrow {
    display: none;
  }

  .ps-tab-progress {
    left: 24px;
    right: 24px;
  }
}

/* Phone: stack media and info */
@media (max-width: 767px) {
  .ps-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    text-align: center;
  }

  .ps-media {
    max-width: 320px;
  }

  .ps-blob {
    opacity: 0.2;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .product-showcase *,
  .product-showcase *::before,
  .product-showcase *::after {
    animation: none !important;
    transition: none !important;
  }

  .ps-js .ps-reveal {
    opacity: 1;
    transform: none;
  }
}
