/*
 * ČESKÉ PLOTY — homepage carousel jako statický grid
 * Pouze homepage.
 * Desktop: 4 bannery vedle sebe
 * Tablet/mobil: 2x2
 */

body.in-index.type-index {
  --cp-carousel-gap: 10px;
  --cp-carousel-radius: 12px;
  --cp-carousel-shadow: 0 5px 16px rgba(0, 0, 0, 0.10);
  --cp-carousel-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.16);
}

/* Celý blok carouselu */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 10px 0 30px 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

/* Vnitřní obaly */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel .content-wrapper-in,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel .container,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel .row.banners-row,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel .wide-carousel {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: block !important;
  float: none !important;
  overflow: visible !important;
}

/* Samotný carousel */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel.carousel,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel.slide {
  width: 100% !important;
  max-width: 1270px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: block !important;
  overflow: visible !important;
  background: transparent !important;
}

/* Grid přímo nad původním Shoptet carousel-inner */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner {
  width: 100% !important;
  max-width: 1270px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 15px !important;
  box-sizing: border-box !important;

  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, min(310px, calc((100vw - 90px) / 4)))) !important;
  gap: var(--cp-carousel-gap) !important;
  justify-content: center !important;
  align-items: start !important;

  position: relative !important;
  overflow: visible !important;
  transform: none !important;
}

/* Tvrdé vypnutí bootstrap slider chování */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.active,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.next,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.prev,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.left,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.right {
  width: 100% !important;
  max-width: 310px !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;

  display: block !important;
  float: none !important;
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;

  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
}

/* Proklikový banner */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a {
  display: block !important;
  width: 100% !important;
  max-width: 310px !important;
  aspect-ratio: 31 / 50 !important;
  height: auto !important;

  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;

  border-radius: var(--cp-carousel-radius) !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: var(--cp-carousel-shadow) !important;
  text-decoration: none !important;

  transform: translateZ(0) scale(1) !important;
  transition: transform 220ms ease, box-shadow 220ms ease !important;
  will-change: transform !important;
}

/* Obrázek banneru */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a > img,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 0 !important;

  object-fit: cover !important;
  object-position: center center !important;
  border-radius: var(--cp-carousel-radius) !important;
}

/* Schovat ovládání carouselu */
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-control,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-indicators,
body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .extended-banner-texts {
  display: none !important;
}

/* Hover efekt */
@media (hover: hover) and (pointer: fine) {
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a:hover,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a:focus-visible {
    transform: translateZ(0) scale(1.025) !important;
    box-shadow: var(--cp-carousel-shadow-hover) !important;
    z-index: 5 !important;
  }
}

/* Tablet + mobil: 2x2 */
@media screen and (max-width: 991.98px) {
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel {
    max-width: 650px !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner {
    max-width: 650px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    grid-template-columns: repeat(2, minmax(0, calc((100vw - 30px) / 2))) !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a {
    max-width: 310px !important;
  }
}

/* Úzké mobily */
@media screen and (max-width: 420px) {
  body.in-index.type-index {
    --cp-carousel-radius: 10px;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner {
    grid-template-columns: repeat(2, minmax(0, calc((100vw - 30px) / 2))) !important;
    gap: 10px !important;
  }
}

/* =========================================================
   ČESKÉ PLOTY — tvrdá oprava mobilního zobrazení carouselu
   Mobil/tablet: vždy 2 bannery vedle sebe
   ========================================================= */

@media screen and (max-width: 991.98px) {
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel .content-wrapper-in,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel .container,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel .row.banners-row,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel .wide-carousel,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel .content-wrapper-in,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel .container,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel .row.banners-row,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel .wide-carousel {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important;
    float: none !important;
    overflow: visible !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel {
    padding-top: 10px !important;
    padding-bottom: 30px !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel {
    width: 100% !important;
    max-width: 650px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
    display: block !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    background: transparent !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner {
    width: 100% !important;
    max-width: 630px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;

    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    justify-content: center !important;
    align-items: start !important;

    position: static !important;
    overflow: visible !important;
    transform: none !important;
    -webkit-transform: none !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.active,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.next,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.prev,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.left,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.right,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.active,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.next,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.prev,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.left,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item.right {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;

    display: block !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;

    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    -webkit-transform: none !important;
    transition: none !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item > a {
    display: block !important;
    width: 100% !important;
    max-width: 310px !important;
    aspect-ratio: 31 / 50 !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;

    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.10) !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item img,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-inner > .item img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;

    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 10px !important;
  }

  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-control,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-indicators,
  body.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .extended-banner-texts,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-control,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .carousel-indicators,
  body.mobile.in-index.type-index .content-wrapper.homepage-box.before-carousel #carousel .extended-banner-texts {
    display: none !important;
  }
}