/* El formulario comparte tamaños táctiles y rejilla entre el portal y el panel de Cube. */
#product-form .field[hidden], #product-form [hidden], .product-photo-viewer [hidden] { display: none; }
.product-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 126px), 1fr));
  gap: .65rem;
  padding: 0;
  margin: .8rem 0;
  list-style: none;
}
.product-photo-list li { min-width: 0; border: 1px solid currentColor; border-radius: 14px; overflow: hidden; }
.product-photo-list img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #84919e14; }
.product-photo-tools { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-inline: .45rem; font-size: .85rem; }
.product-photo-tools button { min-height: 44px; min-width: 44px; background: transparent; color: inherit; border: 0; cursor: pointer; }
.product-photo-tools [data-photo-edit="remove"] { font-size: 1.5rem; }
#product-photo-status { overflow-wrap: anywhere; }
.product-sale-preview { min-height: 1.5em; font-size: .92rem; font-weight: 600; }
.market-product-photo, .skin-product-picture, .product-gallery { position: relative; }
.product-sale-tag {
  position: absolute;
  z-index: 1;
  inset: .65rem auto auto .65rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 8px;
  padding: .34rem .6rem;
  background: #b51d32;
  color: #fff;
  font-size: .85rem;
  font-weight: 750;
  pointer-events: none;
}
.product-sale-tag svg { width: 1rem; height: 1rem; }
.market-product-content > p, #modal.market-product-dialog .compact-product-info p {
  font-size: max(16px, 1.05rem);
  line-height: 1.55;
  color: var(--market-user-text, inherit);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.market-product-content > p:not(.market-no-description) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
#modal.market-product-dialog .compact-product-info:has(.product-gallery) { display: grid; grid-template-columns: minmax(0, 1fr); }
.product-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 16px;
  background: #84919e14;
  direction: ltr;
}
.product-gallery-track::-webkit-scrollbar { display: none; }
.product-gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  height: clamp(200px, 48vw, 420px);
  padding: 0;
  border: 0;
  background: transparent;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.product-gallery-slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-gallery-nav, .product-gallery-nav > div, .market-pagination { display: flex; align-items: center; justify-content: center; gap: .65rem; flex-wrap: wrap; }
.product-gallery-nav { justify-content: space-between; padding-top: .35rem; font-size: .88rem; }
.product-gallery-nav button, .market-pagination button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding-inline: .8rem;
  font-weight: 650;
}
.product-gallery-nav button:disabled, .market-pagination button:disabled { opacity: .45; }
.market-pagination { margin-block: 1.5rem; }
.market-pagination-status { font-variant-numeric: tabular-nums; }
.product-photo-viewer[open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  border-radius: 0;
  background: #101419;
  color: #fff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.product-photo-viewer::backdrop { background: #101419; }
.product-viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: .45rem .75rem; gap: .6rem; }
.product-viewer-bar strong { overflow-wrap: anywhere; }
.product-viewer-controls { justify-content: center; }
.product-viewer-bar button { min-width: 44px; min-height: 44px; border: 1px solid #ffffff50; border-radius: 50%; background: #ffffff17; color: white; font-size: 1.35rem; }
.product-viewer-bar button:disabled { opacity: .42; }
.product-viewer-viewport { overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.product-viewer-viewport > div { display: flex; width: max-content; height: max-content; min-width: 100%; min-height: 100%; }
.product-viewer-viewport img { display: block; margin: auto; max-width: none; max-height: none; object-fit: contain; flex: none; }
.product-viewer-viewport img:not([style]) { max-width: 100vw; max-height: 75dvh; }
@media (max-width: 700px) {
  #product-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  #product-form :is(input:not([type="checkbox"]), select, textarea) { font-size: 16px; }
  #product-form .photo-actions .btn { min-height: 44px; }
}
