/* Catalog-style finish pages (scripts/cs_layout.py). Uses the site palette. */
.cs-page [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cs-page { padding-bottom: 64px; }
.cs-top > *, .cs-listing, .cs-tabs { min-width: 0; }

/* Top: media + summary */
.cs-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: start; margin: 10px 0 30px; }
.cs-stage { position: relative; background: #fff; border: 1px solid var(--line); aspect-ratio: 4 / 3; overflow: hidden; }
.cs-slide { margin: 0; position: absolute; inset: 0; }
.cs-slide img { width: 100%; height: 100%; object-fit: cover; }
.cs-slide-door img { object-fit: contain; padding: 4%; background: #fff; }
.cs-css-door { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cs-css-door .swatch-door { width: 38%; height: 82%; margin: 0; border-radius: 3px; }
.cs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.88); color: var(--navy); font-size: 1.5rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.cs-prev { left: 10px; } .cs-next { right: 10px; }
.cs-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.cs-thumb { width: 72px; height: 56px; padding: 0; border: 2px solid var(--line); background: #fff; cursor: pointer; overflow: hidden; }
.cs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cs-thumb.is-on { border-color: var(--wood); }
.cs-thumb-door { display: block; width: 100%; height: 100%; }
.cs-media-note { font-size: .75rem; color: var(--muted); margin: 6px 0 0; }

.cs-h1 { font-family: Fraunces, Georgia, serif; color: var(--navy); font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.02em; margin: 0 0 4px; }
.cs-eyebrow { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.cs-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.cs-status { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; }
.cs-status-ship { background: #e5f0ea; color: var(--ok); }
.cs-status-soon { background: #e8eef6; color: var(--navy); }
.cs-from { margin: 0; color: var(--muted); }
.cs-from strong { color: var(--navy); font-size: 1.1rem; }
.cs-warn { color: var(--warn); font-weight: 600; }

.cs-tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.cs-tablist [role="tab"] {
  font: inherit; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  border: 0; background: transparent; color: var(--navy); padding: 12px 16px; cursor: pointer; margin-bottom: -2px; border-bottom: 2px solid transparent;
}
.cs-tablist [role="tab"]:hover { color: var(--wood-d); }
.cs-tablist [aria-selected="true"] { background: var(--navy); color: #fff; border-bottom-color: var(--navy); }
.cs-panel { font-size: .95rem; color: var(--ink); min-height: 220px; }
.cs-panel p { margin: 0 0 12px; }
.cs-bullets { margin: 0 0 14px; padding-left: 0; list-style: none; }
.cs-bullets li { position: relative; padding-left: 18px; margin-bottom: 4px; }
.cs-bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--wood); }
.cs-feature-list { grid-template-columns: 1fr; }
.cs-spec-table th { width: 30%; }
.cs-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.cs-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 16px; font-weight: 700;
  background: var(--navy); color: #fff; border: 1px solid var(--navy); text-align: center;
}
.cs-cta:hover { background: var(--navy-2); color: #fff; }
.cs-cta-ghost { background: var(--cream); color: var(--navy); border-color: var(--line); }
.cs-cta-ghost:hover { background: #efe7d8; color: var(--navy); }

.cs-colors { margin: 0 0 18px; }
.cs-colors-title { font-size: 1rem; color: var(--navy); margin: 0 0 4px; }

/* Listing header */
.cs-listing { scroll-margin-top: calc(var(--header-h) + 8px); border-top: 1px solid var(--line); padding-top: 28px; }
.cs-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cs-list-title { font-family: Fraunces, Georgia, serif; color: var(--navy); font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
.cs-controls { display: flex; align-items: center; gap: 10px; flex: 1 1 520px; justify-content: flex-end; }
.cs-search { position: relative; flex: 1 1 320px; max-width: 420px; margin: 0; font-weight: 400; color: var(--muted); }
.cs-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.cs-search input { padding-left: 36px; background: #f1eee8; border-color: #f1eee8; border-radius: 0; height: 44px; }
.cs-sort { margin: 0; }
.cs-sort select { height: 44px; border-radius: 0; min-width: 190px; }
.cs-view { display: flex; align-items: center; gap: 4px; }
.cs-view-label { font-size: .82rem; color: var(--muted); margin-right: 2px; }
.cs-view button { border: 1px solid var(--line); background: #fff; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; color: var(--muted); fill: currentColor; }
.cs-view button[aria-pressed="true"] { color: var(--navy); border-color: var(--navy); }

.cs-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px; font-size: .88rem; }
.cs-active-label { color: var(--muted); }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: #ebe6dc; color: var(--navy); padding: 6px 12px; font: inherit; font-size: .84rem; cursor: pointer; }
.cs-chip .x { font-size: 1rem; line-height: 1; color: var(--muted); }
.cs-chip:hover .x { color: var(--navy); }
.cs-chip-fixed { cursor: default; }
[data-active-chips] { display: contents; }
.cs-clear { border: 0; background: var(--navy); color: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }

/* Type tiles */
.cs-tiles { display: flex; justify-content: center; gap: 12px; margin: 0 0 14px; }
.cs-tile {
  flex: 0 1 150px; min-height: 100px; border: 1px solid #cfc9bf; background: #fff; color: var(--navy); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; font: inherit; position: relative;
}
.cs-tile svg { color: #6b6a66; }
.cs-tile:hover { border-color: var(--wood); }
.cs-tile.is-on { border: 2px solid var(--wood); padding: 11px 7px; box-shadow: 0 0 0 3px rgba(176,122,74,.12); }
.cs-tile.is-on svg { color: var(--wood-d); }
.cs-tile-name { font-size: .82rem; font-weight: 700; text-align: center; line-height: 1.2; }
.cs-tile-n { position: absolute; top: 6px; right: 8px; font-size: .7rem; color: var(--muted); }
.cs-subs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 18px; }
.cs-sub { border: 1px solid transparent; background: #f1eee8; color: var(--ink); font: inherit; font-size: .86rem; padding: 8px 12px; cursor: pointer; }
.cs-sub span { color: var(--muted); }
.cs-sub:hover { border-color: #d6cfc3; }
.cs-sub.is-on { background: #fff; border-color: var(--wood); color: var(--wood-d); font-weight: 700; }

.cs-results { background: #f1eee8; text-align: center; padding: 10px; font-size: .88rem; font-weight: 700; color: var(--navy); margin-bottom: 24px; }

/* Items: grid */
.cs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.cs-item { display: flex; flex-direction: column; text-align: center; }
.cs-item[hidden] { display: none; }
.cs-img { background: #fff; border: 1px solid var(--line); aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 6%; }
.cs-img > .cs-line, .cs-img > svg, .cs-img > img { width: 75%; height: 75%; max-width: 160px; max-height: 160px; }
.cs-line { width: 100%; height: 100%; font: 600 8px Manrope, sans-serif; fill: #8d5d34; }
.cs-info { padding: 14px 4px 0; flex: 1; }
.cs-title { font-size: .95rem; line-height: 1.35; color: var(--ink); margin: 0 0 8px; font-weight: 800; transition: color .15s; }
.cs-item:hover .cs-title { color: var(--navy-3); }
.cs-item:hover .cs-img { border-color: #cfc8bc; }
.cs-sku { color: var(--wood-d); font-size: .8rem; font-weight: 700; margin: 0 0 2px; text-align: left; }
.cs-dims { color: var(--muted); font-size: .8rem; margin: 0 0 6px; text-align: left; }
.cs-tags { margin: 0 0 6px; text-align: left; display: flex; gap: 4px; flex-wrap: wrap; }
.cs-tag { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--cream); color: var(--navy); padding: 2px 6px; border-radius: 3px; }
.cs-buy { padding: 6px 4px 0; }
.cs-price { font-size: 1.25rem; font-weight: 800; color: var(--navy); margin: 0 0 10px; font-variant-numeric: tabular-nums; text-align: left; }
.cs-price-soon, .cs-price-call { font-size: .9rem; color: var(--muted); font-weight: 700; }
.cs-buy-row { display: flex; align-items: center; gap: 8px; }
.cs-qty-label { margin: 0; font-size: .78rem; color: var(--muted); font-weight: 600; }
.cs-qty { width: 58px; height: 42px; padding: 6px; text-align: center; border-radius: 0; }
.cs-add { flex: 1; height: 42px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; padding: 0 12px; white-space: nowrap; }
.cs-add:hover { background: var(--wood-d); }
.cs-add:disabled { background: #e6e2da; color: var(--muted); cursor: not-allowed; width: 100%; }
.cs-empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* Items: list */
.cs-grid.is-list { grid-template-columns: 1fr; gap: 18px; }
.cs-grid.is-list .cs-item { display: grid; grid-template-columns: 160px 1fr 260px; gap: 24px; text-align: left; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.cs-grid.is-list .cs-item[hidden] { display: none; }
.cs-grid.is-list .cs-info { padding-top: 6px; }
.cs-grid.is-list .cs-title { font-size: 1.02rem; }
.cs-grid.is-list .cs-buy { padding-top: 6px; }

/* Pager */
.cs-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 34px 0 10px; }
.cs-pager button { min-width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
.cs-pager button.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cs-pager button:disabled { opacity: .4; cursor: default; }
.cs-pager .gap { align-self: center; color: var(--muted); padding: 0 4px; }
.cs-footnote { font-size: .78rem; color: var(--muted); text-align: center; margin: 14px auto 0; max-width: 46rem; }

@media (max-width: 1100px) {
  .cs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .cs-top { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .cs-controls { flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .cs-search { max-width: none; }
  .cs-grid.is-list .cs-item { grid-template-columns: 120px 1fr; }
  .cs-grid.is-list .cs-buy { grid-column: 2; }
}
@media (max-width: 700px) {
  .cs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .cs-tiles { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; margin-inline: -14px; padding-inline: 14px; }
  .cs-tile { flex: 0 0 112px; min-height: 92px; scroll-snap-align: start; }
  .cs-subs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .cs-sub { flex: 0 0 auto; white-space: nowrap; }
  .cs-tablist { flex-wrap: nowrap; overflow-x: auto; }
  .cs-tablist [role="tab"] { white-space: nowrap; padding: 10px 12px; font-size: .74rem; }
  .cs-cta-row { grid-template-columns: 1fr; }
  .cs-title { font-size: .84rem; }
  .cs-buy-row { flex-wrap: wrap; }
  .cs-qty-label { display: none; }
  .cs-qty { width: 48px; }
  .cs-add { font-size: .82rem; padding: 0 8px; }
  .cs-sort select { min-width: 0; }
  .cs-search { flex-basis: 100%; }
  .cs-grid.is-list .cs-item { grid-template-columns: 110px 1fr; gap: 12px; }
}
@media (max-width: 340px) { .cs-grid { grid-template-columns: 1fr; } }
