/* Opti Plaza: collection header, product grid, filters, sort and page links (own code).
   Loaded by main-collection-banner, main-collection-product-grid, main-search and featured-collection.
   Colours come from op-luxury.css tokens (--op-*), sizes from own-base.css (1rem = 10px). */

/* ---- campaign header (brand collections with editorial media) --------------------------------- */
.op-ed-hero {
  position: relative;
  overflow: hidden;
  height: 62vh;
  background-color: var(--op-ink, #141310);
}

.op-ed-hero__media,
.op-ed-hero__scrim,
.op-ed-hero__body {
  position: absolute;
  inset: 0;
}

.op-ed-hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.op-ed-hero__media img,
.op-ed-hero__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.op-ed-hero__scrim {
  z-index: 1;
  pointer-events: none;
  background-image: linear-gradient(to bottom, rgba(20, 19, 16, 0) 40%, rgba(20, 19, 16, 0.32) 68%, rgba(20, 19, 16, 0.74));
}

.op-ed-hero__body {
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding-bottom: 3rem;
}

.op-ed-hero__body > .page-width {
  width: 100%;
}

.op-ed-hero__title {
  margin: 0;
  font-family: var(--op-serif);
  font-weight: 400;
  font-size: clamp(3.6rem, 6.2vw, 7.2rem);
  line-height: 1.04;
  letter-spacing: 0.03em;
  color: var(--op-ivory, #faf9f6);
  text-shadow: 0 1px 28px rgba(20, 19, 16, 0.3);
  word-break: break-word;
}

.op-ed-hero__rule,
.own-coll-hero__rule {
  display: block;
  width: 5.6rem;
  height: 2px;
  margin-top: 1.6rem;
}

.op-ed-hero__rule {
  background-color: var(--op-ed-hero-accent, var(--op-gold, #b08a2e));
  box-shadow: 0 0 10px rgba(20, 19, 16, 0.45);
}

.op-ed-hero__crumbs {
  margin-top: 2rem;
}

/* ---- plain collection header ----------------------------------------------------------------- */
.own-coll-hero {
  color: rgba(20, 19, 16, 0.75);
  background-color: var(--op-ivory, #faf9f6);
}

.own-coll-hero__inner {
  padding-top: 5rem;
  padding-bottom: 1rem;
}

.own-coll-hero .collection-hero__title {
  margin: 2.5rem 0;
  font-size: clamp(3.2rem, 5.2vw, 5.6rem);
  line-height: 1.06;
  letter-spacing: 0.03em;
  color: var(--op-ink, #141310);
  word-break: break-word;
}

.own-coll-hero__rule {
  background-color: var(--op-gold, #b08a2e);
}

.own-coll-hero__desc {
  margin-top: 2rem;
  max-width: 72ch;
}

@media screen and (min-width: 750px) {
  .op-ed-hero {
    height: 66vh;
  }

  .op-ed-hero__body {
    padding-bottom: 4.8rem;
  }

  .op-ed-hero__rule,
  .own-coll-hero__rule {
    width: 7.2rem;
    margin-top: 2.2rem;
  }

  .own-coll-hero__inner {
    padding-bottom: 0;
  }
}

/* ---- grid section ------------------------------------------------------------------------------ */
.own-grid-section {
  padding-top: calc(var(--own-pt, 16px) * 0.75);
  padding-bottom: calc(var(--own-pb, 24px) * 0.75);
}

@media screen and (min-width: 750px) {
  .own-grid-section {
    padding-top: var(--own-pt, 16px);
    padding-bottom: var(--own-pb, 24px);
  }
}

.own-grid-wrap {
  position: relative;
}

.own-grid-wrap.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(250, 249, 246, 0.7);
}

.own-grid-wrap > .grid {
  margin: 1.5rem 0 2rem;
}

.own-grid-wrap > .grid:last-child {
  margin-bottom: 0;
}

@media screen and (min-width: 750px) {
  .own-grid-wrap > .grid {
    margin-top: 1.6rem;
  }
}

.own-grid-empty {
  margin: 10rem 0 15rem;
  text-align: center;
}

.own-grid-empty__title {
  margin: 0;
  color: var(--op-ink, #141310);
}

.own-grid-empty__title .of-link {
  display: inline-block;
  font-size: inherit;
}

/* ---- filter bar -------------------------------------------------------------------------------- */
.of-bar {
  display: grid;
  grid-template-columns: repeat(2, auto);
  column-gap: 2rem;
  align-items: start;
  padding-top: 1rem;
  border-bottom: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
}

.of-wide,
.of-sortform,
.of-pills--d,
.of-hform {
  display: none;
}

.of-count {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  font-size: 1.4rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: right;
  opacity: 0.7;
}

.of-count__text {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--op-ink, #141310);
}

.of-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  grid-column: 1 / -1;
}

.of-pills--m {
  margin: 0 -1.2rem -1.2rem;
}

.of-pills.of-pills--d {
  display: none;
}

.of-bar:not(.has-active) .of-pills--m {
  display: none;
}

.of-pill {
  display: block;
  padding: 1.2rem;
  color: var(--op-ink, #141310);
  text-decoration: none;
}

.of-pill__in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 1.9rem;
  padding: 0.3rem 1rem;
  border-radius: 2.6rem;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(20, 19, 16, 0.2);
}

.of-pill:hover .of-pill__in {
  box-shadow: 0 0 0 1px rgba(20, 19, 16, 0.55);
}

.of-pill .own-icon {
  flex: 0 0 auto;
  width: 0.8rem;
  height: 0.8rem;
}

.of-pills .of-pills__clear {
  margin-left: 1.2rem;
  padding: 1.2rem;
  font-size: 1rem;
  line-height: 1.8;
}

.of-pills__clear.is-empty {
  display: none;
}

@media screen and (min-width: 750px) {
  .of-pills--row .of-pill,
  .of-hform .of-pill {
    margin: 1.5rem 1.5rem 0 0;
    padding: 0 0.2rem;
  }

  .of-pills--row .of-pill__in,
  .of-hform .of-pill__in {
    padding: 0.5rem 1rem;
    font-size: 1.4rem;
  }

  .of-pills--row .of-pill .own-icon,
  .of-hform .of-pill .own-icon {
    width: 1rem;
    height: 1rem;
  }

  .of-pills--row .of-pills__clear.of-link,
  .of-hform .of-pills__clear.of-link {
    margin: 0;
    padding: 1.5rem 0 0;
    font-size: 1.4rem;
  }
}

.of-link {
  font-size: 1.4rem;
  color: rgba(20, 19, 16, 0.85);
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  cursor: pointer;
}

.of-link:hover {
  text-decoration-thickness: 0.2rem;
}

@media screen and (min-width: 750px) {
  .of-bar--drawer {
    display: flex;
    column-gap: 0;
    flex-wrap: wrap;
    align-items: center;
  }

  .of-bar--drawer .of-drawer {
    flex: 1 1 auto;
    margin-right: 2rem;
  }

  .of-bar--drawer .of-pills--m {
    display: none;
  }

  .of-bar--drawer .of-sortform {
    display: block;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
  }

  .of-bar--drawer .of-count--bar {
    align-self: center;
    margin: 0 0 0.5rem 3.5rem;
  }

  .of-bar--drawer .of-pills.of-pills--row {
    display: flex;
    flex: 0 0 100%;
    margin: -0.5rem 0 0.5rem;
    border-bottom: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
  }


  .of-phone {
    display: none;
  }

  .of-drawer .of-drawer__head {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .of-drawer .of-drawer__foot > .of-link,
  .of-drawer .of-sub__foot > .of-link {
    font-size: 1.6rem;
  }

  .of-wide {
    display: block;
  }
}

/* sort */
.of-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 3rem;
}

.of-sort__label {
  margin: 0 2rem 0 0;
  font-family: var(--op-sans);
  font-size: 1.4rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--op-ink, #141310);
}

.of-select {
  position: relative;
  display: flex;
  align-items: center;
}

.of-select__el {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0 1.75rem 0 0;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: rgba(20, 19, 16, 0.75);
  background: transparent;
  cursor: pointer;
}

.of-select__el:focus-visible {
  outline: 2px solid rgba(20, 19, 16, 0.5);
  outline-offset: 0.3rem;
}

.of-select .own-icon--caret {
  position: absolute;
  top: calc(50% - 0.2rem);
  right: 0;
  pointer-events: none;
}

.of-noscript-btn {
  margin-left: 1rem;
}

/* ---- drawer (filters, and sort on phones) ------------------------------------------------------ */
.of-drawer > summary {
  list-style: none;
}

.of-drawer > summary::-webkit-details-marker {
  display: none;
}

.of-drawer__open {
  display: flex;
  width: max-content;
  align-items: center;
  padding: 0.5rem 0;
  color: rgba(20, 19, 16, 0.85);
  cursor: pointer;
}

.of-drawer__open-label {
  margin-left: 1rem;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0.1rem;
}

.of-drawer__open:hover .of-drawer__open-label {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.of-drawer__shade {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(20, 19, 16, 0.5);
}

.of-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 5rem);
  max-width: 37.5rem;
  color: var(--op-ink, #141310);
  background-color: var(--op-ivory, #faf9f6);
  border-left: 1px solid rgba(20, 19, 16, 0.1);
  animation: of-slide-in 0.25s var(--ease, ease);
}

.of-drawer__shade {
  animation: of-fade-in 0.2s var(--ease, ease);
}

@keyframes of-slide-in {
  from { transform: translateX(100%); }
}

@keyframes of-fade-in {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .of-drawer__panel,
  .of-drawer__shade {
    animation: none;
  }
}

.of-drawer__head {
  position: relative;
  padding: 1rem 5.5rem 1rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
}

.of-drawer__title {
  margin: 0;
  padding-left: 3rem;
  font-size: 1.4rem;
  line-height: 1.14;
  letter-spacing: 0.005em;
}

.of-drawer__count {
  margin: 0;
  padding-left: 3rem;
  font-size: 1.3rem;
  line-height: 1.72;
  color: rgba(20, 19, 16, 0.7);
}

.of-drawer__x {
  position: absolute;
  top: 50%;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  transform: translateY(-50%);
}

.of-drawer__x .own-icon {
  width: 2.2rem;
  height: 2.2rem;
}

.of-drawer__body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-top: 2.7rem;
}

.of-sub > summary {
  list-style: none;
}

.of-sub > summary::-webkit-details-marker {
  display: none;
}

.of-sub__open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 2.5rem;
  font-size: 1.6rem;
  line-height: 1.8;
  cursor: pointer;
}

.of-sub__open:hover span {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.of-sub__panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background-color: var(--op-ivory, #faf9f6);
  overflow-y: auto;
}

.of-sub__back {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1.2rem 2.5rem;
  border: 0;
  font: inherit;
  font-size: 1.6rem;
  color: inherit;
  text-align: left;
  background: none;
  cursor: pointer;
}

.of-sub__info {
  margin: 0;
  padding: 1rem 2.5rem;
  font-size: 1.4rem;
  color: rgba(20, 19, 16, 0.75);
}

.of-sub__foot,
.of-drawer__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  margin-top: auto;
  padding: 2rem;
  border-top: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
  background-color: var(--op-ivory, #faf9f6);
}

.of-sub__foot > .of-link,
.of-drawer__foot > .of-link {
  font-size: 1.5rem;
  flex: 1 1 50%;
  text-align: center;
}

.of-apply {
  flex: 1 1 50%;
  min-height: 5.2rem;
  margin-left: 1rem;
  padding: 0 3rem;
  border: 0;
  font: inherit;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--op-ivory, #faf9f6);
  background-color: var(--op-ink, #141310);
  cursor: pointer;
}

.of-drawer__sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 2.5rem;
  font-size: 1.6rem;
}

.of-drawer__sort .of-select__el {
  font-size: 1.2rem;
  padding-right: 3rem;
}

@media screen and (min-width: 750px) {
  .of-drawer__sort {
    display: none;
  }
}

/* checkbox rows */
.of-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.of-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 1.4rem 2rem 1.4rem 2.5rem;
  font-size: 1.6rem;
  line-height: 1.3;
  cursor: pointer;
  word-break: break-word;
}

.of-check input {
  position: absolute;
  top: 1.5rem;
  left: 2.5rem;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  opacity: 0;
}

.of-check__box {
  flex: 0 0 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0.2rem 1.2rem 0 0;
  border: 1px solid rgba(20, 19, 16, 0.55);
  color: var(--op-ink, #141310);
}

.of-check__box .own-icon {
  width: 1rem;
  height: 0.9rem;
  opacity: 0;
}

.of-check input:checked + .of-check__box .own-icon {
  opacity: 1;
}

.of-check input:focus-visible + .of-check__box {
  outline: 2px solid rgba(20, 19, 16, 0.5);
  outline-offset: 2px;
}

.of-check:hover > span[aria-hidden] {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.of-check.is-disabled {
  opacity: 0.45;
  cursor: default;
}

/* price range */
.of-price {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2.5rem 2rem;
}

.of-price__cur {
  font-size: 1.4rem;
}

.of-field {
  position: relative;
  flex: 1 1 auto;
}

.of-field__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4.5rem;
  padding: 2.2rem 1.2rem 0.8rem;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 1.4rem;
  color: var(--op-ink, #141310);
  background: var(--op-ivory, #faf9f6);
  box-shadow: inset 0 0 0 1px rgba(20, 19, 16, 0.55);
  -moz-appearance: textfield;
}

.of-field__input::-webkit-outer-spin-button,
.of-field__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.of-field__label {
  position: absolute;
  top: 0.4rem;
  left: 1.2rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: rgba(20, 19, 16, 0.75);
  pointer-events: none;
}

/* ---- horizontal filters (search page, desktop) -------------------------------------------------- */
@media screen and (min-width: 750px) {
  .of-bar--horizontal {
    display: block;
  }

  .of-bar--horizontal .of-drawer--phone,
  .of-bar--horizontal .of-pills--m,
  .of-bar--horizontal .of-count--phone {
    display: none;
  }

  .of-hform {
    display: grid;
    grid-template-columns: 1fr max-content max-content;
    column-gap: 3.5rem;
    align-items: start;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--op-hairline-soft, rgba(20, 19, 16, 0.08));
  }

  .of-hform__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    grid-column: 1;
  }

  .of-hform__label {
    margin: -0.2rem 2rem 0 0;
    font-family: var(--op-sans);
    font-size: 1.4rem;
    line-height: 1.5;
    letter-spacing: 0.04rem;
    color: rgba(20, 19, 16, 0.85);
  }

  .of-hform .of-pills.of-pills--d {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    margin: -0.5rem 0 0;
  }

  .of-bar--horizontal:not(.has-active) .of-pills.of-pills--d {
    display: none;
  }

  .of-hform .of-sort {
    grid-column: 2;
    grid-row: 1;
  }

  .of-hform .of-count {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }
}

.of-dd {
  position: relative;
  margin-right: 3.5rem;
}

.of-dd > summary {
  list-style: none;
}

.of-dd > summary::-webkit-details-marker {
  display: none;
}

.of-dd__summary {
  position: relative;
  display: block;
  margin-bottom: 1.5rem;
  padding-right: 1.75rem;
  font-size: 1.2rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: rgba(20, 19, 16, 0.75);
  cursor: pointer;
}

.of-dd__summary .own-icon--caret {
  position: absolute;
  top: calc(50% - 0.2rem);
  right: 0;
}

.of-dd__summary:hover span {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.of-dd[open] .own-icon--caret {
  transform: rotate(180deg);
}

.of-dd__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: -1.2rem;
  z-index: 3;
  width: 35rem;
  max-height: 55rem;
  overflow-y: auto;
  background-color: var(--op-ivory, #faf9f6);
  border: 1px solid rgba(20, 19, 16, 0.1);
}

.of-dd__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  font-size: 1.4rem;
  line-height: 1.8;
  background-color: var(--op-ivory, #faf9f6);
  border-bottom: 1px solid rgba(20, 19, 16, 0.2);
}

.of-dd__fieldset {
  margin: 0;
  padding: 0.5rem 0;
  border: 0;
}

.of-dd .of-check {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  line-height: 1.5;
}

.of-dd .of-check input {
  top: 1rem;
  left: 2rem;
}

.of-dd .of-price {
  padding: 2rem;
}

/* ---- scroll lock while a drawer is open --------------------------------------------------------- */
html.of-lock,
html.of-lock body {
  overflow: hidden;
}
