/* Petshop product scroller: targets data-* and structure so styles apply when themeClasses()
   (StoreProductScrollerRenderer) does not add t1-ps-* classes — e.g. petshop default. */

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) {
  width: 100%;
  padding: 25px 32px;
  background: #ffffff;
  position: relative;
}

/* Header row: row that directly contains the title */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) > div:has(> [data-ps-title]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-title] {
  font-size: 22px;
  margin: 0;
  font-weight: 600;
  color: var(--theme-text, #111);
}

/* Top (non-side) arrow cluster: prev/next without side arrows */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) div:has(> [data-ps-title]) > div:has(> [data-ps-prev]) {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="top"] [class*="t1-ps-arrow-side"],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="top"] *:has(> [data-ps-viewport]) > [data-ps-prev],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="top"] *:has(> [data-ps-viewport]) > [data-ps-next] {
  display: none !important;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="top"] [class*="t1-ps-viewport"],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="top"] *:has(> [data-ps-items-body]):not(:has(> [data-ps-title])) {
  padding-left: 16px;
  padding-right: 16px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="side"] div:has(> [data-ps-title]) > div:has(> [data-ps-prev]) {
  display: none !important;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="none"] div:has(> [data-ps-title]) > div:has(> [data-ps-prev]),
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="none"] *:has(> [data-ps-viewport]) > [data-ps-prev],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="none"] *:has(> [data-ps-viewport]) > [data-ps-next] {
  display: none !important;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="none"] [class*="t1-ps-viewport"],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"])[data-ps-arrow-style="none"] *:has(> [data-ps-items-body]):not(:has(> [data-ps-title])) {
  padding-left: 16px;
  padding-right: 16px;
}

/* All prev/next buttons in this component */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-prev],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-next] {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--theme-border, #ddd);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #333);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  box-sizing: border-box;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-prev]:hover,
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-next]:hover {
  background: var(--theme-primary, #4CAF50);
  color: var(--theme-text-inverse, #fff);
  border-color: var(--theme-primary, #4CAF50);
}

/* Side arrows: siblings before viewport wrapper */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-viewport]) > [data-ps-prev],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-viewport]) > [data-ps-next],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [class*="t1-ps-arrow-side"] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-viewport]) > [data-ps-prev],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [class*="t1-ps-arrow-side"][class*="t1-ps-arrow-prev"] {
  left: 8px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-viewport]) > [data-ps-next],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [class*="t1-ps-arrow-side"][class*="t1-ps-arrow-next"] {
  right: 8px;
}

/* Viewport wraps the horizontal track */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [class*="t1-ps-viewport"],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-items-body]):not(:has(> [data-ps-title])) {
  position: relative;
  overflow: hidden;
  padding: 0 48px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [class*="t1-ps-scroll-area"],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) *:has(> [data-ps-viewport]):has(> [data-ps-prev]) {
  position: relative;
}

/* Horizontal strip: cloned rows keep data-ps-item-template */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 16px 6px;
  margin-top: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body]::-webkit-scrollbar {
  display: none;
}

/* Each card: template clones retain data-ps-item-template; also match class when present */
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [data-ps-item-template],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [class~="t1-ps-item"] {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex: 0 0 auto;
  width: 150px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  box-sizing: border-box;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-link] {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  gap: 0;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-img-container],
:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-link] > :has([data-ps-img]) {
  width: 100%;
  height: 150px;
  background: var(--theme-bg-muted, #f7f7f7);
  border-radius: var(--theme-radius, 8px);
  overflow: hidden;
  flex-shrink: 0;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-img] {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-name] {
  font-size: 14px;
  color: var(--theme-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  width: 100%;
  margin-top: 8px;
}

:is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-price] {
  font-size: 15px;
  font-weight: 600;
  color: var(--theme-price, var(--theme-primary, #4CAF50));
}

@media (max-width: 992px) {
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [data-ps-item-template],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [class~="t1-ps-item"] { width: 130px; min-width: 130px; }
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-img-container],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-link] > :has([data-ps-img]) { height: 130px; margin-bottom: 8px; }
}

@media (max-width: 768px) {
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [data-ps-item-template],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [class~="t1-ps-item"] { width: 120px; min-width: 120px; }
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-img-container],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-link] > :has([data-ps-img]) { height: 120px; margin-bottom: 8px; }
}

@media (max-width: 480px) {
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [data-ps-item-template],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-items-body] > [class~="t1-ps-item"] { width: 108px; min-width: 108px; }
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-img-container],
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-link] > :has([data-ps-img]) { height: 108px; margin-bottom: 6px; }
  :is([data-controller="ProductScroller"], [data-component="store-product-scroller"], [data-renderer="store-product-scroller"]) [data-ps-title] { font-size: 18px; }
}