/* Product-detail layout. Gallery keeps the complete image at its natural proportions. */
.tm-product-page .tm-back-mobile { display: none; }
.tm-product-page .product-main-image { padding: 6px; }
.tm-product-page .product-main-image img { object-fit: contain; object-position: center; }
@media (min-width: 761px) {
  .tm-product-page .product-detail-grid > * { min-width: 0; }
}
@media (max-width: 760px) {
  /* Product detail uses one back control; drawer/footer retain other routes. */
  .tm-product-page .tm-header .tm-nav,
  .tm-product-page .tm-header .tm-mega { display: none; }
  .tm-product-page .tm-back-desktop { display: none; }
  .tm-product-page .tm-back-mobile { display: inline; }
  .tm-product-page .tm-header .tm-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .tm-product-page .tm-header .tm-brand { font-size: 14px; white-space: normal; line-height: 1.2; }
  .tm-product-page .tm-header .tm-brand img { flex-shrink: 0; }
  .tm-product-page .product-detail-section { padding-top: 16px; }
  .tm-product-page #productDetail,
  .tm-product-page .product-detail-grid,
  .tm-product-page .product-gallery,
  .tm-product-page .product-info-panel { min-width: 0; max-width: 100%; }
  .tm-product-page .product-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tm-product-page .product-main-image {
    width: 100%; min-width: 0; height: auto; aspect-ratio: 1;
    max-height: 420px; padding: 6px;
  }
  .tm-product-page .product-main-image img { min-width: 0; max-width: 100%; max-height: 100%; }
  .tm-product-page .product-thumbs { max-width: 100%; min-width: 0; }
  .tm-product-page .gallery-controls { flex-wrap: wrap; gap: 8px; }
  .tm-product-page .product-info-panel { overflow-wrap: anywhere; }
  .tm-product-page .detail-market-buy-row { grid-template-columns: minmax(0, 1fr); }
  .tm-product-page .detail-market-buy-row .market-buy-btn { white-space: normal; }
}

/* Position only measured gallery photographs; originals and zoom modal remain intact. */
.tm-product-page .product-main-image,
.tm-product-page .product-thumb { position: relative; }
.tm-product-page .product-main-image > img.tm-detail-image-fitted,
.tm-product-page .product-thumb > img.tm-detail-image-fitted {
  position: absolute; max-width: none; max-height: none; object-fit: contain;
}

/* Compact buying summary; full names, original gallery and order identity stay intact. */
.tm-product-page .product-info-panel { padding-top: 0; }
.tm-product-page .product-brand-line { font-size: 11px; line-height: 1.4; margin-bottom: 8px; }
.tm-product-page .product-info-panel h1 { font-size: clamp(22px, 2vw, 28px); line-height: 1.3; margin: 0 0 12px; overflow-wrap: anywhere; }
.tm-product-page .tm-variants { margin: 12px 0; }
.tm-product-page .tm-variants h2 { margin-bottom: 6px; font-size: 14px; }
.tm-product-page .tm-variant-option { min-height: 54px; padding: 6px; gap: 6px; }
.tm-product-page .tm-variant-option.is-current { padding: 5px; }
.tm-product-page .tm-variant-option img { width: 34px; height: 34px; }
.tm-product-page .product-buy-box { margin-top: 12px; padding: 16px; gap: 10px; }
.tm-product-page .detail-market-buy-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tm-product-page .detail-market-buy-row .market-buy-btn { min-width: 0; min-height: 44px; }
.tm-product-page .tm-product-specs { margin-top: 16px; border-top: 1px solid #e3e5e8; color: #41464d; }
.tm-product-page .tm-product-specs summary { cursor: pointer; padding: 14px 0; min-height: 44px; font-size: 14px; font-weight: 650; }
.tm-product-page .tm-product-specs summary:focus-visible { outline: 3px solid #194f90; outline-offset: 3px; }
.tm-product-page .tm-product-specs .product-detail-desc { margin: 0; font-size: 14px; line-height: 1.6; }
.tm-product-page .tm-product-specs .product-sku { margin-top: 10px; color: #60656b; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .tm-product-page .product-detail-grid { gap: 14px; }
  .tm-product-page .product-info-panel h1 { font-size: 20px; line-height: 1.3; margin-bottom: 10px; }
  .tm-product-page .product-buy-box { padding: 12px; }
}
