/* Shared catalog: fixed card anatomy, fluid columns and accessible native detail dialog. */
[data-catalog-category], .tr-product-dialog {
  --catalog-surface: #fff;
  --catalog-text: #17233b;
  --catalog-muted: #56647b;
  --catalog-border: #dce4f0;
  --catalog-soft: #f2f6fc;
  --catalog-accent: #224494;
  --catalog-stock-bg: #dcf7e9;
  --catalog-stock-text: #176244;
  --catalog-empty-bg: #fceae5;
  --catalog-empty-text: #94452e;
  color: var(--catalog-text);
}
.dark [data-catalog-category], .dark .tr-product-dialog {
  --catalog-surface: #092b66;
  --catalog-text: #f5f9ff;
  --catalog-muted: #c1cee4;
  --catalog-border: #38517e;
  --catalog-soft: #123671;
  --catalog-accent: #cfdeff;
  --catalog-stock-bg: #164d42;
  --catalog-stock-text: #c0f3dc;
  --catalog-empty-bg: #613d38;
  --catalog-empty-text: #ffe0d4;
}
.tr-catalog-container { width: 100%; max-width: 1800px; margin-inline: auto; }
#catalogoGrid.tr-catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 24px; }
.tr-product-card { min-width: 0; scroll-margin-top: 110px; border: 1px solid var(--catalog-border); border-radius: 18px; background: var(--catalog-surface); box-shadow: 0 3px 14px #15356706; transition: border-color .2s, box-shadow .2s; }
.tr-product-card:hover { border-color: var(--catalog-accent); box-shadow: 0 8px 24px #15356712; }
.tr-product-card-button { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; text-align: left; cursor: pointer; color: inherit; }
.tr-product-media { display: flex; position: relative; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; color: #56647b; }
.tr-product-media img { width: 100%; height: 100%; object-fit: contain; }
.tr-product-media--fallback { gap: 10px; flex-direction: column; padding: 16px; text-align: center; overflow-wrap: anywhere; background: var(--catalog-soft); color: var(--catalog-muted); }
.tr-product-media-label { font-size: .8rem; }
.tr-product-card-content { display: flex; flex: 1; flex-direction: column; gap: 8px; width: 100%; padding: 14px; }
.tr-product-collection { min-height: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 600; color: var(--catalog-muted); }
.tr-product-card-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; height: 2.8em; overflow: hidden; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.4; font-weight: 700; }
.tr-product-card-price { margin-top: 4px; color: var(--catalog-accent); font-size: 1.125rem; line-height: 1.4; font-weight: 800; font-variant-numeric: tabular-nums; }
.tr-product-card-unit { min-height: 2.7em; font-size: .75rem; line-height: 1.35; color: var(--catalog-muted); }
.tr-product-stock { align-self: flex-start; display: inline-flex; border-radius: 999px; padding: 4px 9px; background: var(--catalog-stock-bg); color: var(--catalog-stock-text); font-size: .75rem; font-weight: 700; }
.tr-product-stock.is-unavailable { background: var(--catalog-empty-bg); color: var(--catalog-empty-text); }
.tr-product-card-action { display: block; margin-top: auto; padding: 11px 6px; border-radius: 10px; background: #224494; color: #fff; font-size: .8rem; font-weight: 700; text-align: center; }
.tr-product-dialog { box-sizing: border-box; width: min(1120px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--catalog-border); border-radius: 24px; background: var(--catalog-surface); box-shadow: 0 28px 100px #02061760; overflow-y: auto; overscroll-behavior: contain; }
.tr-product-dialog::backdrop { background: #07142caa; backdrop-filter: blur(6px); }
.tr-product-dialog-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--catalog-border); background: var(--catalog-surface); color: var(--catalog-muted); font-size: .85rem; }
.tr-product-close { flex-shrink: 0; min-height: 44px; padding: 8px 16px; border: 1px solid var(--catalog-border); border-radius: 999px; color: var(--catalog-text); font-weight: 700; cursor: pointer; }
.tr-product-close:hover { background: var(--catalog-soft); }
.tr-product-dialog-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 32px; padding: 24px; }
.tr-product-gallery { position: sticky; top: 98px; min-width: 0; }
.tr-product-gallery-main { display: block; position: relative; width: 100%; overflow: hidden; border: 1px solid var(--catalog-border); border-radius: 18px; cursor: zoom-in; }
.tr-product-gallery-main:disabled { cursor: default; }
.tr-product-gallery-main .tr-product-media { aspect-ratio: 1; }
.tr-product-gallery-main img { transition: transform .2s; }
.tr-product-gallery-main.is-zoomed { cursor: zoom-out; touch-action: manipulation; }
.tr-product-gallery-main.is-zoomed img { transform: scale(2.25); }
.tr-product-zoom-hint { position: absolute; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 999px; background: #17233be8; color: #fff; font-size: .75rem; font-weight: 600; pointer-events: none; }
.tr-product-gallery-caption { margin-top: 12px; color: var(--catalog-muted); font-size: .875rem; }
.tr-product-thumbnails { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tr-product-thumbnail { width: 64px; overflow: hidden; border: 2px solid var(--catalog-border); border-radius: 10px; cursor: pointer; }
.tr-product-thumbnail[aria-pressed="true"] { border-color: var(--catalog-accent); }
.tr-product-info { min-width: 0; }
.tr-product-title { margin-top: 8px; font-size: clamp(1.4rem, 2vw, 1.875rem); line-height: 1.25; font-weight: 800; overflow-wrap: anywhere; }
.tr-product-code { margin-top: 12px; color: var(--catalog-muted); font-size: .8rem; overflow-wrap: anywhere; }
.tr-product-detail-price { margin-top: 20px; color: var(--catalog-accent); font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tr-product-sale { margin-top: 4px; color: var(--catalog-muted); font-size: .875rem; line-height: 1.6; }
.tr-product-info > .tr-product-stock { margin-top: 14px; }
.tr-product-form { margin-top: 22px; }
.tr-product-field-label { display: block; margin-bottom: 8px; font-size: .875rem; font-weight: 700; }
.tr-product-input { box-sizing: border-box; display: block; width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--catalog-border); border-radius: 10px; padding: 10px 12px; background: var(--catalog-surface); color: var(--catalog-text); font-size: 1rem; }
.tr-product-input:disabled { opacity: .55; cursor: not-allowed; }
.tr-product-color-search { margin-bottom: 8px; background: var(--catalog-soft); }
.tr-product-color-result { margin-top: 8px; color: var(--catalog-muted); font-size: .75rem; line-height: 1.5; }
.tr-product-purchase-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: end; gap: 12px; margin-top: 18px; }
.tr-product-add { min-height: 46px; border-radius: 10px; padding-inline: 16px; }
.tr-product-feedback { margin-top: 12px; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; color: var(--catalog-stock-text); }
.tr-product-feedback:empty { display: none; }
.tr-product-feedback.is-error { color: var(--catalog-empty-text); }
.tr-product-feedback a { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.tr-product-description-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--catalog-border); }
.tr-product-description-section h3 { font-size: 1rem; font-weight: 800; }
.tr-product-description { margin-top: 12px; font-size: .9375rem; line-height: 1.8; color: var(--catalog-muted); overflow-wrap: anywhere; }
.tr-product-description p + p { margin-top: 14px; }
.tr-product-description h4 { margin-top: 20px; margin-bottom: 8px; font-weight: 700; color: var(--catalog-text); }
.tr-product-description ul { padding-left: 20px; list-style: disc; }
.tr-product-description strong { color: var(--catalog-text); font-weight: 600; }
.tr-product-dialog [hidden] { display: none !important; }
@media (min-width: 700px) { #catalogoGrid.tr-catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { #catalogoGrid.tr-catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { #catalogoGrid.tr-catalog-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1680px) { #catalogoGrid.tr-catalog-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 699px) {
  [data-catalog-category] { padding-inline: 16px; }
  #catalogoGrid.tr-catalog-grid { gap: 12px; }
  .tr-product-card { border-radius: 14px; }
  .tr-product-card-content { padding: 12px; }
  .tr-product-card-price { font-size: 1rem; }
  .tr-product-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .tr-product-dialog-header { padding: 10px 16px; }
  .tr-product-dialog-body { grid-template-columns: 1fr; gap: 22px; padding: 16px; }
  .tr-product-gallery { position: static; }
  .tr-product-gallery-main .tr-product-media { aspect-ratio: 4 / 3; }
  .tr-product-gallery-main img { max-height: 52dvh; }
  .tr-product-title { font-size: 1.5rem; }
  .tr-product-purchase-row { grid-template-columns: 82px minmax(0, 1fr); }
  .tr-product-add { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { .tr-product-card, .tr-product-gallery-main img { transition: none; } }
