/* Tractorio Photo Presentation Standard V1 — 2026-09-10.
   Real product photos sit on white stages and are never cropped by UI containers. */
:root{--t3-photo-surface:#fff;--t3-photo-placeholder:#f8fafc;--t3-photo-border:#e2e8f0}

/* Canonical product gallery */
.product-v4-stage:not(.product-v4-stage--placeholder),.product-v4-stage__image,.product-v4-thumb,.product-v4-offer-image{background:var(--t3-photo-surface)!important}
.product-v4-stage__image img,.product-v4-thumb img,.product-v4-offer-image img{box-sizing:border-box;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}
.product-v4-thumb{width:54px!important;height:54px!important;flex:0 0 54px!important;aspect-ratio:1/1;padding:4px!important}
.product-v4-thumb.is-active{padding:3px!important}
.product-v4-stage--placeholder,.product-v4-no-photo{background:var(--t3-photo-placeholder)}

/* Seamless white canvas for real photos. */
.product-v4-gallery:has(.product-v4-stage__image){background:var(--t3-photo-surface)!important}
.product-v4-gallery:not(:has(.product-v4-thumbs)):has(.product-v4-stage__image){grid-template-columns:minmax(0,1fr)!important}
.product-v4-gallery:has(.product-v4-stage__image) .product-v4-stage{width:100%;min-width:0;height:100%;padding:0!important;background:var(--t3-photo-surface)!important}
.product-v4-gallery:has(.product-v4-stage__image) .product-v4-stage__image{box-sizing:border-box;width:100%;height:100%;padding:0!important;border:0!important;border-radius:0!important;background:var(--t3-photo-surface)!important;box-shadow:none!important}
.product-v4-gallery:has(.product-v4-stage__image) .product-v4-stage__image img{box-sizing:border-box;width:100%!important;height:100%!important;padding:18px;border:0!important;border-radius:0!important;background:var(--t3-photo-surface)!important;box-shadow:none!important;object-fit:contain!important;object-position:center}

/* Public catalog/search cards */
.catalog-v2-item__media{background:var(--t3-photo-surface)!important}
.catalog-v2-item__media img{box-sizing:border-box;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}
.catalog-v2-item__placeholder{width:100%;height:100%;background:var(--t3-photo-placeholder)!important}
.catalog-v2-products--grid .catalog-v2-item__media{aspect-ratio:1/1}

/* Seller offer comparison / quick view */
.seller-offer-table__media,.seller-offer-quick__stage,.seller-offer-quick__thumbs button{background:var(--t3-photo-surface)!important}
.seller-offer-table__media img,.seller-offer-quick__stage img,.seller-offer-quick__thumbs img{box-sizing:border-box;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}
.seller-offer-table__placeholder,.seller-offer-quick__no-photo{width:100%;height:100%;background:var(--t3-photo-placeholder)!important}

/* Seller workspace */
.personal-product-thumb,.seller-catalog-thumb,.seller-editor-media-card__image{background:var(--t3-photo-surface)!important;aspect-ratio:1/1}
.personal-product-thumb img,.seller-catalog-thumb img,.seller-editor-media-card__image img{box-sizing:border-box;width:100%;height:100%;padding:4px;object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}

/* Public seller product hero */
.seller-product-public-page img.object-contain{object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}
.seller-product-public-page .bg-slate-50:has(>img.object-contain){background:var(--t3-photo-surface)!important}

/* Product 360 / admin */
.admin-product360-media-stage,.admin-product360-thumb{background:var(--t3-photo-surface)!important}
.admin-product360-media-stage img,.admin-product360-thumb img{box-sizing:border-box;width:100%;height:100%;object-fit:contain!important;object-position:center;background:var(--t3-photo-surface)!important}
.admin-product360-media-stage img{padding:16px!important}
.admin-product360-thumb{aspect-ratio:1/1}.admin-product360-thumb img{padding:5px!important}
.admin-product360-media-stage:has(.admin-product360-media-empty){background:var(--t3-photo-placeholder)!important}

/* Fullscreen viewer.
   The active image gets an explicit safe rectangle inside the white stage. This avoids the
   legacy width:100%/height:100% grid sizing from product-page.css and guarantees that no
   source edge can touch or disappear behind the rounded stage edge. */
.product-v4-lightbox{box-sizing:border-box;padding:42px 72px 56px!important;background:rgba(2,6,23,.92)!important}
.product-v4-lightbox__stage{position:relative!important;box-sizing:border-box;width:min(1320px,calc(100vw - 144px))!important;height:min(800px,calc(100vh - 128px))!important;height:min(800px,calc(100dvh - 128px))!important;max-width:100%;max-height:100%;overflow:hidden;border:1px solid rgba(255,255,255,.28);border-radius:16px;background:var(--t3-photo-surface)!important;padding:0!important;box-shadow:0 26px 80px rgba(0,0,0,.28)}
.product-v4-lightbox__stage img{position:absolute!important;top:28px!important;left:28px!important;display:none;box-sizing:border-box;width:calc(100% - 56px)!important;height:calc(100% - 56px)!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;object-fit:contain!important;object-position:center!important;background:var(--t3-photo-surface)!important}
.product-v4-lightbox__stage img.is-active{display:block!important}
.product-v4-lightbox:not(:has([data-lightbox-image]:nth-of-type(2))) .product-v4-lightbox__nav{display:none!important}

@media(max-width:760px){
  .admin-product360-media-stage img{padding:11px!important}
}

@media(max-width:620px){
  .product-v4-thumb{width:52px!important;height:52px!important;flex-basis:52px!important}
  .product-v4-gallery:has(.product-v4-stage__image) .product-v4-stage__image img{padding:12px}
  .product-v4-lightbox{padding:54px 14px 46px!important}
  .product-v4-lightbox__stage{width:calc(100vw - 28px)!important;height:calc(100vh - 112px)!important;height:calc(100dvh - 112px)!important;border-radius:11px}
  .product-v4-lightbox__stage img{top:14px!important;left:14px!important;width:calc(100% - 28px)!important;height:calc(100% - 28px)!important}
  .product-v4-lightbox__counter{bottom:13px}
}
