/* ALZATE MARKET V6.172 — MARCO VISUAL UNIFICADO 9:16.
   1080 × 1920 es proporción de referencia, NO redimensionamiento físico.
   Originales intactos; recorte central en imágenes y videos sin solicitudes FFmpeg.
   Cargado DESPUÉS de las reglas históricas de ambas pantallas.
*/
:root{--alzate-media-portrait-v6172:9 / 16}

/* Miniaturas: PRODUCTOS y ARCHIVOS, todo formato visual ocupa 9:16. */
body.gallery-page #galleryGroups .gallery-group-grid>.card[data-kind="image"]>.prev,
body.gallery-page #galleryGroups .gallery-group-grid>.card[data-kind="video"]>.prev,
body.gallery-page #mediaGrid>.card[data-kind="image"]>.prev,
body.gallery-page #mediaGrid>.card[data-kind="video"]>.prev{
  position:relative!important;width:100%!important;height:auto!important;
  aspect-ratio:var(--alzate-media-portrait-v6172)!important;
  overflow:hidden!important;min-height:0!important;
}
body.gallery-page #galleryGroups .gallery-group-grid>.card[data-kind="image"]>.prev img,
body.gallery-page #galleryGroups .gallery-group-grid>.card[data-kind="video"]>.prev video,
body.gallery-page #mediaGrid>.card[data-kind="image"]>.prev img,
body.gallery-page #mediaGrid>.card[data-kind="video"]>.prev video{
  display:block!important;position:absolute!important;inset:0!important;
  width:100%!important;height:100%!important;max-width:100%!important;
  max-height:100%!important;object-fit:cover!important;
  object-position:50% 50%!important;border:0!important;
}

/* Galería: visor expandido compartido por ARCHIVOS y PRODUCTOS.
   Centrar sin transform para no interferir con el gesto del carrusel JS. */
body.gallery-page .gallery-archive-frame-v6136 .gallery-archive-stage-v6136:is([data-current-kind="image"],[data-current-kind="video"]){
  position:absolute!important;inset:0!important;margin:auto!important;
  width:min(100vw,calc(100dvh * 9 / 16))!important;
  height:min(100dvh,calc(100vw * 16 / 9))!important;
  max-width:100vw!important;max-height:100dvh!important;
  aspect-ratio:var(--alzate-media-portrait-v6172)!important;
  overflow:hidden!important;background:#211621!important;
}
body.gallery-page .gallery-archive-frame-v6136 .gallery-archive-stage-v6136:is([data-current-kind="image"],[data-current-kind="video"])::before{
  display:none!important;
}
body.gallery-page .gallery-archive-frame-v6136 .gallery-archive-stage-v6136[data-current-kind="image"]>img,
body.gallery-page .gallery-archive-frame-v6136 .gallery-archive-stage-v6136[data-current-kind="video"]>video{
  display:block!important;position:relative!important;inset:auto!important;
  flex:none!important;width:100%!important;height:100%!important;
  min-width:0!important;min-height:0!important;max-width:100%!important;
  max-height:100%!important;object-fit:cover!important;object-position:center!important;
  background:transparent!important;border:0!important;
}

/* Ventana antigua de vista previa: mismos criterios sólo para foto/video. */
body.gallery-page .gallery-file-dialog .gallery-preview-content>img,
body.gallery-page .gallery-file-dialog .gallery-preview-content>video{
  display:block!important;width:min(100%,calc(65dvh * 9 / 16))!important;
  height:auto!important;aspect-ratio:var(--alzate-media-portrait-v6172)!important;
  max-height:65dvh!important;object-fit:cover!important;object-position:center!important;
  margin-inline:auto!important;
}
body.gallery-page .gallery-photo-frame-v695>img{
  width:100%!important;height:100%!important;object-fit:cover!important;
  object-position:center!important;
}

/* Catálogo: la imagen y el video expandidos recortan para llenar su marco. */
body.lightbox-open #lightboxStage[data-media-kind="image"] .lightbox-track img.lightbox-img,
body.lightbox-open #lightboxStage[data-media-kind="image"] #lightboxTrack img.lightbox-slide{
  object-fit:cover!important;object-position:center!important;
  max-height:100%!important;background:transparent!important;
}
body.lightbox-open #lightboxStage .lightbox-media-surface.is-video-v6142 .catalog-media-frame-v6142 video{
  object-fit:cover!important;object-position:center!important;
  width:100%!important;height:100%!important;max-height:100%!important;
}
