/* Style recommendations: homepage style hub, collection style rail, product style tags and recommendations.
   Works on desktop and mobile. */
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) {
  --jb-ink: #171717;
  --jb-muted: #57534e;
  --jb-line: #e5e2dd;
  --jb-purple: #7661d5;
  --jb-display: var(--sort-title1-font, inherit);
  color: var(--jb-ink);
}
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) *,
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) *::before,
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) *::after { box-sizing: border-box; }
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) a { color: inherit; text-decoration: none; }
:is(.jb-sh, .jb-rail, .jb-ptags, .jb-ps) :is(a, button):focus-visible { outline: 2px solid var(--jb-purple); outline-offset: 2px; }
.jb-sr-eyebrow { margin: 0 0 6px; color: var(--jb-purple); font-size: 11.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.jb-sr-h2 { margin: 0; font-family: var(--jb-display); font-size: 32px; font-weight: 400; line-height: 1.12; text-wrap: balance; }
.jb-sr-sub { margin: 6px 0 0; color: var(--jb-muted); font-size: 14px; line-height: 1.6; }
.jb-sr-link { flex-shrink: 0; font-size: 13.5px; font-weight: 500; text-decoration: underline !important; text-underline-offset: 3px; }
.jb-sr-cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.jb-sr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }

/* ---------- Homepage style hub ---------- */
.jb-sh { display: block; padding-block: 48px; background: rgb(var(--color-background)); }
.jb-sh__wrap { display: flex; flex-direction: column; gap: 24px; }
.jb-sh__looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.jb-sh__look > a { display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 16px; border-radius: 12px; background: #f6f5f3; }
.jb-sh__look--lavender > a { background: #eeeaff; }
.jb-sh__look--cream > a { background: #f8edde; }
.jb-sh__look--rose > a { background: #f2e7ee; }
.jb-sh__look--sage > a { background: #e8f1ea; }
.jb-sh__imgs { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 230px; }
.jb-sh__img { overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, .6); }
.jb-sh__img:first-child { grid-row: 1 / span 2; }
.jb-sh__img:only-child { grid-column: 1 / -1; }
.jb-sh__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.jb-sh__name { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.jb-sh__desc { display: block; margin-top: 2px; color: var(--jb-muted); font-size: 13.5px; line-height: 1.5; }
.jb-sh__pill { flex-shrink: 0; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 500; white-space: nowrap; }
.jb-sh__look > a:hover .jb-sh__pill { background: var(--jb-ink); color: #fff; }
.jb-sh__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; }
.jb-sh__row:not(:has(a)) { display: none; }
.jb-sh__row-label { margin-right: 4px; font-weight: 600; }
.jb-sh__chip { padding: 8px 14px; border-radius: 99px; background: #f6f5f3; }
.jb-sh__chip:hover { background: #eeeaff; }
.jb-sh__chip--outline { border: 1px solid var(--jb-ink); background: transparent; }
.jb-sh__themes-wrap:not(:has(a)) { display: none; }
.jb-sh__themes-wrap { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.jb-sh__h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.jb-sh__themes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.jb-sh__theme a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.jb-sh__circle { width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: #f6f5f3; }
.jb-sh__theme a:hover .jb-sh__circle { outline: 2px solid var(--jb-purple); outline-offset: 3px; }
.jb-sh__theme-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.jb-sh__theme-count { color: var(--jb-muted); font-size: 12.5px; }
.jb-sh__shopfor { padding: 14px 18px; border: 1px solid var(--jb-line); border-radius: 10px; }
.jb-sh__shopfor:not(:has(a)) { display: none; }

/* ---------- Collection style rail ---------- */
.jb-rail { display: block; padding-block: 4px 8px; background: rgb(var(--color-background)); }
.jb-rail__tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--jb-line); }
.jb-rail__tab { min-height: 44px; margin-bottom: -1px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; color: #8a857d; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.jb-rail__tab[aria-selected="true"] { border-bottom-color: var(--jb-ink); color: var(--jb-ink); }
.jb-rail__panel { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 14px 4px; }
.jb-rail__panel[hidden] { display: none; }
.jb-rail__chip { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 6px; border: 1px solid #d7d3cd; border-radius: 99px; background: #fff; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.jb-rail__chip:hover { border-color: var(--jb-ink); }
.jb-rail__chip.is-active { border-color: var(--jb-ink); background: var(--jb-ink); color: #fff; }
.jb-rail__thumb { width: 36px; height: 36px; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: #f6f5f3; }
.jb-rail__chip small { font-size: 12px; opacity: .7; }
.jb-rail__mix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 12px; padding: 14px 18px; border-radius: 12px; background: var(--jb-ink); color: #fff; }
.jb-rail__mix-copy { display: flex; flex-direction: column; gap: 2px; }
.jb-rail__mix-copy .jb-sr-eyebrow { margin: 0; color: #bfb7ff; }
.jb-rail__mix-title { font-size: 16px; font-weight: 600; }
.jb-rail__mix-text { color: #d8d4e6; font-size: 13px; }
.jb-rail__mix-imgs { display: flex; gap: 6px; }
.jb-rail__mix-img { width: 52px; height: 52px; overflow: hidden; border-radius: 6px; background: #2a2a2a; }

/* Collection page: the rail replaces the old quick chips; title uses the display font. */
body:has(.jb-rail) .collection-discovery__chips { display: none; }
@media (min-width: 960px) {
  [data-jb-desktop-v2="true"][data-page-type="collection"] .collection-discovery__heading { font-family: var(--sort-title1-font, inherit); font-weight: 400; }
}

/* ---------- Product style tags (above the title) ---------- */
.jb-ptags { display: flex; flex-wrap: wrap; gap: 8px; }
.jb-ptags:not(:has(a)) { display: none; }
.jb-ptag { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border-radius: 99px; background: #f6f5f3; font-size: 13px; font-weight: 500; line-height: 1.3; }
.jb-ptag:hover { background: #eeeaff; }
.jb-ptag--style { background: #f2e7ee; }
.jb-ptag--theme { background: #eeeaff; }
.jb-ptag--tone { background: #f8edde; }
.jb-ptag--style::after { content: " →"; white-space: pre; }

/* Desktop product page: show the quantity tiers that desktop V2 hid. */
@media (min-width: 960px) {
  [data-jb-desktop-v2="true"] .product-detail__price-tiers > .product-detail__tier-pricing { display: block; margin-top: 4px; }
}

/* ---------- Product recommendations (same style + mix) ---------- */
.jb-ps { display: block; padding-block: 48px; background: rgb(var(--color-background)); }
.jb-ps__wrap { display: flex; flex-direction: column; gap: 40px; }
.jb-ps__block { display: flex; flex-direction: column; gap: 18px; }
.jb-ps__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.jb-ps__card { display: flex; flex-direction: column; gap: 8px; }
.jb-ps__img { aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: #f6f5f3; }
.jb-ps__title { display: -webkit-box; overflow: hidden; font-size: 13.5px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.jb-ps__price { font-size: 17px; font-weight: 600; }
.jb-ps__card:hover .jb-ps__title { text-decoration: underline; text-underline-offset: 3px; }
.jb-ps__mix { display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: 12px; background: #f6f5f3; }
.jb-ps__mix:not(:has(.jb-ps__pair)) { display: none; }
.jb-ps__pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.jb-ps__pair a { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 14px; height: 100%; padding: 14px; border-radius: 10px; background: #fff; }
.jb-ps__pair-img { width: 96px; height: 96px; overflow: hidden; border-radius: 8px; background: #f6f5f3; }
.jb-ps__pair-copy { display: flex; flex-direction: column; gap: 4px; }
.jb-ps__pair-name { font-size: 16px; font-weight: 600; }
.jb-ps__pair-text { color: var(--jb-muted); font-size: 13px; line-height: 1.5; }
.jb-ps__pair-count { font-size: 13px; font-weight: 500; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 1199px) {
  .jb-ps__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .jb-ps__grid > li:nth-child(n+5) { display: none; }
}
@media (max-width: 959px) {
  .jb-sh, .jb-ps { padding-block: 32px; }
  .jb-sr-h2 { font-size: 26px; }
  .jb-sh__wrap { gap: 18px; }
  .jb-sh__looks { display: flex; gap: 12px; margin-inline: calc(var(--page-padding, 20px) * -1); padding-inline: var(--page-padding, 20px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .jb-sh__looks::-webkit-scrollbar { display: none; }
  .jb-sh__look { flex: 0 0 62%; scroll-snap-align: start; }
  .jb-sh__look > a { gap: 10px; padding: 10px; }
  .jb-sh__imgs { height: 170px; }
  .jb-sh__foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .jb-sh__name { font-size: 15px; }
  .jb-sh__desc { display: none; }
  .jb-sh__pill { padding: 0; background: none; color: var(--jb-muted); font-size: 12.5px; }
  .jb-sh__row { gap: 8px; font-size: 12.5px; }
  .jb-sh__row-label { flex-basis: 100%; }
  .jb-sh__themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
  .jb-sh__theme-name { font-size: 12.5px; }
  .jb-sh__shopfor { padding: 0; border: 0; }

  .jb-rail__tabs { gap: 0; padding: 4px; border: 0; border-radius: 99px; background: #f6f5f3; }
  .jb-rail__tab { flex: 1; min-height: 38px; margin: 0; border: 0; border-radius: 99px; font-size: 13px; }
  .jb-rail__tab[aria-selected="true"] { background: var(--jb-ink); color: #fff; }
  .jb-rail__panel { flex-wrap: nowrap; gap: 8px; margin-inline: calc(var(--page-padding, 20px) * -1); padding-inline: var(--page-padding, 20px); overflow-x: auto; scrollbar-width: none; }
  .jb-rail__panel::-webkit-scrollbar { display: none; }
  .jb-rail__chip { min-height: 42px; padding: 4px 12px 4px 4px; font-size: 12.5px; }
  .jb-rail__thumb { width: 32px; height: 32px; }
  .jb-rail__mix { grid-template-columns: minmax(0, 1fr); }
  .jb-rail__mix-imgs { display: none; }

  .jb-ps__wrap { gap: 28px; }
  .jb-ps__grid { display: flex; gap: 10px; margin-inline: calc(var(--page-padding, 20px) * -1); padding-inline: var(--page-padding, 20px); overflow-x: auto; scrollbar-width: none; }
  .jb-ps__grid::-webkit-scrollbar { display: none; }
  .jb-ps__grid > li, .jb-ps__grid > li:nth-child(n+5) { display: block; flex: 0 0 140px; }
  .jb-ps__title { font-size: 12.5px; }
  .jb-ps__price { font-size: 15px; }
  .jb-ps__mix { padding: 18px; }
  .jb-ps__pairs { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .jb-ps__pair a { grid-template-columns: 64px minmax(0, 1fr); padding: 10px; }
  .jb-ps__pair-img { width: 64px; height: 64px; }
  .jb-ptag { min-height: 30px; font-size: 12px; }
}
