body:has(#productDetail[open]) { overflow: hidden; }

.card-detail-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: inherit;
  padding: 0;
  font: inherit;
}
.card-detail-trigger:hover { color: #745008; }
.visual .card-detail-trigger { display: grid; height: 100%; grid-template-rows: minmax(0, 1fr); place-items: center; }
.visual .badge { z-index: 1; pointer-events: none; }
.card-product-photo { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.card-detail-trigger:focus-visible { outline-offset: -3px; }

#productDetail {
  width: min(916px, calc(100% - 36px));
  max-width: none;
  max-height: min(90dvh, 820px);
  border: 0;
  border-radius: 24px;
  padding: 0;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 90px #08152259;
}
#productDetail[open] { display: flex; flex-direction: column; }
#productDetail::backdrop { background: #081725a6; }
.detail-header, .detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; }
.detail-header { border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 800; }
.detail-header .icon-btn { min-width: 44px; min-height: 44px; }
.detail-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; }
.detail-main { display: grid; grid-template-columns: 1.1fr 1fr; align-items: start; gap: 28px; }
.detail-info h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.13; margin: 8px 0 12px; overflow-wrap: anywhere; }
.detail-info p { line-height: 1.5; }
.detail-frame { position: relative; border: 1px solid var(--line); border-radius: 18px; background: #f2f5f8; }
.detail-photo {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  height: clamp(190px, 40dvh, 360px);
  padding: 12px;
  touch-action: pan-y pinch-zoom;
}
.detail-photo img, .detail-photo svg { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.detail-arrow { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--navy); font-size: 24px; }
#detailPrev { left: 8px; }
#detailNext { right: 8px; }
.detail-dots { display: flex; justify-content: center; }
.detail-dots button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; }
.detail-dots button::before { content: ''; width: 9px; height: 9px; border-radius: 9px; background: #a4b3bf; }
.detail-dots button[aria-current="true"]::before { width: 22px; background: var(--navy); }
.detail-rental { background: #f2f5f8; border-radius: 14px; padding: 14px; }
.detail-rental h3 { margin: 0 0 12px; font-size: 16px; }
.detail-rental p { margin: 0; }
.detail-related { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-related h3 { margin: 0 0 12px; }
.detail-related-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.detail-related-item { display: grid; gap: 6px; text-align: left; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); overflow-wrap: anywhere; }
.detail-related-item:hover { border-color: #a7bccb; }
.detail-related-item img, .detail-related-item svg { width: 100%; height: 78px; object-fit: contain; background: #f2f5f8; border-radius: 7px; }
.detail-footer { border-top: 1px solid var(--line); background: #fff; }
.detail-footer .btn { min-height: 46px; }
.detail-footer .icon-btn { min-height: 46px; }
.detail-footer .price { margin: 0; white-space: nowrap; }
.detail-footer-actions { display: flex; gap: 8px; }
.detail-status { margin: 4px 0 0; }
.detail-status:empty { display: none; }
#productDetail [hidden] { display: none; }

@media (max-width: 650px) {
  #productDetail { inset: auto 0 0; margin: 0; width: 100%; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .detail-header, .detail-footer { padding: 10px 14px; }
  .detail-scroll { padding: 14px; }
  .detail-main { grid-template-columns: 1fr; gap: 12px; }
  .detail-photo { height: clamp(150px, 31dvh, 290px); }
  .detail-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-footer { align-items: stretch; flex-direction: column; gap: 6px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .detail-footer-actions .btn { flex: 1; }
}
