/* Detail page — overrides on top of combo.css base.
   The photograph is a 16:9 plate with a gallery label beneath it (kicker,
   title, one paragraph — no scaffolding). The pieces on the right are an
   accordion: the open row reveals its product photo, shop counterpart,
   price and actions. Everything fits one viewport. */

html,body{overflow:auto;height:auto}   /* combo.css locks scroll for the columns page; undo it here */
body{display:block}
.cb-stage{display:none} /* detail page has its own layout */

.detail{
  display:block;
  margin-top:0;
  background:var(--paper);
}

.detail-grid{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(340px,1fr);
  align-items:stretch;
  height:calc(100vh - 58px); /* one viewport — nothing to scroll */
  min-height:560px;
  overflow:hidden;
}

/* ---------- left: the plate ---------- */
.detail-main{
  border-right:1px solid rgba(var(--ink-rgb),.12);
  min-width:0;min-height:0;
  display:flex;flex-direction:column;justify-content:center;
  padding:clamp(18px,2vw,36px) clamp(22px,2.4vw,44px);
  gap:clamp(16px,1.8vw,26px);
}

/* 16:9, capped so label + plate + meta strip always fit the column */
.detail-hero{
  position:relative;
  width:min(100%, calc((100vh - 360px) * 1.7778));
  margin:0 auto;
  aspect-ratio:16/9;
  overflow:hidden;
  background:rgba(var(--ink-rgb),.06);
  box-shadow:0 18px 60px rgba(31,31,29,.16);
}
.hero-img{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;display:block;
}
.hero-hint{
  position:absolute;right:14px;bottom:12px;
  font-size:8.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:rgba(246,239,224,.75);text-shadow:0 1px 8px rgba(0,0,0,.5);
  pointer-events:none;z-index:3;
}
.hero-markers{position:absolute;inset:0;pointer-events:none;z-index:2}
.hero-markers .combo-marker{pointer-events:auto}

/* the gallery label — a spread above the plate: title anchored left,
   the paragraph as its counterweight on the right, baselines aligned */
.detail-caption{
  width:min(100%, calc((100vh - 360px) * 1.7778));
  margin:0 auto;
  display:flex;flex-direction:row;align-items:flex-end;
  justify-content:space-between;gap:clamp(24px,3vw,56px);
}
.detail-caption-left{
  display:flex;flex-direction:column;gap:7px;flex:none;
}

/* the meta strip — closes the sandwich under the plate */
.detail-meta{
  width:min(100%, calc((100vh - 360px) * 1.7778));
  margin:0 auto;
  display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  border-top:1px solid rgba(var(--ink-rgb),.16);
  padding-top:10px;
}
.detail-meta-left{
  font-size:9px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;
  color:var(--mute);
}
.detail-meta-nav{
  display:flex;align-items:baseline;gap:14px;min-width:0;
}
.detail-meta-link{
  font-size:11px;font-weight:600;letter-spacing:.01em;
  color:var(--mute);transition:color .2s;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;
}
.detail-meta-link:hover{color:var(--accent)}
.detail-meta-idx{
  font-size:9.5px;font-weight:700;letter-spacing:.08em;color:var(--accent);
  font-variant-numeric:tabular-nums;flex:none;
}
.detail-kicker{
  font-size:9.5px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
  color:var(--accent);
}
.detail-kicker span{color:var(--mute)}
.detail-title{
  margin:0;
  font-size:clamp(28px,2.7vw,46px);font-weight:800;letter-spacing:-.03em;line-height:1.0;
  white-space:nowrap;
}
.detail-info-text{
  margin:0;font-size:clamp(11.5px,.82vw,12.5px);line-height:1.6;
  color:var(--mute);
  flex:0 1 auto;max-width:46ch;
  padding-bottom:3px; /* optically sit on the title's baseline */
}

/* ---------- right: the pieces accordion ---------- */
.detail-right{
  display:flex;flex-direction:column;
  padding:clamp(18px,2vw,32px) clamp(20px,2.2vw,36px) clamp(14px,1.5vw,22px);
  min-height:0;overflow:hidden;
}
.detail-items-head{
  display:flex;justify-content:space-between;align-items:baseline;
  font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--mute);
  border-bottom:1px solid var(--rule);
  padding-bottom:10px;
  flex:none;
}
.detail-items{
  list-style:none;margin:0;padding:0;
  display:flex;flex-direction:column;
  flex:0 1 auto;min-height:0;overflow-y:auto;
  scrollbar-width:thin;scrollbar-color:rgba(var(--ink-rgb),.22) transparent;
}
.detail-items::-webkit-scrollbar{width:3px}
.detail-items::-webkit-scrollbar-thumb{background:rgba(var(--ink-rgb),.2)}

.piece{
  border-bottom:1px solid rgba(var(--ink-rgb),.13);
  border-left:2px solid transparent;
  transition:border-left-color .3s;
}
.piece.is-open{border-left-color:var(--accent)}
.piece-head{
  width:100%;display:flex;align-items:baseline;gap:12px;
  padding:14px 4px 14px 8px;
  background:none;border:0;cursor:pointer;
  font-family:inherit;color:inherit;text-align:left;
}
.piece-num{
  flex:none;font-size:9.5px;font-weight:700;letter-spacing:.08em;
  color:var(--accent);font-variant-numeric:tabular-nums;
}
.piece-name{
  flex:1;min-width:0;
  font-size:clamp(13px,.95vw,16px);font-weight:600;letter-spacing:-.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:font-weight .15s;
}
.piece.is-open .piece-name{font-weight:800}
.piece-price{
  flex:none;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;
  color:var(--mute);
}
.piece-plus{width:14px;height:14px;position:relative;opacity:.55;flex:none;align-self:center}
.piece-plus::before,.piece-plus::after{content:"";position:absolute;background:currentColor}
.piece-plus::before{width:14px;height:1.5px;top:6px;left:0}
.piece-plus::after{height:14px;width:1.5px;left:6px;top:0;transition:transform .25s}
.piece.is-open .piece-plus::after{transform:scaleY(0)}

/* CSS-driven expand: the browser interpolates 0fr↔1fr on both rows at
   once, so rapid hover switches glide instead of fighting JS tweens. */
.piece-body{
  display:grid;grid-template-rows:0fr;opacity:0;
  transition:grid-template-rows .55s var(--ease), opacity .4s ease;
}
.piece.is-open .piece-body{grid-template-rows:1fr;opacity:1}
.piece-body-inner{min-height:0;overflow:hidden;padding:0 8px 0 29px}
.piece.is-open .piece-body-inner{padding-bottom:16px}
.piece-photo{
  display:block;width:100%;aspect-ratio:16/9;overflow:hidden;
  background:rgba(var(--ink-rgb),.06);
  border:1px solid rgba(var(--ink-rgb),.14);
  margin-bottom:10px;
}
.piece-photo img{
  width:100%;height:100%;object-fit:cover;display:block;
  transition:transform .6s var(--ease);
}
.piece-photo:hover img{transform:scale(1.045)}
.piece-sub{
  font-size:11px;color:var(--mute);line-height:1.55;margin-bottom:10px;
}
.piece-shopline{
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.piece-shopmeta{display:flex;flex-direction:column;gap:2px;min-width:0}
.piece-shopkicker{
  font-size:8px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--accent);
}
.piece-shopname{
  font-size:12px;font-weight:700;letter-spacing:-.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.piece-actions{display:flex;align-items:center;gap:8px;flex:none}
.piece-cart{
  font-family:inherit;font-size:9.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  background:var(--ink);color:var(--paper);border:1.5px solid var(--ink);
  padding:8px 13px;cursor:pointer;transition:opacity .2s;
}
.piece-cart:hover{opacity:.85}
.piece-view{
  font-size:9.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--accent);border-bottom:1px solid rgba(var(--accent-rgb),.35);
  transition:border-color .2s;
}
.piece-view:hover{border-color:var(--accent)}

/* ---------- the whole room: grounds the rail ---------- */
.detail-total{
  margin-top:auto;flex:none;
  border-top:1.5px solid var(--ink);
  padding-top:14px;
  display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
}
.detail-total-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.detail-total-label{
  font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
}
.detail-total-sub{font-size:10.5px;color:var(--mute)}
.detail-total-right{display:flex;align-items:center;gap:12px;flex:none}
.detail-total-price{
  font-size:clamp(17px,1.5vw,22px);font-weight:900;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
}
.detail-total-cart{
  font-family:inherit;font-size:10px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  background:var(--ink);color:var(--paper);border:1.5px solid var(--ink);
  padding:10px 16px;cursor:pointer;transition:opacity .2s;
}
.detail-total-cart:hover{opacity:.85}

/* ---------- back button ---------- */
.back-btn{
  display:inline-flex;align-items:center;gap:8px;
  font-size:12px;font-weight:600;letter-spacing:.02em;opacity:.5;
  transition:opacity .2s;align-self:flex-start;
}
.back-btn:hover{opacity:1}
.back-btn--rail{margin-top:12px;flex:none}

/* ---------- responsive ---------- */
@media (max-width: 900px){
  .detail-grid{grid-template-columns:1fr;height:auto;overflow:visible}
  .detail-main{border-right:0;justify-content:flex-start}
  .detail-hero,.detail-caption,.detail-meta{width:100%}
  .detail-caption{flex-direction:column;align-items:flex-start;gap:10px}
  .detail-title{white-space:normal}
  .detail-info-text{padding-bottom:0}
  .detail-right{overflow:visible}
  .detail-items{overflow:visible}
}

/* ══════════════ MOBILE (≤699px) — nav handled by combo.css ══════════════ */
@media (max-width:699px){
  .detail-main{padding:14px 14px 20px;gap:14px}
  .detail-hero{box-shadow:0 10px 32px rgba(31,31,29,.14)}
}
