/* Structural CSS for the collection template.
   The live theme gets these rules from base.css, which this project does not load. */

.collection-page {
  --font-body-scale: 1;
  --font-heading-scale: 1;
  --grid-desktop-horizontal-spacing: 8px;
  --grid-desktop-vertical-spacing: 8px;
  --grid-mobile-horizontal-spacing: 8px;
  --grid-mobile-vertical-spacing: 8px;
  --border-radius: 0;
  --border-width: 0;
  --image-padding: 0px;
  --alpha-link: 0.85;
  --text-alignment: left;
  --duration-long: 400ms;
  --line-height-heading: 1.08;
}

.collection-page .page-width {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 80px;
  padding-right: 80px;
}

@media screen and (max-width: 749px) {
  .collection-page .page-width {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.collection-page .collection-grid-padding {
  padding-top: 36px;
  padding-bottom: 36px;
}

@media screen and (max-width: 749px) {
  .collection-page .collection-grid-padding {
    padding-top: 27px;
    padding-bottom: 27px;
  }
}

/* Ratios / media */
.collection-page .ratio {
  display: flex;
  position: relative;
  align-items: stretch;
}

.collection-page .ratio:before {
  content: "";
  width: 0;
  height: 0;
  padding-bottom: var(--ratio-percent);
}

.collection-page .media {
  display: block;
  background-color: rgba(var(--color-foreground), 0.1);
  overflow: hidden;
}

.collection-page .media--transparent {
  background-color: transparent;
}

.collection-page .media > *:not(.zoom):not(.deferred-media__poster-button) {
  display: block;
  max-width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

.collection-page .media > img {
  object-fit: cover;
  object-position: center center;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.collection-page .media.media--hover-effect > img + img {
  opacity: 0;
}

@media screen and (min-width: 990px) {
  .collection-page .card-wrapper:hover .media.media--hover-effect > img + img {
    opacity: 1;
  }

  .collection-page .card-wrapper:hover .media.media--hover-effect > img:first-of-type:not(:only-child) {
    opacity: 0;
  }
}

/* Grid */
.collection-page .grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  column-gap: var(--grid-desktop-horizontal-spacing);
  row-gap: var(--grid-desktop-vertical-spacing);
}

.collection-page .grid:last-child {
  margin-bottom: 0;
}

.collection-page .grid__item {
  width: calc(25% - var(--grid-desktop-horizontal-spacing) * 3 / 4);
  max-width: calc(25% - var(--grid-desktop-horizontal-spacing) * 3 / 4);
  flex-grow: 1;
  flex-shrink: 0;
  box-sizing: border-box;
}

@media screen and (max-width: 989px) {
  .collection-page .grid__item {
    width: calc(33.33% - var(--grid-desktop-horizontal-spacing) * 2 / 3);
    max-width: calc(33.33% - var(--grid-desktop-horizontal-spacing) * 2 / 3);
  }
}

@media screen and (max-width: 749px) {
  .collection-page .grid {
    column-gap: var(--grid-mobile-horizontal-spacing);
    row-gap: var(--grid-mobile-vertical-spacing);
  }

  .collection-page .grid__item {
    width: calc(50% - var(--grid-mobile-horizontal-spacing) / 2);
    max-width: calc(50% - var(--grid-mobile-horizontal-spacing) / 2);
  }
}

/* Utilities */
.collection-page .hidden {
  display: none !important;
}

.collection-page .visually-hidden {
  position: absolute !important;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  word-wrap: normal !important;
}

.collection-page .visually-hidden--inline {
  margin: 0;
  height: 1em;
}

.collection-page .list-unstyled {
  margin: 0;
  padding: 0;
  list-style: none;
}

.collection-page .light {
  opacity: 0.7;
}

.collection-page .caption-large {
  font-size: 1.3rem;
  line-height: calc(1 + 0.5 / var(--font-body-scale));
}

.collection-page .underlined-link {
  color: rgba(var(--color-link), var(--alpha-link));
  text-underline-offset: 0.3rem;
  text-decoration-thickness: 0.1rem;
  transition: text-decoration-thickness ease 0.1s;
}

.collection-page .underlined-link:hover {
  color: rgb(var(--color-link));
  text-decoration-thickness: 0.2rem;
}

/* Form fields used by the price range + sort controls */
.collection-page .field {
  position: relative;
  display: flex;
  width: 100%;
}

.collection-page .field__input,
.collection-page .select__select {
  -webkit-appearance: none;
  appearance: none;
  background-color: rgb(var(--color-background));
  color: rgb(var(--color-foreground));
  font-family: var(--font-body-family);
  font-size: 1.3rem;
  width: 100%;
  box-sizing: border-box;
  border: 0.1rem solid rgba(var(--color-foreground), 0.55);
  border-radius: 0;
  padding: 1.1rem 1.5rem;
  height: 4.5rem;
}

.collection-page .field__label {
  position: absolute;
  left: 1.5rem;
  top: 1.1rem;
  font-size: 1.3rem;
  pointer-events: none;
  transition: top 0.1s ease, font-size 0.1s ease;
}

.collection-page .field__input:focus ~ .field__label,
.collection-page .field__input:not(:placeholder-shown) ~ .field__label {
  top: 0.4rem;
  font-size: 1rem;
}

.collection-page .field__input:focus,
.collection-page .select__select:focus {
  outline: none;
  border-color: rgb(var(--color-foreground));
}

.collection-page .select {
  position: relative;
  display: flex;
}

.collection-page .select .svg-wrapper {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
}

.collection-page .icon-caret {
  width: 1rem;
  height: 0.6rem;
}

/* Hide the native disclosure triangle (live theme renders only its caret icon) */
.collection-page summary {
  list-style: none;
}

.collection-page summary::-webkit-details-marker {
  display: none;
}

.collection-page summary::marker {
  content: "";
}

/* Page-specific heading defaults (globals uses 1.3, live uses 1.08) */
.collection-page .collection-hero__title {
  font-size: 4rem;
  line-height: 1.08;
}

@media screen and (max-width: 749px) {
  .collection-page .collection-hero__title {
    font-size: 3rem;
  }

  .collection-page .collection-hero__title {
    margin: 2rem 0;
  }
}

/* Breakpoint helpers from Dawn's base.css */
@media screen and (min-width: 750px) {
  .collection-page .medium-hide {
    display: none !important;
  }
}

@media screen and (min-width: 990px) {
  .collection-page .large-up-hide {
    display: none !important;
  }
}

@media screen and (max-width: 749px) {
  .collection-page .small-hide {
    display: none !important;
  }
}

/* Keep the sidebar aligned with the live catalogue */
.collection-page .facets-vertical {
  display: flex;
  align-items: flex-start;
}

.collection-page .facets-wrapper {
  flex: 0 0 290px;
  width: 290px;
  padding-right: 30px;
  box-sizing: border-box;
}

.collection-page .product-grid-container {
  flex: 1 1 auto;
  min-width: 0;
}

@media screen and (max-width: 989px) {
  .collection-page .facets-wrapper {
    flex-basis: 240px;
    width: 240px;
    padding-right: 20px;
  }
}

@media screen and (max-width: 749px) {
  .collection-page .facets-vertical {
    display: block;
  }

  .collection-page .facets-wrapper {
    width: 100%;
    padding-right: 0;
  }
}

/* Filter apply affordance (live applies on change; keep a subtle control) */
.collection-page .collection-filter-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.3rem;
  border: 0.1rem solid rgba(var(--color-foreground), 0.3);
  background: transparent;
  color: rgb(var(--color-foreground));
  cursor: pointer;
}
