/* MJ homepage banners, 2026-11-27, v1.
   Scope: homepage main carousel + two adjacent banners only.
   No JavaScript. Existing images, links and opening-hours widget unchanged.
   Rollback: remove the link to this file from Shoptet HEAD and publish.
*/

/* Step 1: no redundant carousel navigation for a single slide. */
body.type-index #carousel:has(> .carousel-inner > .item:only-child) > .carousel-indicators {
  display: none !important;
}

/* Step 2: keep original image proportions, with both gaps at 20px.
   L + R + 20 = W; L*481/1060 = 2*R*240/341 + 20.
   Applies only to the verified 1+2 structure and image dimensions.
   Additional slides/banners or different image dimensions restore native layout.
*/
@media (min-width: 768px) {
body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(24.3781035372% - 15.6202318299px);
  column-gap: 20px;
  align-items: start;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"])))::before,
body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"])))::after {
  display: none;
  content: none;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) > .col-sm-8,
body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) > .col-sm-4 {
  float: none;
  width: auto;
  min-width: 0;
  padding: 0;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) #carousel > .carousel-inner {
  min-height: 0 !important;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) .next-to-carousel-banners {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 20px;
  align-content: start;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) .next-to-carousel-banners > .banner-wrapper {
  margin: 0;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) #carousel > .carousel-inner > .item > a,
body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) .next-to-carousel-banners > .banner-wrapper > a {
  display: block;
  width: 100%;
}

body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) #carousel > .carousel-inner > .item > a > img,
body.type-index .before-carousel .row.banners-row:has(> .col-sm-8:first-child + .col-sm-4:last-child):has(> .col-sm-8 #carousel > .carousel-inner > .item:only-child img[width="1060"][height="481"]):has(> .col-sm-4 .next-to-carousel-banners > .banner-wrapper:first-child + .banner-wrapper:last-child):not(:has(> .col-sm-4 .next-to-carousel-banners img:not([width="341"][height="240"]))) .next-to-carousel-banners > .banner-wrapper > a > img {
  display: block;
  width: 100%;
  height: auto;
}

}
