/* Popster v3.10.4 – surgical overrides. Loaded AFTER the legacy CSS bundle. */

/* The cards and category order are unchanged. Only the scrolling behaviour changes. */
.collections .popster-home-collections-grid {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-template-columns: none !important;
  grid-auto-columns: calc((100% - 48px) / 3) !important;
  gap: 24px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 8px;
}
.collections .popster-home-collections-grid::-webkit-scrollbar { display: none; }
.collections .popster-home-collections-grid > .collection-card {
  width: 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}
.collections .section-header { gap: 16px; }
.popster-collections-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.popster-collections-arrow {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #dedede;
  background: #fff;
  color: #1a1a1a;
  font: 500 30px/1 'Outfit', sans-serif;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.popster-collections-arrow:hover:not(:disabled) { background: #faf7f3; border-color: #b9b9b9; }
.popster-collections-arrow:focus-visible { outline: 2px solid var(--color-primary,#E85D3A); outline-offset: 2px; }
.popster-collections-arrow:disabled { opacity: .35; cursor: default; }
@media (max-width: 1024px) and (min-width: 769px) {
  .collections .popster-home-collections-grid { grid-auto-columns: calc((100% - 20px) / 2) !important; gap: 20px !important; }
}
@media (max-width: 768px) {
  .collections .popster-home-collections-grid { grid-auto-columns: 85% !important; gap: 14px !important; }
  .popster-collections-controls { display: none; } /* Native finger swipe on phones */
}
@media (prefers-reduced-motion: reduce) {
  .popster-collections-arrow { transition: none; }
}

/* Menu: identical top-level typography, same starting x and right-hand + position. */
.nav-panel .nav-collections__group--taxonomy > .nav-collections__parent { display: none !important; }
.nav-panel .nav-collections__group--taxonomy .nav-collections__row {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 42px !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 2px 0 !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__row > a {
  display: flex !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  grid-column: 1 !important;
  font: 500 15px/1.45 'Outfit',sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__row > a > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font: inherit !important;
  text-transform: inherit !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__row > a > small {
  font: 500 12px/1.3 'Outfit',sans-serif !important;
  color: var(--color-text-light,#666) !important;
  margin-left: auto !important;
  flex: 0 0 auto;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__row > .nav-collections__branch-toggle {
  grid-column: 2 !important;
  justify-self: end !important;
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  font: 500 23px/1 'Outfit',sans-serif !important;
  text-align: center !important;
  border-radius: 8px !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__item:not(.has-children) > .nav-collections__row::after {
  grid-column: 2 !important;
  justify-self: end !important;
  content: '' !important;
  display: block !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__subchildren {
  margin: 2px 0 10px 14px !important;
  padding: 2px 0 2px 13px !important;
  border-left: 1px solid #e9e5df !important;
}
.nav-panel .nav-collections__group--taxonomy .nav-collections__subchildren .nav-collections__row > a {
  font-size: 14px !important;
}
.nav-panel .nav-collections__item.has-children:not(.is-open) > .nav-collections__subchildren { display: none !important; }
.nav-panel .nav-collections__item.has-children.is-open > .nav-collections__subchildren { display: block !important; }

/* The main image stays within the page; arrows are above any image/overlay. */
@media (min-width: 769px) {
  body.single-product .product__gallery {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  body.single-product .product__main-img {
    width: 100% !important;
    height: clamp(320px, calc(100dvh - 190px), 690px) !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    isolation: isolate;
    overflow: hidden !important;
  }
  body.single-product .product__main-img > img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    position: relative !important;
    z-index: 0 !important;
  }
  body.single-product .product__gallery-nav {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: absolute !important;
    top: 50% !important;
    z-index: 100 !important;
    transform: translateY(-50%) !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.95) !important;
    box-shadow: 0 4px 18px rgba(0,0,0,.24) !important;
    color: #181818 !important;
    font-size: 32px !important;
    cursor: pointer !important;
  }
  body.single-product .product__gallery-nav--prev { left: 12px !important; right: auto !important; }
  body.single-product .product__gallery-nav--next { right: 12px !important; left: auto !important; }
  body.single-product .product__mobile-gallery { display: none !important; }
  body.single-product .product__main-img > img:hover { transform: none !important; }
}
@media (min-width: 769px) and (max-height: 720px) {
  body.single-product .product__gallery { position: static !important; }
  body.single-product .product__main-img { height: clamp(280px, 63dvh, 550px) !important; }
}
body.single-product .product__gallery-nav:focus-visible { outline: 3px solid var(--color-primary,#E85D3A) !important; outline-offset: 2px; }

/* 'Altre composizioni' is only a link to Shop, not a second product carousel. */
.popster-product-shop-cta { padding-top: 22px; text-align: center; }
.popster-product-shop-cta__link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #d7d7d7;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.popster-product-shop-cta__link:hover { border-color: var(--color-primary,#E85D3A); color: var(--color-primary,#E85D3A); }
.popster-related-categories { padding: 28px 0 4px; }
.popster-related-categories__title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.popster-related-categories__links { display: flex; flex-wrap: wrap; gap: 8px; }
.popster-related-categories__links a { padding: 8px 12px; border: 1px solid #e4e1dd; border-radius: 50px; font-size: 13px; text-decoration: none; }
.popster-related-categories__links a:hover { border-color: var(--color-primary,#E85D3A); }
