/* Collection page slider styles */

html,
body {
  height: 100%;
}

.collection-page {
  min-height: 100vh;
  height: 100vh;
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: hidden; /* keep page contained but allow internal slider scrolling */
}

.collection-slider-wrap {
  width: 100vw;
  max-width: 100%;
  padding: 0 24px;
  height: calc(100% - 16px);
}

.collection-slider {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-behavior: smooth;
  height: 100%;
  display: flex;
  align-items: center;
  padding-bottom: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.collection-slider::-webkit-scrollbar {
  display: none;
  height: 0;
}

.slider-track {
  display: flex;
  align-items: center;
  gap: 32px;
}

.slide {
  position: relative;
  scroll-snap-align: center;
  flex: 0 0 clamp(360px, 40vw, 520px);
  display: grid;
}

.slide img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
  will-change: transform, filter;
}

.slide-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  padding: 16px 20px;
  color: #ffffff;
  font-family: 'Penna Swashes', cursive;
  font-size: 18px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.slide:hover .slide-label {
  opacity: 1;
  transform: translateY(0);
}

.slide:hover img {
  filter: brightness(0.78);
}

.slide-link {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .collection-page {
    padding-top: 100px;
  }

  .slider-track {
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .collection-page {
    padding-top: 88px;
  }

  /* Mobile: make the slider vertical and slides much larger */
  .collection-slider {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    touch-action: pan-y;
  }

  .slider-track {
    flex-direction: column;
    gap: 28px;
    align-items: center;
  }

  .slide {
    /* Mobile: each slide is sized to ~75vh and image width is 90% of viewport */
    flex: 0 0 75vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .slide img {
    width: 90vw;
    height: 75vh;
    object-fit: cover;
    border-radius: 0;
  }

  /* show label when slide is in view (or on hover) */
  .slide.in-view .slide-label,
  .slide:hover .slide-label {
    opacity: 1;
    transform: translateY(0);
  }
  .slider-dots {
    margin-top: 20px;
  }
}

/* Desktop: push images visually towards the bottom and increase their height */
@media (min-width: 641px) {
  .collection-slider {
    align-items: flex-end;
    padding-bottom: 18px; /* small gap from bottom */
  }

  .slide {
    align-self: flex-end;
  }

  .slide img {
    /* larger, anchored toward the bottom of the viewport, leaving a small bottom gap */
    height: min(88vh, calc(100vh - 18px));
    width: auto;
    object-fit: cover;
    border-radius: 0;
  }

  .slide-label {
    bottom: 12px;
    padding: 12px 16px;
  }
}

/* Nudge the whole slider a bit lower on desktop */
@media (min-width: 641px) {
  .collection-page {
    padding-top: 56px; /* was 32px, small downward shift */
  }

  .collection-slider-wrap {
    margin-top: 12px;
  }
}
