/* Packs is intentionally a focused browse page: one clear choice of pack
   type, followed by the relevant live catalogue selection. */
.packs-page {
  background: #f7f5f0;
  min-height: 70vh;
  padding-top: clamp(2.5rem, 5vw, 4.75rem);
}

.packs-page-heading {
  margin: 0 auto;
  max-width: 92rem;
  padding: 0 clamp(1rem, 6vw, 7rem) clamp(2rem, 4vw, 3.5rem);
}

.packs-page-heading h1,
.gift-collection h2 {
  color: #211c18;
  font-family: Arial, sans-serif;
  font-size: clamp(1.7rem, 2.9vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1;
  margin: 0;
  max-width: none;
}

.packs-page-tabs {
  display: grid;
  gap: clamp(.65rem, 1.2vw, 1rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(1.5rem, 2.7vw, 2.4rem);
  max-width: 70rem;
}

.packs-page-tabs button {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(33, 28, 24, .42);
  color: #211c18;
  cursor: pointer;
  display: flex;
  font: 700 clamp(.82rem, 1vw, .95rem)/1 Arial, sans-serif;
  justify-content: center;
  letter-spacing: .08em;
  min-height: clamp(4rem, 6vw, 5.25rem);
  padding: 1rem 1.15rem;
  text-transform: uppercase;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease;
}

.packs-page-tabs button:hover,
.packs-page-tabs button:focus-visible {
  background: #e8e2d9;
  border-color: #211c18;
  outline: none;
}

.packs-page-tabs button[aria-selected="true"] {
  background: #211c18;
  border-color: #211c18;
  color: #faf7f1;
}

.packs-page .pack-collection,
.packs-page .simcha-collection,
.gift-collection {
  margin: 0;
}

.packs-page .pack-page-panel.is-revealing {
  animation: pack-panel-reveal 360ms cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes pack-panel-reveal {
  from { opacity: 0; transform: translateY(.65rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .packs-page .pack-page-panel.is-revealing { animation: none; }
  .packs-page-tabs button { transition: none; }
}

.packs-page .pack-collection {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.gift-collection {
  background: #f2eadc;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 6vw, 7rem) clamp(4rem, 7vw, 6.5rem);
}

.gift-collection-heading {
  margin: 0 auto;
  max-width: 92rem;
}

.gift-collection-heading > div { max-width: 45rem; }

.gift-collection-heading > div > p:last-child {
  color: #665950;
  font-size: 1rem;
  line-height: 1.55;
  margin: 1rem 0 0;
  max-width: 34rem;
}

.gift-size-picker {
  align-items: center;
  border-bottom: 1px solid rgba(47, 36, 31, .18);
  border-top: 1px solid rgba(47, 36, 31, .18);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin: 0 auto;
  max-width: 92rem;
  padding: .85rem 0;
}

.gift-size-picker > span {
  color: #62564e;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gift-size-picker > div { display: flex; gap: .4rem; }

.gift-size-picker button {
  background: transparent;
  border: 1px solid rgba(47, 36, 31, .28);
  border-radius: 999px;
  color: #2f2521;
  cursor: pointer;
  font: 900 .76rem/1 Arial, sans-serif;
  min-height: 2.4rem;
  min-width: 2.6rem;
  padding: .55rem .8rem;
}

.gift-size-picker button:hover,
.gift-size-picker button:focus-visible,
.gift-size-picker button.is-active {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
  outline: none;
}

.gift-pack-result {
  margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
  max-width: 92rem;
}

.gift-pack-card {
  background: #fffaf3;
  border: 1px solid rgba(47, 36, 31, .16);
  display: grid;
  gap: clamp(1.25rem, 3vw, 3rem);
  grid-template-columns: minmax(14rem, .8fr) minmax(0, 1.2fr);
  padding: clamp(1rem, 2.4vw, 2rem);
}

.gift-pack-art {
  background: radial-gradient(circle at 50% 28%, #fffdf7 0, #ece1ce 62%, #dfd1bb 100%);
  min-height: 16rem;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  --gift-x: 3.6rem;
  --gift-height: 14rem;
}

.gift-pack-art[data-gift-preview-count="3"] { --gift-height: 12rem; --gift-x: 4.5rem; }
.gift-pack-art[data-gift-preview-count="6"] { --gift-height: 10rem; --gift-x: 5.6rem; }
.gift-pack-art[data-gift-preview-count="12"] { --gift-height: 6.3rem; --gift-x: clamp(6rem, 25vw, 11rem); }
.gift-pack-art[data-gift-preview-count="6"] .gift-orbit-slot { width: min(23%, 4rem); }
.gift-pack-art[data-gift-preview-count="12"] .gift-orbit-slot { width: min(13%, 2.4rem); }

.gift-orbit-slot {
  animation: gift-bottle-orbit 12s linear infinite;
  animation-delay: var(--gift-delay);
  top: 50%;
  display: grid;
  height: var(--gift-height);
  left: 50%;
  place-items: end center;
  position: absolute;
  translate: 0 -50%;
  /* Scale toward and away from the viewer while every bottle rests on the same plane. */
  transform-origin: 50% 100%;
  width: min(30%, 7rem);
  will-change: transform;
}

.gift-orbit-slot .product-image,
.gift-orbit-slot .product-bottle {
  filter: drop-shadow(0 .45rem .4rem rgba(44, 28, 18, .22));
  height: 100%;
  max-width: 100%;
  mix-blend-mode: normal;
  object-fit: contain;
  object-position: center bottom;
  width: 100%;
}

/* A small number of legacy generated scenes cannot be safely pixel-isolated.
   Fade their outer canvas inside the preview rather than exposing a hard
   rectangle behind the bottle. */
.gift-pack-art .product-image.gift-pack-opaque-source {
  -webkit-mask-image: radial-gradient(ellipse 38% 54% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 38% 54% at 50% 50%, #000 62%, transparent 100%);
}

.gift-orbit-slot .product-image.is-unavailable + .product-image-fallback {
  display: block;
  height: 100%;
  width: 42%;
}

.gift-pack-art .product-image-fallback::before {
  background: color-mix(in srgb, var(--bottle) 84%, #1f1814);
  border-radius: .18rem .18rem 0 0;
  content: "";
  height: 16%;
  left: 34%;
  position: absolute;
  top: -13%;
  width: 32%;
}

@keyframes gift-bottle-orbit {
  0%, 100% { transform: translate3d(calc(-50% + var(--gift-x)), 0, 0) scale(.9); z-index: 2; }
  6.25% { transform: translate3d(calc(-50% + var(--gift-x) * .924), 0, 0) scale(1); z-index: 2; }
  12.5% { transform: translate3d(calc(-50% + var(--gift-x) * .707), 0, 0) scale(1.06); z-index: 2; }
  18.75% { transform: translate3d(calc(-50% + var(--gift-x) * .383), 0, 0) scale(1.09); z-index: 2; }
  25% { transform: translate3d(-50%, 0, 0) scale(1.1); z-index: 2; }
  31.25% { transform: translate3d(calc(-50% - var(--gift-x) * .383), 0, 0) scale(1.09); z-index: 2; }
  37.5% { transform: translate3d(calc(-50% - var(--gift-x) * .707), 0, 0) scale(1.06); z-index: 2; }
  43.75% { transform: translate3d(calc(-50% - var(--gift-x) * .924), 0, 0) scale(1); z-index: 2; }
  49.99% { transform: translate3d(calc(-50% - var(--gift-x)), 0, 0) scale(.9); z-index: 2; }
  50% { transform: translate3d(calc(-50% - var(--gift-x)), 0, 0) scale(.9); z-index: 1; }
  56.25% { transform: translate3d(calc(-50% - var(--gift-x) * .924), 0, 0) scale(.82); z-index: 1; }
  62.5% { transform: translate3d(calc(-50% - var(--gift-x) * .707), 0, 0) scale(.76); z-index: 1; }
  68.75% { transform: translate3d(calc(-50% - var(--gift-x) * .383), 0, 0) scale(.73); z-index: 1; }
  75% { transform: translate3d(-50%, 0, 0) scale(.72); z-index: 1; }
  81.25% { transform: translate3d(calc(-50% + var(--gift-x) * .383), 0, 0) scale(.73); z-index: 1; }
  87.5% { transform: translate3d(calc(-50% + var(--gift-x) * .707), 0, 0) scale(.76); z-index: 1; }
  93.75% { transform: translate3d(calc(-50% + var(--gift-x) * .924), 0, 0) scale(.82); z-index: 1; }
  99.99% { transform: translate3d(calc(-50% + var(--gift-x)), 0, 0) scale(.9); z-index: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .gift-orbit-slot {
    animation: none;
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    translate: none;
  }
  .gift-pack-art {
    align-items: end;
    display: flex;
    justify-content: center;
    gap: .15rem;
    padding: .5rem;
  }
  .gift-orbit-slot { width: min(20%, 7rem); }
  .gift-pack-art[data-gift-preview-count="12"] { flex-wrap: wrap; align-content: center; }
  .gift-pack-art[data-gift-preview-count="12"] .gift-orbit-slot { width: 15%; height: 7rem; }
}

.gift-pack-copy { align-self: center; }
.gift-pack-copy .pack-hero-kicker { margin-bottom: .55rem; }
.gift-pack-copy h3 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.4vw, 3.6rem); font-weight: 500; letter-spacing: -.06em; line-height: .92; margin: 0; }
.gift-pack-copy > p { color: #65584f; font-size: .96rem; line-height: 1.5; margin: .9rem 0 1.3rem; max-width: 36rem; }
.gift-drink-type { align-items: center; display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.gift-drink-type > span { color: #786b62; font: 900 .62rem/1 Arial, sans-serif; letter-spacing: .11em; margin-right: .2rem; text-transform: uppercase; }
.gift-drink-type button { background: transparent; border: 1px solid rgba(47, 36, 31, .26); color: #2f2521; cursor: pointer; font: 850 .65rem/1 Arial, sans-serif; letter-spacing: .06em; min-height: 2rem; padding: .45rem .65rem; text-transform: uppercase; }
.gift-drink-type button:hover, .gift-drink-type button:focus-visible, .gift-drink-type button.is-active { background: var(--plum); border-color: var(--plum); color: #fff; outline: none; }
.gift-pack-copy > .gift-pack-note { border-left: 2px solid #b28a42; color: #4f443d; font-size: .82rem; margin: .8rem 0 1.3rem; padding-left: .65rem; }
.gift-pack-note strong { color: #211c18; }
.gift-pack-meta { align-items: center; border-top: 1px solid rgba(47, 36, 31, .16); display: flex; gap: 1rem; justify-content: space-between; padding-top: .9rem; }
.gift-pack-meta strong { font-size: 1.25rem; }
.gift-pack-meta button { background: var(--ink); border: 1px solid var(--ink); color: #fff; cursor: pointer; font: 900 .68rem/1 Arial, sans-serif; letter-spacing: .09em; padding: .85rem 1rem; text-transform: uppercase; }
.gift-pack-meta button:hover, .gift-pack-meta button:focus-visible { background: var(--plum); border-color: var(--plum); outline: none; }

@media (max-width: 680px) {
  .packs-page { padding-top: 2rem; }
  .packs-page-heading { padding-left: 1rem; padding-right: 1rem; }
  .packs-page-heading h1 { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .packs-page-tabs { gap: .45rem; }
  .packs-page-tabs button { font-size: .64rem; letter-spacing: .055em; min-height: 3.75rem; padding-left: .3rem; padding-right: .3rem; }
  .gift-size-picker { align-items: flex-start; flex-direction: column; }
  .gift-pack-card { grid-template-columns: 1fr; }
  .gift-pack-art { min-height: 19rem; }
  .gift-pack-copy h3 { font-size: 2.35rem; }
  /* Keep the new pack tiles comfortably readable once the viewport no
     longer has room for the desktop three-column composition. */
  .packs-page .pack-page-grid { grid-template-columns: 1fr; }
}
