/* Home page and product page lists. Everything is limited to phones (767px and less), except the slider frame below. */

.vg-home-categories {
  display: none;
}

/* No white strip between the blog block and the newsletter (all screen sizes) */
#smartblog_block {
  margin-bottom: 0;
}

/* Slider: every slide gets the same frame, whatever the size of the uploaded image,
   so the page below does not move when the slide changes (all screen sizes) */
#carousel.homeslider .carousel-item img {
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

@media (max-width: 767px) {
  /* Shop categories under the slider */
  .vg-home-categories {
    display: block;
    clear: both;
    padding: 20px 16px 4px;
    text-align: center;
  }
  .vg-home-shop {
    display: block;
    padding: 12px 20px;
    border-radius: 25px;
    background: #659B7A;
    color: #fff;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .vg-home-shop:hover,
  .vg-home-shop:focus {
    color: #fff;
  }
  .vg-home-tiles {
    display: flex;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
  }
  .vg-home-tiles li {
    flex: 1 1 0;
    min-width: 0;
  }
  .vg-home-tiles a {
    display: block;
    color: #222;
  }
  .vg-home-tiles img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
  }
  .vg-home-tiles span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 16px;
  }

  /* A taller frame on phones, so the products in the photos stay visible */
  #carousel.homeslider .carousel-item img {
    aspect-ratio: 3 / 2;
  }

  /* Slider caption: the theme gives it a fixed 960px width and 70px letters */
  #carousel.homeslider .carousel-item .caption {
    left: 16px;
    right: 16px;
    top: 50%;
    bottom: auto;
    width: auto;
    height: auto;
    transform: translateY(-50%);
  }
  #carousel.homeslider .caption .ttdescription {
    font-size: 26px !important;
    line-height: 30px !important;
  }

  /* "Tout sur le chanvre": the white frame no longer covers the title */
  #ttcmsbanner .banner-content {
    margin-top: -110px;
    padding: 16px 0;
  }
  #ttcmsbanner .banner-content > .row {
    margin: 0;
  }
  #ttcmsbanner .banner3 {
    display: none;
  }
  /* Same weight as the theme's own phone rules, which shrink the links and offset banner2 */
  #ttcmsbanner .ttbanner .vg-scroller .banners {
    margin: 0;
  }
  #ttcmsbanner .ttbanner .vg-scroller .banner-img > a {
    display: block;
    float: none;
    width: 100%;
  }
  #ttcmsbanner .ttbanner .vg-scroller .banner-img img {
    width: 100%;
    height: 300px;
    object-fit: cover;
  }
  #ttcmsbanner .banner4 {
    margin-top: 0;
    padding: 0 16px;
  }

  /* Lists turned into swipeable rows by accueil-mobile.js: the next item peeks out */
  .vg-scroller {
    display: flex !important;
    position: relative;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .vg-scroller::-webkit-scrollbar {
    display: none;
  }
  .vg-scroller > * {
    flex: 0 0 80%;
    max-width: 80%;
    width: auto;
    float: none;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
  }
  #index .customNavigation,
  #product .category-products .customNavigation {
    display: none;
  }

  .vg-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    clear: both;
    padding: 14px 0 4px;
  }
  .vg-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #ccc;
    transition: width 0.2s, background 0.2s;
  }
  .vg-dot.active {
    width: 22px;
    background: #659B7A;
  }

  /* Long lists: a progress bar instead of a row of dots */
  .vg-progress {
    clear: both;
    height: 4px;
    margin: 16px auto 4px;
    width: 120px;
    border-radius: 2px;
    background: #e3e3e3;
    overflow: hidden;
  }
  .vg-progress span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: #659B7A;
  }
}
