/*
 * MichaelaStore - doplnkove bannery na homepage
 * Desktop zachovava povodne rozlozenie sablony.
 * Tablet a mobil pouzivaju horizontalny free-scroll bez snapovania.
 */

/* Zaoblenie bannerov na vsetkych velkostiach displeja. */
body.type-index #content > .banners-row > .next-to-carousel-banners .banner-wrapper,
body.type-index #content > .banners-row > .next-to-carousel-banners .banner-wrapper > a,
body.type-index #content > .banners-row > .next-to-carousel-banners .banner-wrapper img {
  border-radius: 8px;
}

body.type-index #content > .banners-row > .next-to-carousel-banners .banner-wrapper {
  overflow: hidden;
}

body.type-index .ms-banners-dots {
  display: none;
}

@media (max-width: 991.98px) {
  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-behavior: auto;
    scroll-snap-type: none !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    touch-action: pan-x pan-y;
  }

  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel::-webkit-scrollbar {
    display: none;
  }

  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel.is-dragging {
    cursor: grabbing;
    user-select: none;
  }

  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel > .banner-wrapper {
    flex: 0 0 calc(50% - 6px) !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    scroll-snap-align: none !important;
  }

  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel > .banner-wrapper > a {
    display: block;
    width: 100%;
    height: 100%;
  }

  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel > .banner-wrapper img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    -webkit-user-drag: none;
  }

  body.type-index .ms-banners-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 18px;
    margin: -6px 0 14px;
  }

  body.type-index .ms-banners-dot {
    width: 6px;
    height: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d4d0cd;
    box-shadow: none;
    opacity: 0.85;
    cursor: pointer;
    transition: width 160ms ease, border-radius 160ms ease, background-color 160ms ease;
  }

  body.type-index .ms-banners-dot:hover,
  body.type-index .ms-banners-dot:focus-visible {
    background: #8b6c5a;
  }

  body.type-index .ms-banners-dot:focus-visible {
    outline: 2px solid #8b6c5a;
    outline-offset: 3px;
  }

  body.type-index .ms-banners-dot.is-active {
    width: 16px;
    border-radius: 999px;
    background: #624536;
  }
}

@media (max-width: 575.98px) {
  body.type-index #content > .banners-row > .next-to-carousel-banners.ms-banners-carousel > .banner-wrapper {
    /* Jeden velky banner + jemny nahlad dalsieho. */
    flex-basis: calc(100% - 52px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.type-index .ms-banners-dot {
    transition: none;
  }
}
