.chpkg,
.chpkg * {
  box-sizing: border-box;
}

body:has(.chpkg) > .wrapper:not(.et-fb-iframe-ancestor) {
  overflow: clip;
}

.chpkg {
  position: relative;
  left: 50%;
  width: min(1120px, calc(100vw - 24px));
  max-width: 1120px;
  min-height: 180svh;
  margin: clamp(28px, 5vw, 72px) 0 clamp(36px, 6vw, 84px);
  color: #211a16;
  transform: translateX(-50%);
  overflow: visible;
  isolation: isolate;
}

.chpkg__sticky {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100svh;
  padding: clamp(10px, 2svh, 20px) 0;
  flex-direction: column;
  justify-content: center;
  gap: clamp(12px, 2svh, 22px);
}

.chpkg__scene {
  position: relative;
  width: 100%;
  height: min(68svh, 650px);
  min-height: 330px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(63, 48, 36, 0.08);
  border-radius: clamp(14px, 2vw, 22px);
  background: #fdfdfd;
  box-shadow: 0 12px 36px rgba(47, 35, 25, 0.07);
  transform: scale(0.98);
  transform-origin: 50% 55%;
}

.chpkg__studio {
  position: absolute;
  inset: 0;
  background: #fdfdfd;
}

.chpkg__motion {
  --chpkg-bar-transform: translate3d(0, 0, 0);
  position: absolute;
  inset: 0;
}

.chpkg__bar-host {
  position: absolute;
  z-index: 2;
  inset: 10% 11% 2%;
  transform: var(--chpkg-bar-transform);
  will-change: transform;
}

.chpkg__bar-host--front {
  z-index: 4;
  clip-path: inset(56% 0 0 0);
}

.chpkg__bar-piece {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 500ms ease;
  will-change: opacity;
}

.chpkg__bar-piece.is-visible {
  opacity: 1;
}

.chpkg__bar-piece.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.chpkg__bar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 57%;
}

.chpkg__bar-piece[data-chpkg-finish-piece="led"] .chpkg__bar-image {
  filter: brightness(1.15);
}

.chpkg__team {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 24%;
  display: block;
  width: min(43%, 480px);
  height: auto;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  translate: -50% 0;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.chpkg__ingredients,
.chpkg__glassware {
  position: absolute;
  z-index: 5;
  bottom: 2%;
  display: block;
  width: min(23%, 258px);
  height: auto;
  max-height: 48%;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 12px 12px rgba(43, 31, 22, 0.13));
  will-change: transform, opacity;
}

.chpkg__ingredients {
  left: 1%;
  transform: translate3d(0, 0, 0);
  transform-origin: 0 100%;
}

.chpkg__glassware {
  right: 1%;
  width: min(21%, 236px);
  transform: translate3d(0, 0, 0);
  transform-origin: 100% 100%;
}

.chpkg__selector {
  display: grid;
  width: min(100%, 980px);
  margin: 0 auto;
  gap: 9px;
  font-family: "IBM Plex Sans", Arial, sans-serif;
}

.chpkg__selector-label {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.chpkg__finishes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.chpkg__finish {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 9px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid #d8d1c7;
  border-radius: 10px;
  background: #fffdf8;
  color: #171310;
  box-shadow: none;
  font: 600 0.76rem/1.2 "IBM Plex Sans", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.chpkg__finish:hover {
  border-color: #53715a;
}

.chpkg__finish[aria-pressed="true"] {
  border-color: #3d6048;
  box-shadow: inset 0 0 0 1px #3d6048;
}

.chpkg__finish:focus-visible {
  outline: 3px solid #8a6a42;
  outline-offset: 3px;
}

.chpkg__swatch {
  display: block;
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(28, 22, 18, 0.25);
  border-radius: 50%;
  background: #eee5d9;
}

.chpkg__swatch--white {
  background: #f0ece5;
}

.chpkg__swatch--black {
  background: #252525;
}

.chpkg__swatch--wood {
  background: linear-gradient(90deg, #9b6538, #c4925b 48%, #81512e);
}

.chpkg__swatch--mirror {
  background: linear-gradient(135deg, #fcfcfa 0 32%, #c6cbc9 33% 64%, #f6f4ef 65%);
}

.chpkg__swatch--led {
  background: radial-gradient(circle, #fff 38%, #e8eef1 70%, #bdc8ce);
}

.chpkg__swatch--foliage {
  background: linear-gradient(135deg, #264d2f, #6d8b4e 50%, #315d39);
}

.chpkg__swatch--redbrick {
  background: linear-gradient(135deg, #9e4a38 0 44%, #d0a185 45% 54%, #7d382d 55%);
}

.chpkg__finish-label {
  min-width: 0;
}

.chpkg__status {
  min-height: 1.3em;
  color: #625b50;
  font-size: 0.82rem;
  line-height: 1.3;
}

@media (max-width: 800px) {
  .chpkg {
    min-height: 160svh;
  }

  .chpkg__scene {
    height: min(65svh, 600px);
    min-height: 360px;
  }

  .chpkg__finishes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chpkg__bar-host {
    inset: 12% 2% 4%;
  }

  .chpkg__team {
    bottom: 25%;
    width: min(55%, 510px);
  }

  .chpkg__ingredients {
    left: 0;
    width: 26%;
  }

  .chpkg__glassware {
    right: 0;
    width: 24%;
  }
}

@media (max-width: 480px) {
  .chpkg {
    width: min(1120px, calc(100vw - 16px));
  }

  .chpkg__sticky {
    gap: 10px;
  }

  .chpkg__scene {
    height: min(48svh, 330px);
    min-height: 240px;
  }

  .chpkg__finishes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .chpkg__finish {
    min-height: 64px;
    padding: 6px 3px;
    flex-direction: column;
    gap: 4px;
    font-size: 0.66rem;
    text-align: center;
  }

  .chpkg__swatch {
    width: 16px;
    min-width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce), (max-height: 479px) {
  .chpkg {
    min-height: auto;
  }

  .chpkg__sticky {
    position: relative;
    min-height: auto;
  }

  .chpkg__scene {
    transform: scale(0.98) !important;
  }

  .chpkg__bar-host {
    transform: translate3d(0, 0, 0) !important;
  }

  .chpkg__team,
  .chpkg__ingredients,
  .chpkg__glassware {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
  }

  .chpkg__bar-piece {
    transition-duration: 120ms !important;
  }
}
