/* CHIC · Shop page refinements
   - Reworked "Shop by color" section (3 large photographic tiles)
   - Cleaner collection filter bar (labeled groups, hairline pills, better hierarchy)
*/

/* ============ Header spacing ============ */
.plp-header-refined {
 padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 3vw, 3rem);
 border-bottom: 1px solid var(--color-divider);
 margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
 text-align: center;
}
.plp-header-refined .eyebrow {
 font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
 color: var(--color-text-muted);
}
.plp-header-refined h1 {
 font-family: var(--font-display);
 font-size: clamp(2.5rem, 5vw, 4rem);
 font-weight: 400;
 letter-spacing: -0.015em;
 line-height: 1.02;
 margin: 0.75rem 0 1rem;
}
.plp-header-refined p {
 color: var(--color-text-muted);
 max-width: 62ch;
 margin: 0 auto 2rem;
 font-size: 1.0625rem;
 line-height: 1.55;
}

/* Gender toggle — segmented, larger, with hairline */
.gender-toggle-refined {
 display: inline-flex;
 gap: 0;
 padding: 4px;
 background: var(--color-surface);
 border: 1px solid var(--color-divider);
 border-radius: 999px;
}
.gender-toggle-refined button {
 padding: 0.65rem 1.4rem;
 background: transparent;
 border: none;
 border-radius: 999px;
 font-family: var(--font-body);
 font-size: 0.8125rem;
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--color-text-muted);
 cursor: pointer;
 transition: background 220ms ease, color 220ms ease;
}
.gender-toggle-refined button:hover { color: var(--color-text); }
.gender-toggle-refined button.is-active {
 background: var(--color-text);
 color: var(--color-text-inverse);
}

/* ============ Shop by color — LARGE TILES ============ */
.shop-by-color {
 margin: clamp(1rem, 2vw, 2rem) 0 clamp(3rem, 5vw, 4.5rem);
}
.sbc-head {
 text-align: center;
 margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.sbc-head .eyebrow {
 font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
 color: var(--color-text-muted);
 display: block; margin-bottom: 0.5rem;
}
.sbc-title {
 font-family: var(--font-display);
 font-size: clamp(1.75rem, 3.5vw, 2.75rem);
 font-weight: 400;
 letter-spacing: -0.01em;
 line-height: 1.05;
 margin: 0;
}

.sbc-grid {
 display: grid;
 grid-template-columns: repeat(3, 1fr);
 gap: clamp(0.75rem, 2vw, 1.5rem);
}
.sbc-tile {
 position: relative;
 display: flex;
 flex-direction: column;
 background: var(--color-surface);
 border: 1px solid var(--color-divider);
 padding: 0;
 cursor: pointer;
 overflow: hidden;
 text-align: left;
 font-family: inherit;
 color: inherit;
 transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
             border-color 320ms ease,
             box-shadow 320ms ease;
}
.sbc-tile:hover {
 transform: translateY(-3px);
 border-color: var(--color-text);
 box-shadow: 0 20px 40px -20px rgba(20, 16, 12, 0.15);
}
.sbc-media {
 display: block;
 aspect-ratio: 4/5;
 overflow: hidden;
 background: var(--color-surface-2);
}
.sbc-media img {
 width: 100%; height: 100%; object-fit: cover;
 transition: transform 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sbc-tile:hover .sbc-media img { transform: scale(1.03); }

.sbc-meta {
 display: flex;
 align-items: center;
 gap: 0.75rem;
 padding: 1rem 1.25rem;
 border-top: 1px solid var(--color-divider);
 background: var(--color-surface);
}
.sbc-swatch {
 width: 20px; height: 20px;
 background: var(--sw);
 border: 1px solid rgba(0, 0, 0, 0.08);
 border-radius: 50%;
 flex: 0 0 auto;
}
.sbc-name {
 font-family: var(--font-display);
 font-size: 1.25rem;
 letter-spacing: 0.005em;
 color: var(--color-text);
 flex: 1;
}
.sbc-count {
 font-size: 0.75rem;
 letter-spacing: 0.06em;
 text-transform: uppercase;
 color: var(--color-text-muted);
}

/* Mobile: stack tiles */
@media (max-width: 720px) {
 .sbc-grid { grid-template-columns: 1fr; gap: 1rem; }
 .sbc-media { aspect-ratio: 16/10; }
}

/* ============ Refined filter bar ============ */
.plp-filters-refined {
 background: var(--color-surface);
 border-top: 1px solid var(--color-divider);
 border-bottom: 1px solid var(--color-divider);
 padding: 1.25rem 0;
 margin: 0 calc(-1 * var(--space-6, 1.5rem)) clamp(2rem, 3vw, 2.5rem);
 position: sticky;
 top: 0;
 z-index: 20;
 backdrop-filter: blur(6px);
 -webkit-backdrop-filter: blur(6px);
 background: rgba(243, 236, 222, 0.88); /* --color-surface at 88% */
}
.plp-filters-inner {
 display: flex;
 align-items: center;
 gap: clamp(1.5rem, 4vw, 3rem);
 padding: 0 var(--space-6, 1.5rem);
 flex-wrap: wrap;
 justify-content: center;
}
.plp-filter-block {
 display: flex;
 align-items: center;
 gap: 0.85rem;
 min-width: 0;
}
.plp-filter-block:not(:last-child)::after {
 content: '';
 display: block;
 width: 1px;
 height: 22px;
 background: var(--color-divider);
 margin-left: clamp(0.5rem, 2vw, 1.5rem);
 flex: 0 0 auto;
}
.plp-filter-label {
 font-size: 0.68rem;
 letter-spacing: 0.16em;
 text-transform: uppercase;
 color: var(--color-text-faint);
 flex: 0 0 auto;
}
.plp-filters-refined .group {
 display: inline-flex;
 flex-wrap: wrap;
 gap: 0.4rem;
 align-items: center;
}
.plp-filters-refined .group button {
 display: inline-flex;
 align-items: center;
 gap: 0.5rem;
 padding: 0.5rem 0.95rem;
 background: transparent;
 border: 1px solid transparent;
 border-radius: 999px;
 font-family: var(--font-body);
 font-size: 0.8125rem;
 letter-spacing: 0.04em;
 color: var(--color-text-muted);
 cursor: pointer;
 transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}
.plp-filters-refined .group button:hover {
 color: var(--color-text);
 background: var(--color-surface-2);
}
.plp-filters-refined .group button.is-active {
 color: var(--color-text);
 background: var(--color-bg);
 border-color: var(--color-text);
}

/* Color chips — swatch + name */
.plp-filter-block-color .group button {
 padding: 0.4rem 0.85rem 0.4rem 0.5rem;
}
.plp-filter-block-color .swatch,
.plp-filter-block-color .swatch-all {
 width: 18px; height: 18px;
 border-radius: 50%;
 border: 1px solid rgba(0, 0, 0, 0.1);
 background: var(--sw, transparent);
 flex: 0 0 auto;
}
.plp-filter-block-color .swatch-all {
 background: conic-gradient(#EFE9DF 0 33%, #1E2A3A 33% 66%, #4A372A 66% 100%);
}
.plp-filter-block-color .swatch-name {
 font-size: 0.8125rem;
 letter-spacing: 0.04em;
 color: inherit;
}

/* Mobile: stack filter blocks */
@media (max-width: 820px) {
 .plp-filters-refined {
  position: static;
  padding: 1rem 0;
 }
 .plp-filters-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
 }
 .plp-filter-block {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
 }
 .plp-filter-block:not(:last-child)::after {
  display: none;
 }
 .plp-filter-block:not(:last-child) {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-divider);
 }
 .plp-filters-refined .group {
  overflow-x: auto;
  flex-wrap: nowrap;
  width: 100%;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
 }
 .plp-filters-refined .group::-webkit-scrollbar { display: none; }
 .plp-filters-refined .group button { flex: 0 0 auto; }
}

/* ============ Top-positioned filter bar tuning (v20260706f) ============ */
/* Hero collapses into the filter bar as one system. */
.plp-header-refined:has(+ .plp-filters-top) {
 padding-bottom: clamp(1.25rem, 2vw, 2rem);
 margin-bottom: 0;
 border-bottom: none;
}
.plp-filters-top {
 margin: 0 0 clamp(3rem, 5vw, 4.5rem); /* neutralize negative margins from base rule */
 position: static;
 overflow: hidden; /* lock — nothing escapes the container */
 max-width: 100%;
}

/* ---------- Desktop: horizontally-scrolling chip rows ---------- */
.plp-filters-top .plp-filters-inner {
 justify-content: center;
 gap: clamp(2rem, 4vw, 3.5rem);
 flex-wrap: nowrap;
 max-width: 100%;
 overflow: hidden; /* clip the fade masks to the inner bar */
}
.plp-filters-top .plp-filter-block {
 min-width: 0; /* critical: lets the scroll child shrink */
 flex: 1 1 auto;
 max-width: 100%;
}
.plp-filters-top .plp-filter-block-color {
 flex: 0 1 auto; /* color has fixed 4 chips; let category take the room */
}
.plp-filters-top .plp-filter-block > .group {
 flex: 1 1 auto;
 min-width: 0;
 overflow-x: auto;
 flex-wrap: nowrap;
 scrollbar-width: none;
 -ms-overflow-style: none;
 scroll-snap-type: x proximity;
 padding-right: 1rem; /* room for the fade */
 -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
         mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
}
.plp-filters-top .plp-filter-block > .group::-webkit-scrollbar { display: none; }
.plp-filters-top .plp-filter-block > .group > button {
 flex: 0 0 auto;
 scroll-snap-align: start;
}

/* ---------- Mobile: two locked chip rows, edge-to-edge ---------- */
@media (max-width: 820px) {
 .plp-filters-top {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
  max-width: 100%;
  width: 100%;
 }
 .plp-filters-top .plp-filters-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  padding: 0 var(--space-6, 1.5rem);
  max-width: 100%;
  overflow: hidden;
 }
 .plp-filters-top .plp-filter-block {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
 }
 .plp-filters-top .plp-filter-block:not(:last-child) {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-divider);
 }
 .plp-filters-top .plp-filter-block:not(:last-child)::after {
  display: none;
 }
 .plp-filters-top .plp-filter-block > .group {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  padding-right: 1.5rem;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
 }
 .plp-filters-top .plp-filter-block > .group::-webkit-scrollbar { display: none; }
 .plp-filters-top .plp-filter-block > .group > button {
  flex: 0 0 auto;
  scroll-snap-align: start;
 }
}
