/* RK catalogue — styles for everything js/catalogue.js builds: product cards, the product pop-up,
 * sub category pages and the Catalogue (catalogue-shop.html). Uses the colour and font tokens from
 * css/style.css. Kept separate so the catalogue can later move to its own site. */

/* ─── PRODUCT CARDS ─── */
.listing-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:26px; }
.listing-head h3 { font-family:var(--serif); font-size:24px; font-weight:400; color:var(--charcoal); }
.listing-head span { font-size:12.5px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); }
.listing-open { display:block; width:100%; height:100%; padding:0; border:none; background:none; cursor:pointer; text-align:left; font:inherit; color:inherit; }
.card-name .listing-open { height:auto; }
.card-name .listing-open:hover { color:var(--clay); }
.listing-specs { margin-top:10px; display:grid; gap:4px; font-size:14px; }
.listing-specs div { display:flex; gap:10px; }
.listing-specs dt { color:var(--muted); min-width:100px; }
.listing-specs dd { color:var(--mid); }

/* ─── PRODUCT POP-UP ─── */
.listing-modal { position:fixed; inset:0; z-index:400; display:flex; align-items:center; justify-content:center; padding:24px; }
.listing-modal[hidden] { display:none; }
.listing-modal-backdrop { position:absolute; inset:0; background:rgba(20,18,15,0.55); }
.listing-modal-box {
  position:relative; background:var(--cream); width:100%; max-width:1060px; max-height:calc(100vh - 48px);
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 60px rgba(20,18,15,0.25);
}
.listing-modal-close {
  position:absolute; top:12px; right:14px; z-index:2; width:40px; height:40px; border-radius:50%;
  background:var(--white); border:1px solid var(--line); font-size:22px; line-height:1; cursor:pointer; color:var(--charcoal);
}
.listing-modal-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); overflow-y:auto; flex:1 1 auto; min-height:0; }
.listing-modal-media { background:var(--linen); min-height:100%; }
.listing-modal-media img { width:100%; height:100%; min-height:460px; object-fit:cover; display:block; }
.listing-modal-info { padding:42px 46px 30px; }
.listing-modal-info .eyebrow { padding-right:44px; margin-bottom:10px; }
.listing-modal-info h2 { font-family:var(--serif); font-size:clamp(28px,2.8vw,40px); font-weight:400; line-height:1.15; margin-bottom:22px; color:var(--charcoal); }
.listing-modal-info .spec-table { margin-bottom:26px; }
.listing-modal-info .spec-table td { padding:10px 0; font-size:15px; }
.listing-modal-info .spec-table td:first-child { width:36%; }
.listing-modal-info .spec-table td:last-child { white-space:pre-line; }
.listing-modal-info .pdp-actions { margin-bottom:0; }
.listing-modal-nav {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-top:1px solid var(--line); padding:12px 18px; background:var(--cream); flex-shrink:0;
}
.listing-modal-nav[hidden] { display:none; }
.listing-modal-step {
  width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:var(--white);
  font-size:20px; cursor:pointer; color:var(--charcoal); transition:border-color .2s;
}
.listing-modal-step:hover { border-color:var(--charcoal); }
.listing-modal-count { font-size:13px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); }

/* ─── SUB CATEGORY PAGE (design-gallery.html?id=…) ─── */
.design-gallery-head { padding:44px 0 8px; }
.design-gallery-head .cat { font-size:12.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--clay); margin-bottom:10px; }
.design-gallery-head h1 { font-family:var(--serif); font-size:clamp(32px,3.6vw,50px); font-weight:400; line-height:1.1; margin-bottom:14px; color:var(--charcoal); }
.design-gallery-head p { color:var(--mid); font-size:16px; max-width:660px; margin-bottom:22px; }
.design-gallery-actions { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:40px; }
.dg-products { padding:28px 0 80px; border-top:1px solid var(--line); }
.dg-products .listing-head { justify-content:flex-end; }
.dg-empty { color:var(--mid); padding:20px 0; font-size:15px; }
.dg-empty a { color:var(--clay); border-bottom:1px solid currentColor; }

/* ─── THE CATALOGUE (catalogue-shop.html) — full width, four products per row ─── */
.shop { padding:0 clamp(16px, 3.2vw, 56px); }
.shop-head { padding:56px 0 34px; max-width:720px; }
.shop-head h1 { font-family:var(--serif); font-size:clamp(36px,4vw,58px); font-weight:400; line-height:1.08; color:var(--charcoal); margin-bottom:14px; }
.shop-head p { color:var(--mid); font-size:17px; line-height:1.7; }
.shop-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:clamp(28px,3vw,56px); align-items:start; padding-bottom:100px; }
.shop-filters-box { position:sticky; top:96px; max-height:calc(100vh - 116px); overflow-y:auto; padding-right:6px; }
.shop-filters-toggle { display:none; }

.shop-group { border-bottom:1px solid var(--line); }
.shop-group:first-child { border-top:1px solid var(--line); }
.shop-group summary {
  list-style:none; cursor:pointer; padding:16px 0; display:flex; align-items:center; gap:8px;
  font-size:13px; letter-spacing:0.12em; text-transform:uppercase; color:var(--charcoal); font-weight:500;
}
.shop-group summary::-webkit-details-marker { display:none; }
.shop-group summary::after { content:'+'; margin-left:auto; font-size:18px; color:var(--muted); font-weight:300; }
.shop-group[open] summary::after { content:'–'; }
.shop-group-n { background:var(--clay); color:#fff; border-radius:20px; font-size:11px; padding:1px 7px; letter-spacing:0; }
.shop-group-body { padding:0 0 16px; display:grid; gap:2px; }

.shop-filter {
  display:flex; justify-content:space-between; align-items:baseline; gap:10px; width:100%;
  background:none; border:none; padding:7px 0; cursor:pointer; text-align:left;
  font-family:var(--sans); font-size:15px; color:var(--mid); transition:color .15s;
}
.shop-filter .n, .shop-check .n { font-size:12.5px; color:var(--muted); margin-left:auto; }
.shop-filter:hover { color:var(--charcoal); }
.shop-filter.active { color:var(--charcoal); font-weight:500; }
.shop-filter.active .n { color:var(--clay); }
.shop-filter.is-section { color:var(--charcoal); }
.shop-filter.is-cat { padding-left:14px; font-size:14.5px; border-left:1px solid var(--line); }
.shop-filter.is-cat.active { border-left-color:var(--clay); }

.shop-check { display:flex; align-items:center; gap:10px; padding:6px 0; cursor:pointer; font-size:15px; color:var(--mid); }
.shop-check:hover { color:var(--charcoal); }
.shop-check input { width:17px; height:17px; accent-color:var(--charcoal); margin:0; cursor:pointer; flex-shrink:0; }
.shop-check input:checked ~ span:not(.n) { color:var(--charcoal); font-weight:500; }
.shop-swatch { width:16px; height:16px; border-radius:50%; border:1px solid rgba(43,42,39,0.2); flex-shrink:0; }

.shop-toolbar { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding-bottom:18px; border-bottom:1px solid var(--line); }
.shop-toolbar input[type="search"] {
  flex:1 1 300px; min-width:0; border:1px solid var(--line); background:var(--white); padding:13px 16px;
  font-family:var(--sans); font-size:16px; color:var(--charcoal);
}
.shop-toolbar input[type="search"]:focus { outline:none; border-color:var(--charcoal); }
.shop-sort { display:flex; align-items:center; gap:8px; font-size:12.5px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); }
.shop-sort select { border:1px solid var(--line); background:var(--white); padding:12px 14px; font-family:var(--sans); font-size:15px; color:var(--charcoal); text-transform:none; letter-spacing:0; cursor:pointer; }
.shop-count { margin-left:auto; font-size:13px; letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); white-space:nowrap; }
.shop-chips { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 28px; min-height:4px; }
.shop-chip { border:1px solid var(--line); background:var(--white); padding:7px 14px; font-family:var(--sans); font-size:14px; color:var(--charcoal); cursor:pointer; border-radius:30px; }
.shop-chip span { color:var(--muted); margin-left:4px; }
.shop-chip:hover { border-color:var(--charcoal); }
.shop-chip.is-clear { border-color:transparent; background:none; color:var(--clay); text-decoration:underline; }
.shop-empty { text-align:center; padding:80px 20px; color:var(--mid); }
.shop-empty p { margin-bottom:18px; font-size:16px; }

.shop .product-grid { grid-template-columns:repeat(4, minmax(0,1fr)); gap:44px 28px; }
.shop .card-cat { font-size:12px; margin-bottom:7px; }
.shop .card-name { font-size:18px; margin-bottom:2px; }
.shop .card-media { margin-bottom:18px; }
/* one line per spec on catalogue cards so rows stay even; the pop-up shows the full text */
.shop .listing-specs { grid-template-columns:minmax(0,1fr); }
.shop .listing-specs div { min-width:0; }
.shop .listing-specs dt { min-width:96px; flex-shrink:0; }
.shop .listing-specs dd { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }

@media (max-width:1280px){
  .shop .product-grid { grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width:1080px){
  .shop-layout { grid-template-columns:240px minmax(0,1fr); }
  .shop .product-grid { grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:900px){
  .shop-head { padding:36px 0 22px; }
  .shop-layout { grid-template-columns:1fr; gap:16px; }
  .shop-filters-toggle {
    display:flex; justify-content:space-between; align-items:center; width:100%; padding:14px 16px; cursor:pointer;
    border:1px solid var(--line); background:var(--white); font-family:var(--sans);
    font-size:13px; letter-spacing:0.1em; text-transform:uppercase; color:var(--charcoal);
  }
  .shop-filters-toggle::after { content:'+'; font-size:18px; color:var(--muted); }
  .shop-filters-toggle[aria-expanded="true"]::after { content:'–'; }
  .shop-filters-box { position:static; max-height:none; overflow:visible; padding:0; }
  .shop-filters { display:none; padding:0 16px; border:1px solid var(--line); border-top:none; background:var(--white); }
  .shop-filters-box.open .shop-filters { display:block; }
  .shop-group:first-child { border-top:none; }
  .shop-count { margin-left:0; }
}
@media (max-width:760px){
  .listing-modal { padding:0; align-items:flex-end; }
  .listing-modal-box { max-height:94vh; }
  .listing-modal-body { display:block; }
  .listing-modal-body { grid-template-columns:1fr; }
  .listing-modal-media { min-height:0; }
  .listing-modal-media img { min-height:0; aspect-ratio:4/3; height:auto; }
  .listing-modal-info { padding:26px 20px 24px; }
  .listing-specs { gap:7px; }
  .listing-specs div { flex-direction:column; gap:0; }
  .listing-specs dt { min-width:0; font-size:11px; letter-spacing:0.04em; text-transform:uppercase; }
  .shop .product-grid { gap:30px 14px; }
  .shop .card-name { font-size:16px; }
}

/* ─── collection banner (shown when a collection is picked) ─── */
.shop-collection-note { background:var(--linen); border-left:2px solid var(--clay); padding:16px 20px; margin:0 0 18px; }
.shop-collection-note h2 { font-family:var(--serif); font-size:26px; font-weight:400; line-height:1.2; color:var(--charcoal); }
.shop-collection-note p { margin:6px 0 0; color:var(--mid); font-size:14.5px; line-height:1.55; max-width:640px; }
