/* ==========================================================================
   MakHome: browse.css
   Grouped product browsing (collection pages + catalog): filter chips,
   sticky category bar, category groups, model cards.
   Loaded after studio.css on collection pages and the catalog.
   ========================================================================== */

.mh-browse { padding: var(--mh-section-y) 0; }
.mh-browse [hidden] { display: none !important; }

/* ---------- head: title, lead, filter row ---------- */
.mh-browse__head { margin-bottom: clamp(28px, 3.4vw, 48px); }
.mh-browse__lead { margin-top: .9em; max-width: 52ch; font-size: clamp(1rem, 1.15vw, 1.1rem); line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }

.mh-filter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px 22px; margin-top: clamp(24px, 3vw, 36px); padding-top: clamp(18px, 2vw, 24px); border-top: 1px solid var(--line); }
.mh-filter__label { padding-top: .95em; font-weight: 500; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.mh-filter__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mh-filter__more { grid-column: 2; width: fit-content; margin-top: 4px; font-size: .92rem; }

.mh-chip { display: inline-flex; align-items: center; gap: .55em; min-height: 40px; padding: .55em 1em; font: inherit; font-weight: 500; font-size: .88rem; letter-spacing: .01em; line-height: 1.2; color: var(--fg-2); background: transparent; border: 1px solid var(--line); border-radius: 0; cursor: pointer; transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease); }
.mh-chip:hover { color: var(--fg); border-color: var(--line-strong); }
.mh-chip:active { transform: translateY(1px); }
.mh-chip.is-active { color: var(--paper); background: var(--fg); border-color: var(--fg); }
.mh-chip__dots { display: inline-flex; }
.mh-chip__dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--paper), inset 0 0 0 1px rgba(0,0,0,.14); }
.mh-chip__dots i + i { margin-left: -4px; }
.mh-chip.is-active .mh-chip__dots i { box-shadow: 0 0 0 1.5px var(--fg), inset 0 0 0 1px rgba(255,255,255,.2); }

@media (max-width: 640px) {
  .mh-filter { grid-template-columns: 1fr; gap: 10px; }
  .mh-filter__label { padding-top: 0; }
  .mh-filter__more { grid-column: 1; }
  /* one swipeable row instead of a tall wrap of chips */
  .mh-filter__chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .mh-filter__chips::-webkit-scrollbar { display: none; }
  .mh-chip { flex: none; scroll-snap-align: start; }
}

/* ---------- sticky category bar ---------- */
.mh-browse__sentinel { height: 1px; margin-bottom: -1px; }
.mh-browse__bar { position: sticky; top: var(--nav-h); z-index: 30; background: rgba(243,243,240,.86); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: top .5s var(--ease), box-shadow .4s var(--ease); }
body.admin-bar .mh-browse__bar { top: calc(var(--nav-h) + 32px); }
body:has(.mhs-header.mh-header--hidden) .mh-browse__bar { top: 0; }
body.admin-bar:has(.mhs-header.mh-header--hidden) .mh-browse__bar { top: 32px; }
.mh-browse__bar.is-stuck { box-shadow: 0 12px 28px -18px rgba(10,10,11,.35); }
.mh-browse__tabs { display: flex; align-items: stretch; gap: clamp(20px, 2.6vw, 40px); height: 56px; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.mh-browse__tabs::-webkit-scrollbar { display: none; }
.mh-tab { position: relative; display: inline-flex; align-items: center; flex: none; white-space: nowrap; font-weight: 500; font-size: .93rem; letter-spacing: .005em; color: var(--fg-2); transition: color .25s var(--ease); }
.mh-tab sup { margin-left: .35em; font-size: .66rem; font-weight: 500; color: var(--fg-3); top: -.55em; font-variant-numeric: tabular-nums; }
.mh-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.mh-tab:hover { color: var(--fg); }
.mh-tab.is-active { color: var(--fg); }
.mh-tab.is-active::after { transform: scaleX(1); }
@media (max-width: 782px) { body.admin-bar .mh-browse__bar { top: calc(var(--nav-h) + 46px); } body.admin-bar:has(.mhs-header.mh-header--hidden) .mh-browse__bar { top: 0; } }
@media (max-width: 640px) { .mh-browse__tabs { height: 50px; gap: 22px; } .mh-tab { font-size: .88rem; } }

/* ---------- category groups ---------- */
.mh-group { padding-top: clamp(44px, 5.4vw, 84px); scroll-margin-top: calc(var(--nav-h) + 72px); }
.mh-browse__groups > .mh-group:first-child { padding-top: clamp(28px, 3vw, 44px); }
.mh-group__head { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(18px, 2vw, 28px); }
.mh-group__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); color: var(--fg); }
.mh-group__icon svg { width: 22px; height: 22px; stroke-width: 1.5; }
.mh-group__title { font-weight: 700; font-size: clamp(1.45rem, 2.3vw, 2.05rem); letter-spacing: -.025em; line-height: 1.05; color: var(--fg); text-wrap: balance; }
.mh-group__count { margin-left: auto; padding-left: 16px; font-size: .88rem; color: var(--fg-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mh-group__more { margin-top: clamp(22px, 2.4vw, 32px); }
.mh-group__more .mhs-btn { min-width: 220px; justify-content: center; }
.mh-browse__empty { padding-top: 48px; color: var(--fg-2); }
.mh-browse__empty .mhs-link { font: inherit; font-weight: 500; background: none; border-width: 0 0 1px; cursor: pointer; padding: 0 0 .1em; }
@media (max-width: 640px) {
  .mh-group__icon { width: 38px; height: 38px; }
  .mh-group__icon svg { width: 19px; height: 19px; }
  .mh-group__count { font-size: .8rem; }
}

/* ---------- grids ---------- */
.mhs-products.mh-grid { row-gap: clamp(26px, 2.6vw, 40px); }
.mhs-products.mh-grid--sets { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1700px) { .mhs-products.mh-grid--sets { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .mhs-products.mh-grid--sets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .mhs-products.mh-grid--sets { grid-template-columns: 1fr; } }

/* ---------- model card ---------- */
.mh-card { display: flex; flex-direction: column; }
.mh-card[hidden] { display: none !important; }
.mh-card .mh-card__media { position: relative; aspect-ratio: 4 / 5; margin-bottom: 14px; background: #e6e5e0; }
.mh-card--set .mh-card__media { aspect-ratio: 4 / 3; }
.mh-card .mh-card__media > a { position: absolute; inset: 0; display: block; }
.mh-card .mh-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mh-card__ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(10,10,11,.2); background: linear-gradient(160deg, #ebeae5, #e2e1db); transition: color .4s var(--ease); }
.mh-card__ph svg { width: 44px; height: 44px; stroke-width: 1.2; }
.mh-card:hover .mh-card__ph { color: rgba(10,10,11,.36); }
.mh-card__media.is-empty img, .mh-card__media:not(.is-empty) .mh-card__ph { display: none; }

.mh-card .fc-product-card__content { display: block; padding: 0 2px; }
.mh-card .fc-product-card__title { font-weight: 500; font-size: 1rem; letter-spacing: -.01em; line-height: 1.28; margin: 0; color: var(--fg); text-wrap: pretty; }
.mh-card--set .fc-product-card__title { font-size: clamp(1.02rem, 1.2vw, 1.15rem); }
.mh-card__meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 6px 0 0; }
.mh-card .mh-card__price { font-size: .92rem; color: var(--fg-2); margin: 0; font-variant-numeric: tabular-nums; }
.mh-card .mh-card__price.is-quote { font-size: .84rem; color: var(--fg-3); }
.mh-card__orig { margin-right: .4em; color: var(--fg-3); font-size: .86em; }
.mh-card__decors { font-size: .78rem; letter-spacing: .01em; color: var(--fg-3); white-space: nowrap; }

/* ---------- facts as a row (collection without intro copy) ---------- */
.mh-col-facts { padding: clamp(40px, 5vw, 72px) 0 0; }
.mhs-facts--row { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.mhs-facts--row div { display: flex; flex-direction: column; align-items: flex-start; gap: .55em; padding: clamp(18px, 2.2vw, 28px) clamp(14px, 2vw, 28px) clamp(18px, 2.2vw, 28px) 0; border-bottom: 0; }
.mhs-facts--row div + div { padding-left: clamp(14px, 2vw, 28px); border-left: 1px solid var(--line); }
.mhs-facts--row div > span { text-align: left; max-width: none; }
@media (max-width: 700px) {
  .mhs-facts--row { grid-template-columns: 1fr 1fr; }
  .mhs-facts--row div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .mhs-facts--row div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- collection intro ---------- */
.mh-col-intro .mhs-h-xl + .mh-col-intro__text { margin-top: clamp(20px, 2.4vw, 32px); }
.mh-col-intro__text { max-width: 58ch; }

/* ---------- USPs: one hairline row, no cards ---------- */
.mh-usps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mh-usps li { display: flex; gap: 16px; align-items: flex-start; padding: clamp(22px, 2.6vw, 34px) clamp(16px, 2.4vw, 36px) clamp(22px, 2.6vw, 34px) 0; }
.mh-usps li + li { padding-left: clamp(16px, 2.4vw, 36px); border-left: 1px solid var(--line); }
.mh-usps__icon { flex: none; color: var(--red); padding-top: 2px; }
.mh-usps__icon svg { width: 22px; height: 22px; stroke-width: 1.5; }
.mh-usps h3 { font-weight: 500; font-size: 1.05rem; letter-spacing: -.01em; color: var(--fg); line-height: 1.25; }
.mh-usps p { margin-top: .35em; font-size: .92rem; line-height: 1.5; color: var(--fg-2); max-width: 34ch; }
@media (max-width: 860px) {
  .mh-usps { grid-template-columns: 1fr; }
  .mh-usps li, .mh-usps li + li { padding: 20px 0; border-left: 0; }
  .mh-usps li + li { border-top: 1px solid var(--line); }
}

/* ---------- collection tiles without a photo ---------- */
.mhs-tile--blank { background: linear-gradient(150deg, #1d1d21, #111113 70%); }
.mhs-tile--blank::after { opacity: 0; }
.mhs-tile--blank::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 72px); pointer-events: none; }

/* ---------- hero without imagery ---------- */
.mhs-hero--bare { height: auto; min-height: 0; max-height: none; padding-top: calc(var(--nav-h) + clamp(96px, 16vh, 180px)); background: linear-gradient(160deg, #18181b, var(--ink) 65%); }
.mhs-hero--bare .mhs-hero__in { position: relative; }
.mhs-hero--bare::after { background: none; }

/* ---------- gallery: odd last tile spans the row on 2-col layouts ---------- */
@media (max-width: 900px) { .mhs-gallery a:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 8 / 3; } }

@media (prefers-reduced-motion: reduce) {
  .mh-browse__bar, .mh-tab::after, .mh-chip { transition: none; }
}

/* ---------- whole card is clickable ---------- */
.mh-card { position: relative; }
.mh-card .fc-product-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.mh-card .fc-product-card__title a:focus-visible { outline: 0; }
.mh-card:has(.fc-product-card__title a:focus-visible) { outline: 2px solid var(--red); outline-offset: 4px; }

/* ---------- categories with no photography yet: compact spec tiles instead of grey boxes ---------- */
.mh-group.is-noimg .mhs-products.mh-grid { gap: 4px; }
.mh-group.is-noimg .mh-card { justify-content: space-between; min-height: clamp(170px, 14vw, 210px); padding: 20px 20px 18px; background: #e9e8e2; transition: background .35s var(--ease); }
.mh-group.is-noimg .mh-card:hover { background: #e1e0d9; }
.mh-group.is-noimg .mh-card .mh-card__media { width: 46px; height: 46px; aspect-ratio: auto; margin: 0 0 22px; background: transparent; border: 1px solid var(--line-strong); }
.mh-group.is-noimg .mh-card__ph { background: none; color: var(--fg); }
.mh-group.is-noimg .mh-card__ph svg { width: 22px; height: 22px; stroke-width: 1.5; }
.mh-group.is-noimg .mh-card .fc-product-card__content { padding: 0; }
.mh-group.is-noimg .mh-card .fc-product-card__title { font-size: 1.02rem; }
.mh-group.is-noimg .mh-card .fc-product-card__title a { background: none; }
.mh-group.is-noimg .mh-card__meta { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .mh-group.is-noimg .mh-card { min-height: 0; padding: 16px 14px 14px; }
  .mh-group.is-noimg .mh-card .mh-card__media { width: 38px; height: 38px; margin-bottom: 16px; }
}

/* ---------- odd number of collection tiles: last one spans the row ---------- */
.mhs-collections > .mhs-tile:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 4 / 1; }
@media (max-width: 700px) { .mhs-collections > .mhs-tile:last-child:nth-child(odd) { aspect-ratio: 16 / 10; } }

/* ---------- catalog: back link under a single category ---------- */
.mh-browse__back { padding-bottom: var(--mh-section-y); margin-top: calc(-1 * var(--mh-section-y) + 40px); }


/* one decor page: a wide tile inside the page gutters instead of a lone narrow tile */
.mh-decor-single .mhs-head { padding: 0 var(--gutter); }
.mh-decor-single__list { padding: 0 var(--gutter); }
.mh-decor-single__list .mhs-tile--wide { aspect-ratio: 21 / 8; min-height: 360px; }
@media (max-width: 700px) { .mh-decor-single__list .mhs-tile--wide { aspect-ratio: 4 / 5; min-height: 0; } }

/* ---------- collection intro: editorial split (copy + numbers left, a photo with the collection's palette right) ---------- */
.mh-intro { padding-top: clamp(64px, 8vw, 128px); padding-bottom: clamp(64px, 8vw, 128px); }
.mh-intro__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(32px, 6vw, 112px); }
.mh-intro__title { font-weight: 700; font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: .98; letter-spacing: -.035em; color: var(--fg); text-wrap: balance; }
.mh-intro__title span { display: block; margin-top: .06em; font-weight: 400; color: var(--fg-2); }
.mh-intro__text { margin-top: clamp(22px, 2.6vw, 34px); max-width: 54ch; font-size: clamp(1.02rem, 1.15vw, 1.14rem); line-height: 1.6; color: var(--fg-2); text-wrap: pretty; }
.mh-intro__text p + p { margin-top: 1em; }
.mh-intro__facts { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: clamp(30px, 3.6vw, 48px) 0 0; border-top: 1px solid var(--line); }
.mh-intro__facts div { padding: 18px 16px 0 0; }
.mh-intro__facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.mh-intro__facts dt { font-weight: 700; font-size: clamp(1.9rem, 3vw, 2.9rem); line-height: 1; letter-spacing: -.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.mh-intro__facts dd { margin: .55em 0 0; font-size: .86rem; line-height: 1.35; color: var(--fg-2); }
.mh-intro__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: clamp(28px, 3vw, 40px); }
.mh-intro__media { position: relative; margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--slate); }
.mh-intro__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.4s var(--ease); }
.mh-intro__media:hover img { transform: scale(1.05); }
.mh-intro__palette { position: absolute; left: clamp(14px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); max-width: calc(100% - 28px); padding: 14px 16px 16px; }
.mh-intro__dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mh-intro__dots i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.mh-intro__dots i.is-empty { background: rgba(255,255,255,.16); }
.mh-intro__names { display: block; margin-top: 10px; font-size: .84rem; line-height: 1.4; color: rgba(255,255,255,.8); }
@media (max-width: 900px) {
  .mh-intro__grid { grid-template-columns: 1fr; }
  .mh-intro__media { aspect-ratio: 4 / 3; }
}
@media (max-width: 600px) {
  .mh-intro__facts { grid-template-columns: 1fr 1fr; }
  .mh-intro__facts div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .mh-intro__facts div:nth-child(n+3) { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mh-intro__media img { transition: none; } }
.mh-intro__lead { max-width: 40ch; font-weight: 500; font-size: clamp(1.3rem, 1.9vw, 1.75rem); line-height: 1.3; letter-spacing: -.02em; color: var(--fg); text-wrap: pretty; }
.mh-intro__feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: clamp(22px, 2.6vw, 32px) 0 0; padding: 0; list-style: none; }
.mh-intro__feats li { padding: 12px 0 12px 18px; border-top: 1px solid var(--line); position: relative; font-size: .95rem; line-height: 1.45; color: var(--fg-2); }
.mh-intro__feats li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 8px; height: 1px; background: var(--red); }
@media (max-width: 600px) { .mh-intro__feats { grid-template-columns: 1fr; } }
