/*
 * Maison Index
 * A continuous mood-to-fragrance surface: the active edit stays reachable,
 * product results remain visible, and changing mood never loses scroll place.
 */

.maison-index {
  padding-top: 76px;
  padding-bottom: 112px;
  background: #fbfaf7;
}

.maison-index-heading {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  align-items: end;
  gap: 7vw;
  margin: 0 3vw 38px;
}

.maison-index-heading .eyebrow {
  margin-bottom: 12px;
  color: #71675e;
}

.maison-index-heading h2 {
  margin: 0;
  letter-spacing: -0.052em;
  font-size: clamp(58px, 5.5vw, 84px);
  line-height: 0.92;
}

.maison-index-heading > p {
  max-width: 390px;
  margin: 0 0 4px;
  color: #5d554d;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
}

.maison-index .mood-grid {
  position: sticky;
  z-index: 38;
  top: var(--header-compact-height);
  display: block;
  margin: 0 3vw;
  border: 0;
  scroll-margin-top: calc(var(--header-compact-height) + 12px);
  box-shadow: 0 12px 28px rgba(21, 18, 15, 0);
  transition: box-shadow 0.25s ease;
}

.mood-index-bar {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 84px;
  padding: 13px 22px;
  background: #15120f;
  color: #f8f5ef;
  text-align: left;
  cursor: pointer;
}

.mood-index-number {
  align-self: start;
  padding-top: 2px;
  color: #b28d58;
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.mood-index-current {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 18px;
  min-width: 0;
}

.mood-index-current strong {
  font-family: var(--serif);
  font-size: clamp(27px, 2.5vw, 36px);
  font-weight: 400;
  line-height: 0.95;
}

.mood-index-current small {
  color: #c2bab1;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: var(--sans);
  font-size: 8px;
}

.mood-index-current > span {
  grid-column: 1 / -1;
  color: #bbb2a9;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.3;
}

.mood-index-change {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-left: 26px;
  color: #c09b63;
  font-family: var(--serif);
  font-size: 14px;
  white-space: nowrap;
}

.mood-index-change img {
  width: 22px;
  height: 22px;
  filter: brightness(0) saturate(100%) invert(62%) sepia(25%) saturate(845%) hue-rotate(359deg) brightness(89%) contrast(86%);
  transition: transform 0.2s ease;
}

.mood-index-bar:hover .mood-index-change img {
  transform: translateY(3px);
}

.mood-index-bar:focus-visible {
  outline: 2px solid #c09b63;
  outline-offset: -6px;
}

.maison-index .fragrance-toolbar {
  margin: 24px 3vw 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--stone);
}

.maison-index .gender-filter-wrap > span,
.maison-index .result-summary p,
.maison-index .result-summary button {
  font-size: 9px;
}

.maison-index .filters button {
  min-height: 38px;
  padding: 10px 16px;
  font-size: 9px;
}

.maison-index .product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.35vw, 20px);
  margin: 0 3vw;
  border: 0;
}

.maison-index .index-product {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ddd6cc;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(54, 41, 30, 0.04);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.maison-index .index-product:hover {
  border-color: #cfc2b1;
  box-shadow: 0 14px 32px rgba(54, 41, 30, 0.075);
  transform: translateY(-3px);
}

.index-product-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
}

.index-product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.72, 0.25, 1);
}

.index-product:hover .index-product-visual img,
.index-product-visual:focus-visible img {
  transform: scale(1.025);
}

.index-product-visual:focus-visible {
  outline: 2px solid #8f6d3f;
  outline-offset: -5px;
}

.maison-index .index-product-info {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  min-height: 190px;
  padding: 18px 18px 17px;
}

.index-product-number {
  position: absolute;
  top: 18px;
  right: 18px;
  margin: 0;
  color: #a37f4f;
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
}

.maison-index .index-product-info h3 {
  align-self: flex-start;
  margin: 0;
  padding-right: 34px;
  letter-spacing: -0.025em;
  font-family: var(--sans);
  font-size: clamp(24px, 2vw, 31px);
  font-weight: 500;
  line-height: 0.96;
}

.index-product-gender {
  order: -1;
  margin: 0 0 12px;
  color: #8a755c;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--sans);
  font-size: 8px;
  font-style: normal;
}

.index-product-mood {
  margin: 12px 0 0;
  color: #746c64;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.4;
}

.index-product-notes {
  margin: 5px 0 0;
  color: #675f57;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 8px;
  line-height: 1.5;
}

.index-product-discover {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 39px;
  margin-top: auto;
  padding: 15px 0 0;
  border-top: 1px solid #ded4c8;
  background: transparent;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-family: var(--sans);
  font-size: 8px;
  cursor: pointer;
}

.index-product-discover span {
  border: 0;
  padding: 0;
}

.index-product-discover img {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.index-product-discover:hover img,
.index-product-discover:focus-visible img {
  transform: translateX(5px);
}

.index-product-discover:focus-visible {
  outline: 2px solid #8f6d3f;
  outline-offset: 6px;
}

.maison-index .fragrance-empty {
  border-bottom: 1px solid var(--stone);
}

.mood-sheet-backdrop {
  position: fixed;
  z-index: 118;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 10, 8, 0.56);
  cursor: default;
  animation: mood-fade 0.22s ease both;
}

.mood-sheet {
  position: fixed;
  z-index: 120;
  right: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100% - 32px));
  max-height: min(82vh, 780px);
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: #f8f5ef;
  box-shadow: 0 -24px 70px rgba(17, 13, 9, 0.24);
  transform: translateX(50%);
  animation: mood-sheet-in 0.34s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.mood-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 34px 24px;
  border-bottom: 1px solid var(--stone);
  background: #f8f5ef;
}

.mood-sheet-head .eyebrow {
  margin-bottom: 8px;
  color: #877d72;
}

.mood-sheet-head h2 {
  margin: 0;
  letter-spacing: -0.04em;
  font-size: 48px;
  line-height: 0.95;
}

.mood-sheet-head > button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--stone);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.mood-sheet-head > button img {
  width: 20px;
  height: 20px;
}

.mood-sheet-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 28px;
}

.mood-sheet-option {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 13px 34px;
  border-bottom: 1px solid #cec5ba;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mood-sheet-option > span {
  color: #aa8554;
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
}

.mood-sheet-option strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.05;
}

.mood-sheet-option small {
  color: #776e65;
  font-family: var(--serif);
  font-size: 15px;
  white-space: nowrap;
}

.mood-sheet-option > img {
  width: 19px;
  height: 19px;
  filter: brightness(0) saturate(100%) invert(54%) sepia(32%) saturate(654%) hue-rotate(357deg) brightness(92%) contrast(88%);
}

.mood-sheet-option:hover,
.mood-sheet-option.active {
  background: #f1eadf;
}

.mood-sheet-option:focus-visible,
.mood-sheet-head > button:focus-visible {
  outline: 2px solid #8f6d3f;
  outline-offset: -3px;
}

@keyframes mood-fade {
  from { opacity: 0; }
}

@keyframes mood-sheet-in {
  from { transform: translate(50%, 100%); }
  to { transform: translate(50%, 0); }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .maison-index .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .maison-index .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .maison-index .index-product-info h3 {
    font-size: clamp(24px, 4vw, 31px);
  }
}

@media (max-width: 700px) {
  .maison-index {
    padding: 44px 12px 82px;
  }

  .maison-index-heading {
    display: block;
    margin: 0 8px 22px;
  }

  .maison-index-heading .eyebrow {
    margin-bottom: 7px;
    font-size: 8px;
  }

  .maison-index-heading h2 {
    font-size: clamp(38px, 11.2vw, 48px);
    line-height: 0.92;
  }

  .maison-index-heading > p {
    display: none;
  }

  .maison-index .mood-grid {
    margin: 0 -12px;
  }

  .mood-index-bar {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    min-height: 72px;
    padding: 10px 14px 10px 12px;
  }

  .mood-index-number {
    padding-top: 1px;
    font-size: 11px;
  }

  .mood-index-current {
    display: block;
  }

  .mood-index-current strong {
    display: block;
    max-width: none;
    font-size: clamp(21px, 6vw, 24px);
    line-height: 0.98;
    white-space: nowrap;
  }

  .mood-index-current small {
    display: block;
    margin-top: 3px;
    letter-spacing: 0.12em;
    font-size: 6px;
  }

  .mood-index-current > span {
    display: none;
  }

  .mood-index-change {
    gap: 6px;
    margin-left: 8px;
    font-size: 11px;
  }

  .mood-index-change img {
    width: 15px;
    height: 15px;
  }

  .maison-index .fragrance-toolbar {
    display: block;
    margin: 12px 4px 0;
    padding-bottom: 11px;
  }

  .maison-index .gender-filter-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .maison-index .gender-filter-wrap .filters {
    width: auto;
    margin: 0;
  }

  .maison-index .filters button,
  .maison-index .gender-filter-wrap .filters button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 7px;
  }

  .maison-index .result-summary {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
  }

  .maison-index .result-summary p,
  .maison-index .result-summary button,
  .maison-index .gender-filter-wrap > span {
    font-size: 7px;
  }

  .maison-index .product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 4px;
  }

  .maison-index .index-product {
    display: flex;
    min-height: 0;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(54, 41, 30, 0.045);
  }

  .index-product-visual {
    align-self: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
  }

  .maison-index .index-product-info {
    min-height: 152px;
    padding: 13px 11px 12px;
  }

  .index-product-number {
    top: 13px;
    right: 11px;
    font-size: 9px;
  }

  .maison-index .index-product-info h3 {
    max-width: 100%;
    padding-right: 24px;
    font-size: clamp(17px, 4.9vw, 21px);
    line-height: 0.98;
  }

  .index-product-gender {
    margin: 0 0 8px;
    font-size: 6.5px;
  }

  .index-product-mood {
    margin-top: 8px;
    font-size: 10.5px;
    line-height: 1.35;
  }

  .index-product-notes {
    display: none;
  }

  .index-product-discover {
    gap: 9px;
    min-height: 32px;
    margin-top: auto;
    padding-top: 11px;
    font-size: 7px;
  }

  .index-product-discover img {
    width: 16px;
    height: 16px;
  }

  .mood-sheet {
    width: 100%;
    max-height: 84vh;
    border-radius: 24px 24px 0 0;
  }

  .mood-sheet-head {
    padding: 24px 20px 18px;
  }

  .mood-sheet-head .eyebrow {
    font-size: 8px;
  }

  .mood-sheet-head h2 {
    font-size: 37px;
  }

  .mood-sheet-head > button {
    width: 40px;
    height: 40px;
  }

  .mood-sheet-list {
    padding: 0 0 calc(22px + env(safe-area-inset-bottom));
  }

  .mood-sheet-option {
    grid-template-columns: 34px minmax(0, 1fr) auto 19px;
    gap: 9px;
    min-height: 66px;
    padding: 10px 20px;
  }

  .mood-sheet-option > span {
    font-size: 13px;
  }

  .mood-sheet-option strong {
    font-size: clamp(19px, 5.8vw, 24px);
  }

  .mood-sheet-option small {
    font-size: 11px;
  }

  .mood-sheet-option > img {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 370px) {
  .mood-index-change {
    max-width: 56px;
    white-space: normal;
    line-height: 1.15;
  }

  .mood-index-current strong {
    font-size: 25px;
  }

  .maison-index .index-product-info {
    min-height: 172px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .maison-index .index-product-info h3 {
    font-size: 21px;
  }

  .mood-sheet-option small {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maison-index .index-product,
  .mood-index-change img,
  .index-product-visual img,
  .index-product-discover img,
  .mood-sheet,
  .mood-sheet-backdrop {
    transition: none;
    animation: none;
  }
}
