/*
 * Packs additions that are not in the prototype, loaded on every page: "Cria o teu pack" (the
 * subscription builder's .repeat-* pieces), the full-width packs carousel and the pack line art.
 */
.pack-builder { padding-top: 0; }
.pack-builder .repeat-builder { margin-top: 0; }
.pack-builder .repeat-prepare svg { flex: none; }

/* A custom pack can hold three or more different jars: they line up in one row of the line art
   (cart drawer, checkout, order page) instead of wrapping below it. */
.pack-line-art:has(img:nth-child(3)) { grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; }

/* Packs carousel (PacksBlock with `carousel`): the cards run edge to edge and scroll sideways; the
   first ones line up with the heading, at the width they have in the grid. */
.nayalor-packs.is-carousel .nayalor-pack-grid {
  --pack-card: calc((min(1360px, 100vw - 64px) - 2 * var(--pack-gap)) / 3);
  --pack-edge: max(32px, (100vw - 1360px) / 2);
  flex-wrap: nowrap;
  justify-content: flex-start;
  position: relative; /* keeps absolutely positioned bits (.sr-only prices) inside the scroller */
  margin: -14px calc(50% - 50vw) -30px;
  padding: 14px var(--pack-edge) 30px;
  scroll-padding-inline: var(--pack-edge);
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.nayalor-packs.is-carousel .nayalor-pack-grid::-webkit-scrollbar { display: none; }
.nayalor-packs.is-carousel .nayalor-pack-card { flex: 0 0 var(--pack-card); scroll-snap-align: start; }

.pack-carousel-controls { justify-content: flex-end; gap: 7px; margin: -18px 0 22px; display: flex; }
.pack-carousel-controls button { color: #087e98; cursor: pointer; background: #fff; border: 1px solid #c9e1e7; border-radius: 50%; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; padding: 8px; transition: color .2s, background .2s, border-color .2s; display: inline-flex; }
.pack-carousel-controls button:hover:not(:disabled) { color: #fff; background: #087e98; border-color: #087e98; }
.pack-carousel-controls button:focus-visible { outline-offset: 3px; outline: 3px solid #087e9860; }
.pack-carousel-controls button:disabled { color: #b5c8cd; cursor: default; }
.pack-carousel-controls svg { width: 18px; height: 18px; }

@media (width <= 1100px) {
  .nayalor-packs.is-carousel .nayalor-pack-grid { --pack-card: calc((100vw - 64px - var(--pack-gap)) / 2); }
}
@media (width <= 900px) {
  .nayalor-packs.is-carousel .nayalor-pack-grid { --pack-edge: 15px; --pack-card: calc((100vw - 30px - var(--pack-gap)) / 2); }
  .pack-carousel-controls { margin-top: -8px; }
}
@media (width <= 650px) {
  .nayalor-packs.is-carousel .nayalor-pack-grid { --pack-card: calc(100vw - 30px - 42px); }
}
