/* Collections page customized layout */
.collections-page {
  margin: 0;
  min-height: 100vh;
  background: #F4F1EA;
  overflow-x: hidden;
}

.collections-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

/* Background image/stage for skeleton*/

.collections-stage {
  position: relative;
  min-height: 80vh;
  padding: 120px 5% 35px;
  display: grid;
  grid-template-columns: 1fr 560px 1fr;
  gap: 35px;
  align-items: center;
  background-image: url("imgs/collectionsbgs.jpg");
  background-size: cover;
  background-position: center;
}

/* Carousel when starting to browse */

.collections-page.browsing .collections-stage {
  min-height: 66vh;
  padding-top: 85px;
  padding-bottom: 5px;
}

/* Moves the skeleton up when browsing */
.collections-page.browsing .skeleton-area,
.collections-page.browsing .item-info-left,
.collections-page.browsing .item-info-right {
  transform: translateY(-25px);
}
/* Skeleton details */

.skeleton-area {
  display: flex;
  justify-content: center;
  align-items: center;
}

.skeleton-wrapper {
  position: relative;
  width: 520px;
  aspect-ratio: 5 / 8;
  isolation: isolate;
}

.skeleton-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: scale(1.25);
}

.skeleton-body {
  z-index: 1;
}

.shoes-layer {
  z-index: 2;
}

.bottom-layer {
  z-index: 3;
}

.top-layer {
  z-index: 4;
}

.skeleton-head {
  z-index: 10 !important;
}

.body-zone {
  z-index: 20;
}

/* Showing and hiding clothes */

.clothing-layer {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.clothing-layer.active {
  opacity: 1;
  visibility: visible;
}

/* Clickable body parts for interactive feature*/

.body-zone {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 20;
}

.torso-zone {
  top: 18%;
  width: 65%;
  height: 31%;
}

.legs-zone {
  top: 48%;
  width: 48%;
  height: 36%;
}

.feet-zone {
  top: 83%;
  width: 48%;
  height: 15%;
}

.body-zone span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  padding: 11px 24px;
  border-radius: 999px;
  background: #1B1B18;
  color: #F4F1EA;
  font-family: "Newsreader", serif;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

/* Label becomes visible when hovered */
.body-zone:hover span,
.body-zone:focus-visible span {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Item information visibility */

.item-info {
  opacity: 0;
  visibility: hidden;
  color: #ffffff;
  font-family: "Lora", serif;
  transition: opacity 0.3s ease;
}

.item-info.visible {
  opacity: 1;
  visibility: visible;
}

.item-info-left {
  max-width: 1000px;
}
/* Item title */
.item-info-left h1 {
  margin: 0 0 35px;
  color: #C7352F;
  font-family: "Newsreader", serif;
  font-size: clamp(42px, 4vw, 60px);
  font-weight: 700;
  
  line-height: 0.9;
}

.item-details {
  padding: 28px 32px;
  background: #F4F1EA;
  color: #1B1B18;
  font-size: clamp(15px, 1.25vw, 20px);
  font-weight: 400;
  line-height: 1.55;
}

.item-details p {
  margin: 0 0 26px;
}

.item-details p:last-child {
  margin-bottom: 0;
}

.item-details strong {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.item-details span {
  display: block;
  padding-left: 25px;
}

.item-info-right {
  max-width: 450px;
  justify-self: end;
}

.item-info-right p {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 500;
  line-height: 1.55;
  text-align: right;
}

/* Instruction box  */

.instructions-box {
  grid-column: 3;
  justify-self: end;
  width: 100%;
  max-width: 500px;
  padding: 26px 34px;
  background: #F4F1EA;
  color: #1B1B18;
  box-shadow: 14px 14px 18px rgba(0, 0, 0, 0.22);
}

.instructions-box.hidden {
  display: none;
}

.instructions-box h2 {
  margin: 0 0 24px;
  color: #C7352F;
  font-family: "Newsreader", serif;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
}

.instructions-box ol {
  margin: 0;
  padding-left: 28px;
  font-family: "Lora", serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
}

.item-info-right {
  grid-column: 3;
}

/* Moving carousel */
/* Carousel starts hidden */
.collection-carousel {
  display: none;
  width: 100%;
  overflow: hidden;
  padding: 12px 0 16px;
  background: rgba(190, 187, 178, 0.95);
}

.collection-carousel.visible {
  display: block;
}

/* Clothes continue looping on the carousel */
.collection-track {
  display: flex;
  width: max-content;
  gap: 36px;
  animation: collection-scroll 30s linear infinite;
}

.collection-track:hover {
  animation-play-state: paused;
}

.carousel-group {
  display: flex;
  gap: 36px;
}

@keyframes collection-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 18px));
  }
}

/* Card/boxes for clothing pieces */

.collection-card {
  position: relative;
  width: 175px;
  height: 195px;
  flex-shrink: 0;
  padding: 16px;
  border: 3px solid transparent;
  background: #F4F1EA;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.collection-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 14px 18px rgba(0, 0, 0, 0.22);
}

.collection-card.active {
  border-color: #C7352F;
}

.collection-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Mobile */
@media (max-width: 600px) {
  .collections-header {
    position: relative;
  }

  .collections-stage {
    min-height: auto;
    padding: 85px 20px 30px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 25px;
    align-items: center;
    text-align: left;
  }

  /* Landing page */

  .collections-page:not(.browsing) .collections-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
  }

  .collections-page:not(.browsing) .item-info {
    display: none;
  }

  .collections-page:not(.browsing) .skeleton-area {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  .collections-page:not(.browsing) .instructions-box {
    width: calc(100% - 20px);
    max-width: 360px;
    margin: 0 auto;
    padding: 20px;
    align-self: center;
  }

  .instructions-box h2 {
    margin: 0 0 16px;
    font-size: 30px;
    line-height: 1.05;
    text-align: center;
  }

  .instructions-box ol {
    margin: 0;
    padding-left: 21px;
    font-size: 13px;
    line-height: 1.45;
  }

  /* After selecting an item */

  .collections-page.browsing .collections-stage {
    min-height: auto;
    padding: 80px 20px 25px;
  }

  .collections-page.browsing .item-info-left {
    grid-column: 1;
    grid-row: 1;
  }

  .collections-page.browsing .skeleton-area {
    grid-column: 2;
    grid-row: 1;
  }

  .collections-page.browsing .item-info-right {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .collections-page.browsing .skeleton-area,
  .collections-page.browsing .item-info-left,
  .collections-page.browsing .item-info-right {
    transform: none;
  }

  /* Skeleton */

  .skeleton-wrapper {
    width: min(100%, 290px);
  }

  .skeleton-layer {
    transform: scale(1.12);
  }

  /* Item details */

  .item-info-left {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .item-info-left h1 {
    margin: 0 0 15px;

    font-size: clamp(32px, 6vw, 44px);
    line-height: 1;
  }

  .item-details {
    padding: 20px;

    font-size: 13px;
    line-height: 1.45;
  }

  .item-details p {
    margin-bottom: 16px;
  }

  .item-details span {
    padding-left: 14px;
  }

  /* Piece background */

  .item-info-right {
    width: 100%;
    max-width: 620px;

    justify-self: center;
  }

  .item-info-right p {
    width: 100%;
    margin: 0;

    font-size: 14px;
    line-height: 1.55;
    text-align: center;
  }

  /* Carousel */

  .collection-card {
    width: 145px;
    height: 165px;
    padding: 12px;
  }

  .collection-track,
  .carousel-group {
    gap: 24px;
  }

  @keyframes collection-scroll {
    from {
      transform: translateX(0);
    }

    to {
      transform: translateX(calc(-50% - 12px));
    }
  }
}

/* Tablet */

@media (min-width: 601px) and (max-width: 1100px) {
  .collections-stage {
    min-height: 100vh;
    padding: 105px 4% 30px;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 390px);
    column-gap: 24px;
    row-gap: 25px;
    align-items: center;
  }

  /* Initial screen: skeleton left, instructions right */

  .skeleton-area {
    grid-column: 1;
    grid-row: 1;
  }

  .instructions-box {
    grid-column: 2;
    grid-row: 1;

    width: 100%;
    max-width: 380px;

    padding: 22px 25px;
    justify-self: center;
  }

  .instructions-box h2 {
    margin-bottom: 18px;
    font-size: 34px;
  }

  .instructions-box ol {
    padding-left: 23px;
    font-size: 14px;
    line-height: 1.5;
  }

  /* Item details replace the instructions after selecting clothing */

  .item-info-left {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 360px;
    justify-self: center;
  }

  .collections-page.browsing .skeleton-area {
    grid-column: 2;
    grid-row: 1;
  }

  .collections-page.browsing .item-info-left {
    grid-column: 1;
    grid-row: 1;
  }

  .collections-page.browsing .collections-stage {
    min-height: auto;
    padding-top: 95px;
    padding-bottom: 20px;
  }

  /* Remove desktop upward movement on tablets */

  .collections-page.browsing .skeleton-area,
  .collections-page.browsing .item-info-left,
  .collections-page.browsing .item-info-right {
    transform: none;
  }

  /* Skeleton sizing */

  .skeleton-wrapper {
    width: min(100%, 390px);
  }

  .skeleton-layer {
    transform: scale(1.18);
  }

  /* Item information */

  .item-info-left h1 {
    margin-bottom: 18px;
    font-size: clamp(38px, 5vw, 54px);
    line-height: 1;
  }

  .item-details {
    padding: 22px 24px;
    font-size: 14px;
  }

  .item-details p {
    margin-bottom: 18px;
  }

  .item-details span {
    padding-left: 18px;
  }

  /* Story goes below the skeleton and details */

  .item-info-right {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 700px;
    justify-self: center;
  }

  .item-info-right p {
    font-size: 16px;
    text-align: center;
  }

  /* Slightly smaller carousel */

  .collection-card {
    width: 160px;
    height: 180px;
    padding: 14px;
  }

  .collection-track,
  .carousel-group {
    gap: 28px;
  }

  @keyframes collection-scroll {
    from {
      transform: translateX(0);
    }

    to {
      transform: translateX(calc(-50% - 14px));
    }
  }
}