/* SPS TRACK mobile Chrome layout and animation fixes, 2026-11-18.
   Loaded after generated site.css; keep existing page styling intact. */

/* Product source photos are often portrait (e.g. 1122x1402).
   Position them inside a definite image frame to avoid CSS grid's
   intrinsic image height exceeding the card and being cropped. */
body.sps-public-theme .sps-family-card .product-picture{
  position:relative;
  display:block;
  overflow:hidden;
  height:clamp(230px,28vw,310px);
  min-height:0;
  aspect-ratio:auto;
}
body.sps-public-theme .sps-family-card .product-picture img{
  position:absolute;
  inset:12px;
  width:calc(100% - 24px);
  height:calc(100% - 24px);
  max-width:calc(100% - 24px);
  max-height:calc(100% - 24px);
  display:block;
  margin:0;
  object-fit:contain;
  object-position:center;
  transform:none;
}
body.sps-public-theme .sps-family-card .product-picture .cat-chip,
body.sps-public-theme .sps-family-card .product-picture .sps-new-tag{z-index:2;}
@media(max-width:760px){
  /* Make vehicle movement noticeable without hiding content or replacing
     the GPS-only hero. The base SVG continues to animate via JS. */
  body.sps-public-theme .sps-ref-hero .sps-ref-art{
    animation-duration:11s;
    animation-timing-function:ease-in-out;
    will-change:transform;
    backface-visibility:hidden;
  }
  /* Keep embedded media inside its frame without chopping off content. */
  body.sps-public-theme .sps-cctv-video-frame{
    width:100%;
    max-width:100%;
    overflow:hidden;
  }
  body.sps-public-theme .sps-cctv-video-frame video{
    max-width:100%;
    object-fit:contain;
    background:#071824;
  }
  body.sps-public-theme .sps-showcase-hero img,
  body.sps-public-theme .sps-showcase-lightbox-content img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
  }
}
@media(max-width:520px){
  /* More vertical space for full-height tracker and dashcam photographs. */
  body.sps-public-theme .sps-family-card .product-picture{
    height:clamp(255px,74vw,310px);
  }
}
@media(prefers-reduced-motion:reduce){
  /* Respect the viewer's accessibility preference. */
  body.sps-public-theme .sps-ref-hero .sps-ref-art{
    animation:none!important;
  }
}

/* Customer-reported mobile Chrome animation: no long motionless holds. */
@media(max-width:760px) and (prefers-reduced-motion:no-preference){
  body.sps-public-theme .sps-ref-hero .sps-ref-art{
    animation:spsMobileRoadPanContinuous 12s ease-in-out infinite alternate;
    will-change:transform;
  }
  @keyframes spsMobileRoadPanContinuous{
    0%{transform:translate3d(12%,0,0)}
    50%{transform:translate3d(-18%,0,0)}
    100%{transform:translate3d(22%,0,0)}
  }
}
/* Keep source device photography fully visible in desktop catalog cards. */
@media(min-width:761px){
 body.sps-public-theme .sps-family-card .product-picture img{
   object-fit:contain!important;
   object-position:center center!important;
 }
}

/* All-device image visibility: maintain the complete photo within its frame.
   Restrict these overrides to SPS TRACK public pages and avoid cover cropping. */
body.sps-public-theme :is(.product-picture,.sps-showcase-stage,.sps-showcase-hero,.pdp-art,.pdp-image,.corp-type-media,.cart-item-img,.checkout-line-img){min-width:0;max-width:100%;box-sizing:border-box}
body.sps-public-theme :is(.sps-family-card .product-picture img,.sps-showcase-hero img,.sps-showcase-thumb img,.sps-dashcam-thumb img,.sps-showcase-lightbox-content img,.pdp-image img,.corp-type-media img,.cart-item-img img,.checkout-line-img img){object-fit:contain!important;object-position:center!important;min-width:0;min-height:0}
body.sps-public-theme .sps-family-card .product-picture{height:clamp(215px,26vw,310px);min-height:0;overflow:hidden}
body.sps-public-theme .sps-family-card .product-picture img{inset:12px;width:calc(100% - 24px);height:calc(100% - 24px);max-width:calc(100% - 24px);max-height:calc(100% - 24px);filter:none}
body.sps-public-theme .sps-showcase-hero{min-width:0;max-width:100%;overflow:hidden}
body.sps-public-theme .sps-showcase-hero img{width:100%;height:100%;max-height:100%;max-width:100%;display:block}
body.sps-public-theme .sps-showcase-thumbs{min-width:0;max-width:100%}
body.sps-public-theme .sps-showcase-lightbox-content img{max-width:100%;max-height:calc(100dvh - 114px);height:auto}
body.sps-public-theme .corp-type-media img{max-height:90%;max-width:90%;width:auto;height:auto}
@media(max-width:760px){
 body.sps-public-theme .sps-family-card .product-picture{height:clamp(180px,48vw,280px)}
 body.sps-public-theme .sps-showcase-hero{height:clamp(270px,78vw,450px)}
 body.sps-public-theme .sps-showcase-lightbox-content img{max-height:calc(100dvh - 125px)}
}
@media(max-width:520px){
 body.sps-public-theme .sps-family-card .product-picture{height:clamp(215px,75vw,315px)}
 body.sps-public-theme .sps-family-card .product-picture img{inset:10px;width:calc(100% - 20px);height:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100% - 20px)}
 body.sps-public-theme .sps-showcase-thumb img{width:100%;height:65px}
}
