/**
 * Chekkos CWV helpers — reserve image space (CLS) and stabilize LCP containers.
 * Loaded after chekkos-ui.css on the active theme tt_smartbooks2.
 */

/* --- Intrinsic sizing: prevent layout shift before decode --- */
img {
  max-width: 100%;
  height: auto;
}

#logo img,
.logo-container img {
  width: auto;
  max-height: 70px;
  height: auto;
  aspect-ratio: auto 200 / 70;
}

/* Product grid / modules (ocproduct, octab, category, search, related) */
.product-thumb .image,
.product-layout .image,
.product-item .image,
.item-inner .image,
.image-container {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-thumb .image img,
.product-layout .image img,
.product-item .image img,
.item-inner .image img,
.image-container img,
img.img-responsive.img-default-image,
img.img-responsive.has-rotator,
img.img-r {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

/* Product detail LCP image */
.product-image-main .product-zoom-image,
.product-image-main .thumbnails > li:first-child .thumbnail,
.product-image-main a.main-image {
  display: block;
  aspect-ratio: 1 / 1;
  max-width: 100%;
}

.product-image-main .product-zoom-image img,
.product-image-main a.main-image img,
.product-image-main .thumbnails > li:first-child img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.product-image-main .additional-images img,
.product-image-main .image-additional img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Category / home / blog cards */
.category-image img,
.chekkos-categories img,
.chekkos-blog img,
.blog-image img,
.article-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Slideshow / banners: reserve wide hero plane */
.oc-banner7-container,
.nivoSlider,
.banner .swiper-slide,
.swiper-viewport {
  aspect-ratio: 21 / 9;
  max-height: 520px;
}

.nivoSlider img,
.banner .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mini-cart thumbs */
#cart img.cart-image,
.cart-image {
  width: 47px;
  height: 47px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Language flags */
.language-select img,
#form-language img {
  width: 16px;
  height: 11px;
}

/* Mega menu icons */
.top-icon,
.mega-second-image {
  max-width: 100%;
  height: auto;
}

.brand-slider .swiper-slide img,
.brand-slider img {
  width: 160px;
  height: 80px;
  aspect-ratio: 2 / 1;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .nivoSlider img,
  .product-thumb .image img {
    transition: none;
  }
}
