/* Oficina da Música: the catalogue (category page and product page).
   Loaded after home.css, which holds the tokens, the navigation, the buttons,
   the section heading and the footer. */

:root {
  /* The lit shelf a product photograph stands on. Makers and distributors
     shoot on white: the tile takes that white and warms it, so two hundred
     photographs from twenty sources read as one shelf on the dark page. */
  --paper: #e6dfd7;
  --paper-hi: #f6f0ea;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

h3 {
  margin: 0;
}

.nav-links a[aria-current] {
  color: var(--ink);
}

.nav-links a[aria-current]::after {
  transform: scaleX(1);
}

.cat-page,
.pd-page {
  padding-bottom: clamp(72px, 10vw, 136px);
}

/* The first heading of a catalogue page speaks with the section voice. */
.sec-head h1,
.pd-page h1 {
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  font-weight: 800;
  font-stretch: 122%;
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.n {
  font-size: 0.8125rem;
  font-weight: 500;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* Breadcrumb */

.crumbs {
  padding: clamp(8px, 1.4vw, 18px) var(--pad) 0;
  font-size: 0.875rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-3);
}

.crumbs li + li::before {
  content: "/";
  margin: 0 0.7em;
  font-weight: 300;
  color: var(--line);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- Category page ---------- */

.cat-head {
  padding: clamp(4px, 1vw, 16px) var(--pad) 0;
  margin-bottom: clamp(28px, 3.6vw, 52px);
}

.cat-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 3.6vw, 60px);
  padding: 0 var(--pad);
}

/* Filters */

.facets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* The filters stay beside the list only where the whole column fits the
   window: there is never a second scroller inside the page. */
@media (min-width: 960px) and (min-height: 1060px) {
  .facets:not(:has([data-brand-more][aria-expanded="true"])) {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}

.facet h2,
.facet summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 650;
  font-stretch: 108%;
  color: var(--ink-3);
}

.facet summary {
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
}

.facet summary::-webkit-details-marker {
  display: none;
}

.facet summary .chev {
  width: 1.15em;
  height: 1.15em;
  margin-left: auto;
  transition: transform 0.3s var(--ease-out);
}

.facet[open] summary .chev {
  transform: rotate(180deg);
}

.facet summary:hover {
  color: var(--ink);
}

.facet-on {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.facet-on[hidden] {
  display: none;
}

.facet-sec a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0 -12px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.facet-sec a:hover {
  background: var(--ground-2);
  color: var(--ink);
}

.facet-sec a[aria-current="true"] {
  background: var(--ground-3);
  color: var(--ink);
  font-weight: 700;
}

.facet-sec a[aria-current="true"] .n {
  color: var(--ink-2);
}

.facet-brand li[hidden] {
  display: none;
}

.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink-2);
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s;
}

.check input {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
}

.box {
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink-3);
  border-radius: 6px;
  transition: background-color 0.15s, border-color 0.15s;
}

.box::after {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.25s var(--ease-out);
}

.check-label {
  flex: 1;
}

.check:hover {
  color: var(--ink);
}

.check:hover .box {
  border-color: var(--ink);
}

.check input:checked ~ .box {
  background: var(--red);
  border-color: var(--red);
}

.check input:checked ~ .box::after {
  transform: rotate(-45deg) scale(1);
}

.check input:checked ~ .check-label {
  color: var(--ink);
  font-weight: 650;
}

.check input:focus-visible ~ .box {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.facet-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.facet-more[hidden] {
  display: none;
}

/* Toolbar */

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.count {
  font-weight: 650;
  font-stretch: 108%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
  width: 100%;
  max-width: 400px;
}

.search .ico {
  position: absolute;
  left: 15px;
  color: var(--ink-3);
  pointer-events: none;
}

.search input,
.select select,
.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--ink-3);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, background-color 0.2s;
}

.search input {
  height: 44px;
  padding: 0 16px 0 46px;
  border-radius: 999px;
}

.search input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.search input:hover,
.select select:hover,
.field input:hover,
.field textarea:hover {
  border-color: var(--ink);
}

.search input:focus-visible,
.select select:focus-visible {
  border-color: var(--ink);
  border-radius: 999px;
}

.search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.select {
  position: relative;
  display: block;
}

.select select {
  appearance: none;
  height: 44px;
  padding: 0 42px 0 18px;
  border-radius: 999px;
  background: var(--ground);
  font-weight: 600;
  cursor: pointer;
}

.select .chev {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 1.15em;
  height: 1.15em;
  translate: 0 -50%;
  pointer-events: none;
}

/* The filters in use, each one removable */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin: -8px 0 16px;
}

.chips[hidden] {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  background: var(--ground-3);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 2;
  stroke-linecap: round;
}

.chip:hover span {
  background: var(--line);
}

.chip-clear span {
  padding: 0 4px;
  background: none;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.chip-clear:hover span {
  background: none;
  color: var(--ink);
}

/* Product grid and card */

.pgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 2.6vw, 40px) clamp(10px, 1.4vw, 18px);
}

.pgrid > li[hidden],
.pgrid[hidden] {
  display: none;
}

.pcard {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.pcard-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 47 / 58;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  transition: background-color 0.35s;
}

.pcard-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: var(--w, none);
  max-height: var(--h, none);
  margin: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.9s var(--ease-out);
}

/* A cut-out has no white margin of its own. */
.pcard-photo.is-clear img {
  padding: 9%;
  mix-blend-mode: normal;
}

/* Shot on black: the tile keeps the photograph's own ground. */
.pcard-photo.is-dark {
  background: #000;
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
}

.pcard-photo.is-dark img {
  padding: 5% 0;
  mix-blend-mode: normal;
}

.pcard-photo.is-empty,
.pd-photo.is-empty {
  background: var(--ground-2);
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
  color: var(--ink-3);
  font-size: 0.875rem;
  text-align: center;
}

.pcard-text {
  display: grid;
  gap: 3px;
  padding: 0 2px;
}

.pcard-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: 104%;
  color: var(--ink-3);
}

.pcard-name {
  font-size: 1.0625rem;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.2;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.pcard-price {
  margin-top: 5px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pcard-price.is-ask {
  font-weight: 500;
  color: var(--ink-3);
}

.pcard:hover .pcard-photo:not(.is-dark):not(.is-empty),
.pcard:focus-visible .pcard-photo:not(.is-dark):not(.is-empty) {
  background: var(--paper-hi);
}

.pcard:hover .pcard-photo img,
.pcard:focus-visible .pcard-photo img {
  transform: scale(1.045);
}

.pcard:hover .pcard-name {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.pcard:focus-visible {
  outline-offset: 5px;
  border-radius: var(--radius);
}

/* More, and nothing */

.more {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: clamp(36px, 4.4vw, 64px);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.more[hidden],
.empty[hidden] {
  display: none;
}

.empty {
  max-width: 34rem;
  padding: clamp(28px, 5vw, 64px) 0;
}

.empty h2 {
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 750;
  font-stretch: 118%;
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.empty p {
  margin-top: 12px;
  color: var(--ink-2);
  text-wrap: pretty;
}

.empty .actions {
  margin-top: 24px;
}

.cat-help {
  margin-top: clamp(56px, 7vw, 96px);
  padding: 0 var(--pad);
  color: var(--ink-2);
}

.cat-help a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--ink);
  font-weight: 650;
}

.cat-help .ico {
  width: 1em;
  height: 1em;
  transition: transform 0.3s var(--ease-out);
}

.cat-help a:hover .ico {
  transform: translateX(3px);
}

/* ---------- Product page ---------- */

.pd-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
  padding: clamp(4px, 1vw, 16px) var(--pad) 0;
}

.pd-brand {
  color: var(--red);
}

.pd-lede {
  max-width: 46ch;
  margin-top: clamp(14px, 1.6vw, 22px);
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* One photograph, as most products have today */

/* The tile is as wide as the photograph is, and no narrower than a card. */
.pd-photo {
  position: relative;
  display: grid;
  place-items: center;
  justify-self: center;
  width: 100%;
  max-width: clamp(280px, var(--w, 470px), 500px);
  aspect-ratio: 47 / 58;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
}

.pd-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: var(--w, none);
  max-height: var(--h, none);
  margin: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.pd-photo.is-clear img {
  padding: 9%;
  mix-blend-mode: normal;
}

.pd-photo.is-dark {
  background: #000;
  outline: 1px solid var(--line-soft);
  outline-offset: -1px;
}

.pd-photo.is-dark img {
  mix-blend-mode: normal;
}

.pd-info {
  max-width: 36rem;
}

.pd-facts {
  margin-top: clamp(20px, 2.4vw, 32px);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.9375rem;
}

.pd-facts div,
.spec-group dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.pd-facts dt,
.spec-group dt {
  color: var(--ink-3);
}

.pd-facts dd,
.spec-group dd {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pd-offer {
  margin-top: clamp(22px, 2.6vw, 36px);
}

.pd-price {
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.05;
  letter-spacing: -0.016em;
  font-variant-numeric: tabular-nums;
}

.pd-price.is-ask {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 750;
  letter-spacing: -0.012em;
}

.pd-stock {
  margin-top: 6px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.pd-offer .actions {
  margin-top: 20px;
}

.pd-maker {
  margin-top: 24px;
  font-size: 0.9375rem;
}

/* The maker's photographs: the guitar lies across the page */

.pd-wide {
  display: block;
}

.pd-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  align-items: end;
  gap: 12px 48px;
}

.pd-wide h1 {
  font-size: clamp(2.75rem, min(6.6vw, 11vh), 5.5rem);
  font-stretch: 125%;
  line-height: 0.94;
}

.pd-wide .pd-lede {
  margin-top: 0;
}

.pd-stage {
  position: relative;
  aspect-ratio: 1920 / 663;
  max-height: calc(100svh - var(--nav-h) - 330px);
  min-height: 220px;
  margin: clamp(6px, 1.2vw, 18px) auto 0;
  /* The plates' ground is within one step of the page's; the edge of the
     frame dissolves so no rectangle can show on any screen. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent),
    linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent),
    linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.pd-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.pd-stage img.is-on {
  opacity: 1;
}

/* A new finish travels along the guitar, from the body to the headstock. */
.pd-stage img.is-in {
  z-index: 1;
  opacity: 1;
}

.motion .pd-stage img.is-in {
  animation: finish-in 0.85s var(--ease-out) both;
}

@keyframes finish-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.pd-buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px 48px;
  margin-top: clamp(10px, 1.6vw, 24px);
}

.finishes {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.finishes legend {
  padding: 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.finishes legend b {
  color: var(--ink);
  font-weight: 650;
}

.finish-row {
  display: flex;
  flex-wrap: wrap;
  margin: 6px 0 0 -5px;
}

.finish {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}

.finish input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.finish img {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(246, 240, 234, 0.34);
  border-radius: 50%;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.2s, transform 0.3s var(--ease-out);
}

.finish:hover img {
  outline-color: var(--ink-3);
}

.finish input:checked + img {
  outline-color: var(--ink);
}

.finish:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.pd-wide .pd-offer {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 28px;
  margin-top: 0;
}

.pd-wide .pd-price {
  align-self: end;
}

.pd-wide .pd-stock {
  grid-column: 1;
  align-self: start;
  max-width: 36ch;
  margin-top: 0;
}

.pd-wide .pd-offer .actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-top: 0;
}

/* Sections under the product */

.story,
.features,
.switch,
.specs,
.ask,
.related {
  padding: clamp(64px, 9vw, 124px) var(--pad) 0;
}

.story-text {
  display: grid;
  gap: 0.8em;
  color: var(--ink-2);
  text-wrap: pretty;
}

.shots {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}

.shot {
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-1 {
  grid-column: span 8;
  aspect-ratio: 2 / 1;
}

.shot-2 {
  grid-column: span 4;
}

.shot-3,
.shot-4,
.shot-5 {
  grid-column: span 4;
  aspect-ratio: 3 / 2;
}

.shots-note {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px) clamp(16px, 2.4vw, 36px);
}

.feature-list img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
}

.feature-list h3,
.switch-title {
  margin-top: 18px;
  font-size: clamp(1.125rem, 1.7vw, 1.5rem);
  font-weight: 750;
  font-stretch: 118%;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.feature-list p {
  max-width: 40ch;
  margin-top: 8px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* The blade switch: which coils sound in each position */

.switch-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(24px, 4.4vw, 64px);
  border-radius: var(--radius);
  background: var(--ground-2);
}

.pickups {
  justify-self: center;
  width: 100%;
  max-width: 440px;
  height: auto;
  overflow: visible;
}

.pickups rect {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  transition: stroke 0.25s, fill 0.25s;
}

.pickups circle {
  fill: var(--line);
  stroke: transparent;
  stroke-width: 1.3;
  transition: fill 0.25s, stroke 0.25s;
}

.pickups .is-full rect,
.pickups .is-single rect {
  stroke: var(--ink);
  fill: rgba(246, 240, 234, 0.06);
}

/* Both coils sounding: the poles are lit. One coil: the poles are in outline. */
.pickups .is-full circle {
  fill: var(--red);
}

.pickups .is-single circle {
  fill: transparent;
  stroke: var(--red-hi);
}

.pickups text {
  font-size: 8.5px;
}

.pickup-name {
  fill: var(--ink-2);
  font-weight: 650;
}

.pickup-state {
  fill: var(--ink-3);
}

.pickups .is-full .pickup-state,
.pickups .is-single .pickup-state {
  fill: var(--ink-2);
}

.positions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.pos {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--ink-3);
  border-radius: 50%;
  font-size: 1.125rem;
  font-weight: 750;
  font-stretch: 112%;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pos input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pos:hover {
  border-color: var(--ink);
}

.pos:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

.pos:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.switch-title {
  margin-top: 22px;
}

.switch-text {
  max-width: 42ch;
  min-height: 3em;
  margin-top: 8px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Specifications */

.specs-body {
  columns: 2;
  column-gap: clamp(32px, 6vw, 96px);
  font-size: 0.9375rem;
}

.spec-group {
  break-inside: avoid;
  padding-bottom: clamp(24px, 3vw, 40px);
}

.spec-group h3 {
  padding-bottom: 12px;
  font-size: 1.0625rem;
  font-weight: 750;
  font-stretch: 116%;
  letter-spacing: -0.008em;
}

.spec-group dl {
  border-bottom: 1px solid var(--line-soft);
}

.points {
  break-inside: avoid;
  border-bottom: 1px solid var(--line-soft);
}

.points li {
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}

.specs-plain .spec-group {
  break-inside: auto;
}

/* Rows that may break across the two columns carry both of their rules. */
.specs-plain .spec-group dl,
.specs-plain .points {
  border-bottom: 0;
}

.specs-plain .spec-group dl div,
.specs-plain .points li {
  break-inside: avoid;
  margin-bottom: -1px;
  border-bottom: 1px solid var(--line-soft);
}

/* Asking for the price */

.ask-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  align-items: start;
  gap: clamp(28px, 6vw, 96px);
}

.ask-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px clamp(12px, 1.4vw, 18px);
}

.field-wide,
.ask-send {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field input,
.field textarea {
  display: block;
  border-radius: var(--radius);
}

.field input {
  height: 52px;
  padding: 0 16px;
}

.field textarea {
  min-height: 132px;
  padding: 14px 16px;
  line-height: 1.45;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  border-radius: var(--radius);
}

.field [aria-invalid="true"] {
  border-color: var(--red-hi);
}

.field-err {
  margin-top: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--red-hi);
}

.field-err[hidden] {
  display: none;
}

.ask-send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 4px;
}

.ask-note {
  flex: 1;
  min-width: 14rem;
  max-width: 40ch;
  font-size: 0.875rem;
  color: var(--ink-3);
  text-wrap: pretty;
}

.ask-shop {
  border-bottom: 1px solid var(--line-soft);
}

.ask-shop li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.ask-shop .ico {
  margin-top: 4px;
  color: var(--ink-3);
}

.ask-shop div {
  display: grid;
  justify-items: start;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.ask-shop a {
  color: var(--ink);
  font-weight: 650;
}

.ask-phone {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.1;
  letter-spacing: -0.016em;
  text-decoration: none;
}

.ask-phone:hover {
  text-decoration: underline;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1279px) {
  .pgrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pgrid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pd-wide .pd-offer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .pd-wide .pd-stock {
    max-width: none;
  }

  .pd-wide .pd-offer .actions {
    grid-column: 1;
    grid-row: auto;
    margin-top: 14px;
  }
}

@media (max-width: 959px) {
  .crumbs li[aria-current] {
    display: none;
  }

  .cat-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .facets {
    position: static;
    gap: 10px;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  /* The sections become one row of pills that scrolls sideways. */
  .facet-sec h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .facet-sec ul {
    display: flex;
    gap: 8px;
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad) 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .facet-sec ul::-webkit-scrollbar {
    display: none;
  }

  .facet-sec a {
    gap: 8px;
    margin: 0;
    padding: 0 16px;
    border: 1.5px solid var(--ink-3);
    border-radius: 999px;
    white-space: nowrap;
  }

  .facet-sec a[aria-current="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--ground);
  }

  .facet-sec a[aria-current="true"] .n {
    color: var(--ground-3);
  }

  .facet-brand summary {
    min-height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--ink-3);
    border-radius: 999px;
    color: var(--ink);
    font-size: 1rem;
  }

  .facet-brand ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    padding: 6px 4px 0;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 6px;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: none;
  }

  .sort > span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  /* A tablet keeps three across: the archive photographs are small, and a
     half-width tile would leave each one adrift in it. */
  .pgrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pgrid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pcard-name {
    font-size: 1rem;
  }

  .pd-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .pd-photo {
    max-width: 420px;
  }

  .pd-title {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On a phone the whole guitar would be a sliver: the frame holds the body,
     where the finish is, and the neck runs off the edge. */
  .pd-stage {
    aspect-ratio: 4 / 3;
    max-height: none;
    margin: 14px calc(var(--pad) * -1) 0;
    overflow: hidden;
  }

  .pd-stage img {
    object-fit: cover;
    object-position: 0 50%;
  }

  .pd-buy {
    grid-template-columns: minmax(0, 1fr);
  }

  .shot-1 {
    grid-column: 1 / -1;
  }

  .shot-2,
  .shot-3,
  .shot-4,
  .shot-5 {
    grid-column: span 6;
    aspect-ratio: 4 / 3;
  }

  .feature-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-list li {
    display: grid;
    grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
    align-content: start;
    column-gap: 16px;
  }

  .feature-list img {
    grid-row: 1 / span 2;
  }

  .feature-list h3 {
    margin-top: 0;
    align-self: end;
  }

  .switch-body,
  .ask-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .pickups {
    max-width: 340px;
    margin: 0 auto;
  }

  .specs-body {
    columns: 1;
  }
}

@media (max-width: 640px) {
  .pgrid,
  .pgrid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* A phone has room for one step back, not the whole trail. */
  .crumbs li {
    display: none;
  }

  .crumbs li:nth-last-child(2) {
    display: inline-flex;
  }

  .crumbs li:nth-last-child(2)::before {
    content: "";
    width: 0.5em;
    height: 0.5em;
    margin: 0 0.6em 0 0.15em;
    border: solid var(--ink-3);
    border-width: 0 0 1.5px 1.5px;
    transform: rotate(45deg);
  }

  .finish-row {
    display: grid;
    grid-template-columns: repeat(5, 44px);
    gap: 0 clamp(4px, 3vw, 16px);
  }

  .pd-stage {
    aspect-ratio: 3 / 2;
  }

  /* The note and the red button share a row, so the action is on the first screen. */
  .pd-wide .pd-offer {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
    gap: 4px 16px;
  }

  .pd-wide .pd-price {
    grid-column: 1 / -1;
    white-space: nowrap;
  }

  .pd-wide .pd-offer .actions {
    display: contents;
  }

  .pd-wide .pd-offer .btn-primary {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  .pd-wide .pd-offer .btn-line {
    grid-column: 1 / -1;
    margin-top: 14px;
  }
}

@media (max-width: 520px) {
  .ask-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .pd-hero:not(.pd-wide) .pd-offer .actions .btn {
    flex: 1 1 100%;
  }

  .pos {
    width: 48px;
    height: 48px;
  }

  .feature-list li {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-list img {
    grid-row: auto;
    aspect-ratio: 3 / 2;
  }

  .feature-list h3 {
    margin-top: 16px;
  }
}
