/* Marble section ------------------------------------------------------------ */
.products {
  background: var(--img-marble) no-repeat bottom;
  background-size: cover;
}

/* Statement ------------------------------------------------------------------ */
.statement { padding: 200px 0 80px; }
.statement__container { display: flex; justify-content: center; }
.statement__text { max-width: 845px; width: 100%; text-align: center; }

@media (min-width: 1800px) { .statement { padding: 300px 0 150px; } }
@media (max-width: 430px) { .statement__text { font-size: 27px; line-height: 42px; } }

/* Stage + decoration --------------------------------------------------------- */
/* At least one screen + 150px of marble (the original 100vh + 40px + 100px + 50px
   spacing), but it grows with the carousel so dishes and names never spill out of
   the marble on short screens or with taller dish photos. */
.products__stage {
  position: relative;
  display: flow-root; /* keep the carousel offset inside the stage */
  min-height: calc(100vh + 150px);
}
.products__decoration {
  position: absolute;
  top: -140px;
  left: 0;
  z-index: 10;
  width: 50%;
  padding-top: 100px;
  pointer-events: none;
}
.products__decoration img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 768px) { .products__decoration { top: -350px; width: 40%; } }
@media (min-width: 1536px) { .products__decoration { top: -450px; } }
@media (min-width: 2500px) { .products__decoration { top: -550px; } }

/* Carousel ------------------------------------------------------------------- */
.carousel {
  --carousel-speed: 1000ms;
  position: relative;
  z-index: 20;
  margin-top: 135px;
  overflow: hidden;
  /* Dish photos with a white (non-transparent) background: multiply makes the
     white disappear over the marble. Transparent PNGs are unaffected. */
  mix-blend-mode: multiply;
}
.carousel__viewport { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.carousel__viewport:active { cursor: grabbing; }
.carousel__track { display: grid; align-items: center; }

/* ProductCard */
.product-card {
  grid-area: 1 / 1;
  justify-self: center;
  position: relative;
  width: 769px;
  height: 776px;
  transition: transform var(--carousel-speed) ease;
  will-change: transform;
}
.product-card__image { width: 100%; height: 100%; transform: rotate(10deg); transition: transform 0.8s; }
.product-card.is-active .product-card__image { transform: rotate(0deg); }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.product-card__title {
  position: absolute;
  bottom: -100px;
  left: 0;
  width: 100%;
  line-height: 2;
  text-align: center;
  text-transform: lowercase;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.product-card.is-active .product-card__title { opacity: 1; visibility: visible; }

@media (min-width: 1700px) and (max-width: 1920px) { .product-card { width: calc(650px + 5vw); height: auto; } }
@media (min-width: 1920px) and (max-width: 2500px) { .product-card { width: calc(800px + 5vw); height: auto; } }
@media (min-width: 2500px) { .product-card { width: calc(950px + 5vw); height: auto; } }
@media (max-width: 1190px) { .product-card { width: 100%; max-width: 600px; height: auto; } }
@media (max-width: 1024px) { .product-card__title { bottom: -70px; } }

/* Controls: progress, counter, arrows */
.carousel__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 23%;
  z-index: 25;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  padding: 0 10% 10px;
}
@media (min-width: 640px) { .carousel__controls { padding-left: 61px; padding-right: 61px; } }
@media (min-width: 1024px) { .carousel__controls { padding-left: 182px; padding-right: 207px; } }
@media (min-width: 1536px) { .carousel__controls { bottom: 15%; } }
@media (max-width: 1024px) { .carousel__controls { bottom: 0; } }

.carousel__progress {
  position: relative;
  width: 230px;
  max-width: 230px;
  height: 1px;
  background: var(--c-muted);
}
/* End marker (square outline). */
.carousel__progress::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--c-muted);
}
.carousel__progress-fill {
  position: absolute;
  inset: 0;
  background: var(--c-dark);
  transform: scaleX(0.2);
  transform-origin: left top;
  transition: transform var(--carousel-speed);
}

.carousel__count {
  position: absolute;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.carousel__count-current { font-size: 38px; line-height: 57.95px; color: var(--c-dark); }
.carousel__count-total { font-size: 20px; line-height: 30.5px; color: var(--c-muted); }

.carousel__arrows { display: flex; justify-content: flex-end; align-items: center; gap: 40px; }
@media (min-width: 1024px) { .carousel__arrows { gap: 60px; } }
.carousel__arrow {
  width: 33px;
  height: 68px;
  margin-top: -22px;
  color: #231f20;
  transition: transform 0.3s;
}
.carousel__arrow svg { width: 100%; height: 100%; }
.carousel__arrow:hover { transform: scale(1.1); }

.carousel__closing { display: flex; justify-content: center; }
/* Empty line of headline height: space for the dish names under the photos. */
.carousel__spacer { visibility: hidden; }
@media (min-width: 1024px) { .carousel__closing { margin-top: 75px; } }

@media (max-width: 1024px) {
  .carousel { margin-top: 170px; }
  .carousel__arrow { width: 22.5px; height: 46px; }
  .carousel__closing { margin-bottom: 100px; }
}
@media (max-width: 768px) {
  .carousel__progress { width: 111px; max-width: 111px; }
  .carousel__count { align-items: flex-start; }
  .carousel__count-current { font-size: 27px; line-height: 1; }
  .carousel__count-total { font-size: 16px; line-height: 1; }
}
