/*
 * Change list item 33 (Sep 30): a visibly shorter band, so the first listing
 * shows above the fold on a phone. Smaller circles (48px, was 64px) and
 * tighter padding above and below (was 30-45px). Every category stays
 * reachable: the row still scrolls sideways on a phone, and the arrows stay
 * on wider screens.
 */
/*
 * R4-18: the doodle background as WebP, drawn from prod-slider-bg.svg (kept
 * as the source). The SVG was 1.3 MB (500 KB sent) of 2,544 paths that a
 * phone had to download and draw before the band was done; the WebP is the
 * same picture flattened on the same #E0FFDF, 74 KB at twice its size for
 * sharp desktops, and a 37 KB one-size copy for phones and tablets (the band
 * is ~110px tall there, so the 288px-tall copy is already more than enough).
 */
.product-slider-sec {
  overflow: hidden;
  background-image: url("../img/prod-slider-bg.webp");
  background-size: cover;
  background-color: #E0FFDF;
  padding: 20px 0;
}
@media (max-width: 991px) {
  .product-slider-sec {
    background-image: url("../img/prod-slider-bg-sm.webp");
  }
}
@media (max-width: 1679px) {
  .product-slider-sec {
    padding: 18px 0;
  }
}
@media (max-width: 1481px) {
  .product-slider-sec {
    padding: 16px 0;
  }
}
@media (max-width: 579px) {
  .product-slider-sec {
    overflow: visible;
    padding: 10px 0 6px;
  }
}
@media (max-width: 579px) {
  .product-slider-sec .container {
    padding-right: 0;
  }
}

/* Slick arrows (desktop/tablet) */
.product-slider-sec .product-header-slider .slick-prev {
  left: -45px;
  background-image: url("../img/left-arrow-grn.svg");
}
.product-slider-sec .product-header-slider .slick-prev:hover {
  background-image: url("../img/left-arrow-white.svg");
}
@media (max-width: 1441px) {
  .product-slider-sec .product-header-slider .slick-prev {
    left: -35px;
  }
}
@media (max-width: 1199px) {
  .product-slider-sec .product-header-slider .slick-prev {
    left: -25px;
  }
}
.product-slider-sec .product-header-slider .slick-next {
  right: -45px;
  background-image: url("../img/right-arrow-grn.svg");
}
.product-slider-sec .product-header-slider .slick-next:hover {
  background-image: url("../img/right-arrow-white.svg");
}
@media (max-width: 1441px) {
  .product-slider-sec .product-header-slider .slick-next {
    right: -35px;
  }
}
@media (max-width: 1199px) {
  .product-slider-sec .product-header-slider .slick-next {
    right: -25px;
  }
}
.product-slider-sec .product-header-slider .slick-next,
.product-slider-sec .product-header-slider .slick-prev {
  /* Centred on the 48px icon circle (slick-theme translates by -50%). */
  top: 24px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff;
  transition: 0.3s;
  opacity: 1;
}
.product-slider-sec .product-header-slider .slick-next::before,
.product-slider-sec .product-header-slider .slick-prev::before {
  display: none;
}
.product-slider-sec .product-header-slider .slick-next:hover,
.product-slider-sec .product-header-slider .slick-prev:hover {
  background-color: #08BF06;
}

/* Item styles */
.product-slider-sec .prod-slider-link {
  display: block;
  text-decoration: none;
  border-radius: 12px;
}
.product-slider-sec .prod-slider-link:focus-visible {
  outline: 2px solid #2E9E3D;
  outline-offset: 2px;
}
.product-slider-sec .prod-item {
  padding: 0 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
@media (max-width: 579px) {
  .product-slider-sec .prod-item {
    width: 72px;
    gap: 4px;
  }
}

/*
 * Tile icons (v122 Appendix A "Tile icons", Appendix D, D1 #4): every tile is a
 * Lucide icon on a plain white circle -- no photos, no image box, including
 * Misc. The prototype's carousel (yad-homepage-v50.jsx) drew a 64px white
 * circle and a 26px icon; change list item 33 shrank them to 48px and 20px
 * to shorten the band. Green ring on the active tile.
 */
.product-slider-sec .prod-item .prod-img,
.product-slider-sec .prod-item .ys-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  margin: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #fff;
  color: #2E9E3D;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.product-slider-sec .prod-item .ys-tile-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  color: #2E9E3D;
  stroke: currentColor;
  flex: 0 0 auto;
}
/* An <img> still printed inside the circle (the plugin's opt-in
   yad_shniya_category_tile_image override, or an older plugin's ACF banner
   before the icon renderer is deployed) is clipped to the circle, never
   spilling out of it at its natural size. */
.product-slider-sec .prod-item .prod-img {
  overflow: hidden;
}
.product-slider-sec .prod-item .prod-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.product-slider-sec .prod-slider-link:hover .ys-tile-icon {
  box-shadow: 0 2px 8px rgba(46, 158, 61, 0.18);
}
/* The active tile: the link carries aria-current or .is-active. */
.product-slider-sec .prod-slider-link[aria-current] .ys-tile-icon,
.product-slider-sec .prod-slider-link.is-active .ys-tile-icon,
.product-slider-sec .ys-tile-icon.is-active {
  border: 2.5px solid #2E9E3D;
  box-shadow: 0 2px 10px rgba(46, 158, 61, 0.25);
}
.product-slider-sec .prod-item h4 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
  text-align: center;
  color: #161B17;
}
@media (max-width: 579px) {
  .product-slider-sec .prod-item h4 {
    font-size: 11px;
  }
}

/* Mobile: native horizontal scroll with momentum */
@media (max-width: 579px) {
  .product-slider-sec .container {
    position: relative;
  }
  .product-slider-sec .container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 100%;
    background: linear-gradient(to right, transparent, #E0FFDF 80%);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
  }
  .product-slider-sec .container::before {
    content: '\203A\203A';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    font-weight: 700;
    color: #08BF06;
    letter-spacing: -8px;
    pointer-events: none;
    z-index: 3;
    animation: nudge 1.5s ease-in-out infinite;
    opacity: 0.8;
    transition: opacity 0.3s ease;
  }
  @keyframes nudge {
    0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.8; }
    50% { transform: translateY(-50%) translateX(4px); opacity: 1; }
  }
  .product-slider-sec .product-header-slider {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .product-slider-sec .product-header-slider::-webkit-scrollbar {
    display: none;
  }
  .product-slider-sec .product-header-slider > div {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .product-slider-sec .container.scroll-end::after,
  .product-slider-sec .container.scroll-end::before {
    opacity: 0 !important;
    animation: none;
    transition: opacity 0.3s ease;
  }
}
