.detail-page { background: #f1eee7; }
.detail-main { padding: 34px 0 105px; }
#product-view { min-height: 70vh; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: 12px; }
.breadcrumb a:hover { color: var(--rust-dark); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 66px; align-items: start; }
.product-gallery, .detail-summary { min-width: 0; }
.gallery-main { position: relative; display: grid; place-items: center; aspect-ratio: 1.08; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.gallery-main img { position: absolute; inset: 28px; display: block; width: calc(100% - 56px); height: calc(100% - 56px); object-fit: contain; object-position: center; }
.gallery-caption { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.transition-pending .gallery-main { visibility: hidden; }
.transition-pending .detail-loading, .transition-pending .breadcrumb, .transition-pending .detail-summary, .transition-pending .related-section { opacity: 0; }
.product-flight { position: fixed; z-index: 1000; display: grid; place-items: center; overflow: hidden; pointer-events: none; color: rgba(71,45,28,.74); background: #fff; font-size: 52px; transform-origin: top left; }
.product-flight img { display: block; width: 100%; height: 100%; padding: 20px; object-fit: contain; }
.gallery-placeholder { display: grid; place-items: center; width: 100%; height: 100%; padding: 40px; color: var(--muted); background: #e6e1d8; text-align: center; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 3px; }
.gallery-thumb { flex: 0 0 86px; width: 86px; height: 86px; padding: 6px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.gallery-thumb.active { border-color: var(--rust); box-shadow: 0 0 0 2px rgba(123, 102, 86, .12); }
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.detail-summary { padding-top: 15px; animation: detail-copy-in .72s .16s cubic-bezier(.16, 1, .3, 1) both; }
.transition-pending .detail-summary { animation: none; }
@keyframes detail-copy-in { from { opacity: 0; transform: translateY(24px); } }
.detail-category { color: var(--rust); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.detail-summary h1 { margin: 12px 0 18px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 5vw, 60px); line-height: 1.06; letter-spacing: -.04em; text-wrap: balance; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.detail-meta span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--rust-dark); background: #faf8f4; font-size: 12px; font-weight: 700; }
.detail-lead { margin: 0 0 28px; color: var(--muted); font-size: 16px; }
.purchase-panel { padding: 24px; border: 1px solid rgba(123, 102, 86, .18); border-radius: 20px; background: #e7e1d8; }
.purchase-panel strong { display: block; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.purchase-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.related-section { margin-top: 95px; }
.related-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.related-heading a { color: var(--rust-dark); font-size: 13px; font-weight: 800; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #faf8f4; transition: transform .2s, box-shadow .2s; }
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.related-card img { display: block; width: 100%; height: 170px; padding: 12px; object-fit: contain; background: #fff; }
.related-copy { padding: 16px; }
.related-copy small { color: var(--rust); font-weight: 800; }
.related-copy h3 { margin: 5px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 21px; }
.detail-error { padding: 80px 24px; border-radius: 24px; background: #faf8f4; text-align: center; }
.detail-error h1 { margin-bottom: 12px; font-size: 42px; }
.detail-error p { color: var(--muted); }
@media (max-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 38px; } .gallery-main { max-height: 680px; } }
@media (max-width: 620px) { .detail-main { padding-top: 22px; } .gallery-main { border-radius: 20px; } .gallery-main img { inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); } .gallery-thumb { flex-basis: 72px; width: 72px; height: 72px; } .detail-summary h1 { font-size: 42px; } .purchase-panel { padding: 20px; } .related-grid { grid-template-columns: 1fr; } }

/* Native modal keeps the page inert and provides Escape and focus containment. */
.gallery-open{position:absolute;right:16px;bottom:16px;display:inline-flex;align-items:center;gap:16px;min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit;font-size:14px;cursor:pointer}
.gallery-open[hidden]{display:none}
.gallery-lightbox{width:min(1120px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:0;border-radius:16px;background:var(--paper);color:var(--ink)}
.gallery-lightbox::backdrop{background:rgba(31,31,31,.76)}
.gallery-lightbox-panel{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:16px;height:min(900px,calc(100dvh - 32px));padding:24px}
.gallery-lightbox-toolbar,.gallery-lightbox-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}
.gallery-lightbox-toolbar>span{font-size:14px;font-variant-numeric:tabular-nums;color:var(--muted)}
.gallery-lightbox button{display:inline-flex;align-items:center;justify-content:center;gap:16px;min-height:44px;min-width:44px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--ink);font:inherit;font-size:14px;cursor:pointer}
.gallery-lightbox button:disabled{opacity:.35;cursor:default}
.gallery-lightbox-stage{display:grid;place-items:center;min-height:0;touch-action:pan-y pinch-zoom}
.gallery-lightbox-stage img{display:block;width:100%;height:100%;min-height:0;object-fit:contain}
.gallery-lightbox-stage [hidden]{display:none}
.gallery-lightbox-stage p{font-size:16px;line-height:24px;text-align:center}
.gallery-lightbox-footer>p{flex:1;margin:0;text-align:center;font-size:14px;line-height:20px;color:var(--muted)}
@media(max-width:760px){.gallery-lightbox-panel{padding:16px;gap:12px}.gallery-lightbox-footer{gap:8px}.gallery-lightbox-footer>p{font-size:12px;line-height:16px}}

/* When no shared-image snapshot runs, the native dialog still opens gently. */
@supports (transition-behavior:allow-discrete){
 @media(prefers-reduced-motion:no-preference){
  html:not(.product-zoom-active) .gallery-lightbox{opacity:0;transform:translateY(8px) scale(.985);transition:opacity .28s cubic-bezier(.22,1,.36,1),transform .4s cubic-bezier(.22,1,.36,1),display .4s allow-discrete,overlay .4s allow-discrete}
  html:not(.product-zoom-active) .gallery-lightbox[open]{opacity:1;transform:none}
  html:not(.product-zoom-active) .gallery-lightbox::backdrop{opacity:0;transition:opacity .28s cubic-bezier(.22,1,.36,1),display .4s allow-discrete,overlay .4s allow-discrete}
  html:not(.product-zoom-active) .gallery-lightbox[open]::backdrop{opacity:1}
  html:not(.product-zoom-active) .gallery-lightbox:not([open]),html:not(.product-zoom-active) .gallery-lightbox:not([open])::backdrop{pointer-events:none}
  @starting-style{
   html:not(.product-zoom-active) .gallery-lightbox[open]{opacity:0;transform:translateY(8px) scale(.985)}
   html:not(.product-zoom-active) .gallery-lightbox[open]::backdrop{opacity:0}
  }
 }
}
.gallery-open,.gallery-lightbox button,.gallery-thumb{transition:color .25s cubic-bezier(.22,1,.36,1),border-color .25s cubic-bezier(.22,1,.36,1),background-color .25s cubic-bezier(.22,1,.36,1),transform .3s cubic-bezier(.22,1,.36,1)}
@media(hover:hover) and (pointer:fine){.gallery-open:hover,.gallery-lightbox button:not(:disabled):hover,.gallery-thumb:hover{border-color:var(--rust);color:var(--rust)}}
.gallery-open:active,.gallery-lightbox button:not(:disabled):active,.gallery-thumb:active{transform:translateY(1px)}
@media(prefers-reduced-motion:reduce){.gallery-open,.gallery-lightbox button,.gallery-thumb{transition:none}.gallery-open:active,.gallery-lightbox button:active,.gallery-thumb:active{transform:none}}
