/* Collection, product and shopping bag */
.product-card, .product-link { min-width: 0; }
.product-link { display: block; color: var(--ink); text-decoration: none; }
.product-photo, .detail-photo { background: #e5dfd4; overflow: hidden; }
.product-photo { aspect-ratio: 1; }
.product-photo img, .detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-photo img { transition: transform .4s ease; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .product-link:hover .product-photo img { transform: scale(1.025); }
  .product-link:hover .product-name { text-decoration: underline; text-underline-offset: .15em; }
}
.product-meta { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.product-name { margin: 0; font: 400 clamp(1.3rem, 2vw, 1.8rem)/1.12 var(--serif); }
.product-price { flex: none; font-size: .94rem; font-variant-numeric: tabular-nums; }
.product-finish { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }

.shop-page, .product-page, .search-page {
  max-width: 1660px;
  margin: 0 auto;
  padding: 22px var(--gutter) clamp(64px, 8vw, 120px);
}
.breadcrumbs {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  font-size: .81rem; color: var(--muted);
}
.breadcrumbs a { padding: 6px 0; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.shop-heading { margin: clamp(32px, 5vw, 76px) 0 clamp(24px, 3.5vw, 54px); }
.shop-heading h1, .product-info h1 {
  margin: 0; font: 400 clamp(3.25rem, 6.7vw, 6.3rem)/.97 var(--serif);
  letter-spacing: -.035em; color: var(--ink);
}
.shop-heading p, .detail-description { color: var(--muted); line-height: 1.65; max-width: 53ch; margin: 16px 0 0; }
.shop-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 8px 0; border-block: 1px solid var(--line);
}
.sort-control { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); }
.sort-control select {
  appearance: none; min-height: 44px; padding: 0 30px 0 10px; cursor: pointer;
  font: inherit; color: var(--ink); border: 0; background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23322e25' stroke-width='1.4'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}
.result-count { margin: 21px 0 16px; font-size: .85rem; color: var(--muted); }
.shop-page .product-grid, .search-page .product-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 38px clamp(16px, 2vw, 32px);
}
.single-piece { grid-column: 1/-1; }
.single-piece .product-link {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); align-items: center;
  gap: clamp(24px, 5vw, 76px);
}
.single-piece .product-photo { aspect-ratio: 1.3; }
.single-piece .product-name { font-size: clamp(2.2rem, 3.7vw, 4.5rem); }
.single-piece .product-price { margin-top: 12px; }
.single-piece-description { max-width: 46ch; margin-top: 18px; color: var(--muted); }
.single-piece .underlink { margin-top: 14px; }
.search-field { display: grid; gap: 8px; max-width: 550px; font-size: .9rem; }
.search-field input {
  box-sizing: border-box; width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 0;
  padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: transparent;
}
.product-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 100px); margin-top: 26px; align-items: start; }
.detail-photo { aspect-ratio: 1; }
.product-info { align-self: center; max-width: 34rem; padding-block: 12px; }
.detail-category {
  margin: 0 0 12px; color: var(--muted);
  font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em;
}
.product-info h1 { font-size: clamp(2.75rem, 4.7vw, 5rem); }
.detail-price { display: flex; align-items: baseline; gap: 6px; margin: 18px 0 0; font-size: 1.25rem; }
.detail-price small { font-size: .78rem; color: var(--muted); }
.purchase-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.purchase-row .primary-button { flex: 1; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); }
.stepper button, .bag-close, .text-button {
  appearance: none; border: 0; border-radius: 0; font: inherit; color: var(--ink); background: transparent; cursor: pointer;
}
.stepper button { min-width: 44px; min-height: 44px; font-size: 1.2rem; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper button:enabled:hover, .bag-close:hover { background-color: #e9e6dd; }
.stepper .quantity { min-width: 22px; display: grid; place-items: center; font-size: .94rem; font-variant-numeric: tabular-nums; }
.detail-specs details { border-top: 1px solid var(--line); }
.detail-specs details:last-child { border-bottom: 1px solid var(--line); }
.detail-specs summary { display: flex; justify-content: space-between; align-items: center; min-height: 50px; cursor: pointer; list-style: none; }
.detail-specs summary::-webkit-details-marker { display: none; }
.detail-specs summary::after { content: '+'; font-size: 1.25rem; }
.detail-specs details[open] summary::after { content: '−'; }
.piece-facts {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 22px; margin: 0 0 18px; font-size: .9rem;
}
.piece-facts dt, .detail-specs p { color: var(--muted); }
.piece-facts dd { margin: 0; overflow-wrap: anywhere; }
.detail-specs p { font-size: .9rem; line-height: 1.65; margin: 0 24px 18px 0; }

.bag-is-open { overflow: hidden; }
.bag-dialog {
  box-sizing: border-box; position: fixed; inset: 0 0 0 auto; margin: 0;
  height: 100%; height: 100dvh; width: min(100%, 490px); max-width: 100%; max-height: none;
  padding: 0; border: 0; background: var(--paper); color: var(--ink);
}
.bag-dialog::backdrop { background: rgba(31, 28, 19, .42); }
.bag-panel {
  box-sizing: border-box; display: flex; flex-direction: column;
  height: 100%; padding: 16px clamp(16px, 3vw, 32px) max(18px, env(safe-area-inset-bottom)); 
}
.bag-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; padding-block: 8px 18px; border-bottom: 1px solid var(--line); }
.bag-header h2 { margin: 0; font: 400 clamp(2rem, 3vw, 2.8rem)/1.08 var(--serif); letter-spacing: -.02em; }
.bag-header h2:focus { outline: 0; }
.bag-close { min-height: 44px; min-width: 44px; font-size: 1.65rem; line-height: 1; }
.bag-items, .demo-summary { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.bag-items, .checkout-lines { padding: 0; margin: 0; list-style: none; }
.bag-item {
  display: grid; grid-template-columns: clamp(65px, 18vw, 94px) minmax(0, 1fr) auto;
  gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line);
}
.bag-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.bag-item-info a { text-decoration: none; font: 400 1.45rem/1.1 var(--serif); }
.bag-item-info a:hover { text-decoration: underline; }
.bag-item-info p { margin: 5px 0 12px; font-size: .8rem; line-height: 1.4; color: var(--muted); }
.bag-item-end { display: flex; flex-direction: column; align-items: end; justify-content: space-between; font-size: .94rem; }
.text-button { min-height: 44px; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: .86rem; }
.bag-footer { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; flex: none; }
.subtotal, .checkout-lines li { display: flex; justify-content: space-between; gap: 12px; }
.subtotal { margin-bottom: 12px; font-size: 1.06rem; }
.subtotal strong { font-weight: 500; }
.bag-empty { margin: auto 0; text-align: center; }
.bag-empty p { color: var(--muted); line-height: 1.6; }
.demo-summary { line-height: 1.5; padding-block: 10px; }
.demo-summary > p { color: var(--muted); }
.demo-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; font-size: .94rem; }
.demo-summary dt { color: var(--muted); }
.demo-summary dd { margin: 0; }
.checkout-lines { font-size: .91rem; }
.checkout-lines li { border-top: 1px solid var(--line); padding-block: 10px; }
.checkout-lines li span:last-child { flex: none; }

@media (max-width: 780px) {
  .shop-page .product-grid, .search-page .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout { gap: 28px; grid-template-columns: 1fr 1fr; }
  .purchase-row { gap: 8px; }
}
@media (max-width: 640px) {
  .product-layout { grid-template-columns: minmax(0, 1fr); margin-top: 14px; gap: 24px; }
  .product-info { max-width: none; padding: 0; }
  .single-piece .product-link { grid-template-columns: 1fr; gap: 16px; }
  .shop-page, .product-page, .search-page { padding-top: 12px; }
  .shop-tools { gap: 0; padding: 4px 0; }
  .product-meta { margin-top: 10px; }
  .product-grid .product-meta { display: block; }
  .product-grid .product-price { display: block; margin-top: 4px; }
  .product-name { font-size: 1.35rem; }
  .product-finish { margin-top: 4px; }
  .bag-item-info a { font-size: 1.25rem; }
  .shop-page .product-grid, .search-page .product-grid { gap: 26px 12px; }
}
@media (max-width: 360px) {
  .bag-item { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; }
}
@media (max-height: 480px) {
  .bag-panel { overflow-y: auto; }
  .bag-items, .demo-summary { overflow: visible; flex: none; }
}

.collections-page {
  max-width: 1660px; margin: 0 auto;
  padding: 22px var(--gutter) clamp(64px, 8vw, 120px);
}
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.directory-heading p { margin: 0; max-width: 38ch; }
.directory-shelf {
  display: grid; grid-template-columns: minmax(150px, 1fr) 4fr;
  align-items: start; gap: 22px;
  border-top: 1px solid var(--line); padding-block: clamp(26px, 3.3vw, 48px);
}
.directory-shelf > h2 { font-size: clamp(1.9rem, 2.8vw, 3rem); letter-spacing: -.025em; }
.directory-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px clamp(10px, 1.4vw, 22px);
}
.directory-link, .directory-count, .pairing-price { display: block; }
.directory-photo { overflow: hidden; background: #e6e1d5; }
.directory-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; transition: transform .4s ease; }
.directory-entry h3 { margin: 12px 0 4px; font-size: clamp(1.4rem, 1.9vw, 2rem); }
.directory-count, .pairing-price { font-size: .84rem; color: var(--muted); }
.directory-link:hover h3, .pairing-link:hover .pairing-name { text-decoration: underline; text-underline-offset: .13em; }
.directory-products { margin: 8px 0 0; padding: 0; list-style: none; }
.directory-products a, .product-resources a { display: inline-flex; align-items: center; min-height: 40px; font-size: .87rem; text-decoration: underline; text-underline-offset: 4px; }
.category-heading {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  margin: 18px 0 30px; background: #ede9df;
}
.category-heading > div { align-self: center; padding: clamp(28px, 4.5vw, 76px); }
.category-heading h1 { font-size: clamp(3rem, 5.5vw, 5.75rem); }
.category-heading p { max-width: 38ch; }
.category-heading > img { display: block; width: 100%; min-height: 100%; height: clamp(230px, 23vw, 355px); object-fit: cover; }
.product-resources { display: flex; flex-wrap: wrap; column-gap: 22px; margin-top: 8px; }
.product-pairing {
  display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 2fr); align-items: center; gap: 20px;
  margin-top: clamp(36px, 6vw, 84px); padding-block: clamp(22px, 2.5vw, 38px); border-block: 1px solid var(--line);
}
.product-pairing h2 { margin: 0; font: 400 clamp(2rem, 3.2vw, 3.45rem)/1.1 var(--serif); letter-spacing: -.025em; }
.pairing-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); }
.pairing-link { display: flex; align-items: center; gap: clamp(12px, 1.4vw, 24px); }
.pairing-link img { width: clamp(64px, 7vw, 112px); height: auto; aspect-ratio: 1; object-fit: cover; }
.pairing-name { font: 400 clamp(1.25rem, 1.9vw, 2rem)/1.1 var(--serif); }
.pairing-price { margin-top: 6px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .directory-link:hover img { transform: scale(1.025); }
}
@media (max-width: 1000px) {
  .directory-shelf { grid-template-columns: 1fr; }
}
@media (max-width: 670px) {
  .collections-page { padding-top: 12px; }
  .directory-heading { display: block; }
  .directory-heading p { margin-top: 15px; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sort-control { flex-wrap: wrap; gap: 2px 8px; }
  .category-heading { grid-template-columns: 1fr; margin: 12px 0 20px; }
  .category-heading > div { padding: 24px; }
  .category-heading > img { height: clamp(140px, 35vw, 210px); min-height: 0; }
  .product-pairing { grid-template-columns: 1fr; }
  .pairing-items { grid-template-columns: 1fr; gap: 16px; }
}
