/* Carousel content owns the middle column; visible navigation owns two 52px gutters.
   Explicit component selectors keep unrelated buttons and native gestures untouched. */
:root { --homie-carousel-gutter:52px; --homie-carousel-control:44px; }
.homie-carousel-shell,
body .homie-latest-slider,
body .homie-featured-products,
body .homie-popular-window {
 position:relative!important; box-sizing:border-box!important;
 width:100%!important; max-width:100%!important; margin-inline:0!important;
 padding-inline:var(--homie-carousel-gutter)!important;
}
body :is(.homie-carousel-left,.homie-carousel-right,.homie-latest-prev,.homie-latest-next,.homie-featured-prev,.homie-featured-next,.homie-popular-arrow) {
 position:absolute!important; top:var(--homie-carousel-image-y,50%)!important; bottom:auto!important;
 width:var(--homie-carousel-control)!important; height:var(--homie-carousel-control)!important;
 min-width:var(--homie-carousel-control)!important; padding:0!important; margin:0!important;
 transform:translateY(-50%)!important; z-index:22; align-items:center; justify-content:center;
}
body :is(.homie-carousel-left,.homie-latest-next,.homie-featured-next,.homie-popular-arrow-left) {left:0!important;right:auto!important;}
body :is(.homie-carousel-right,.homie-latest-prev,.homie-featured-prev,.homie-popular-arrow-right) {right:0!important;left:auto!important;}
body :is(.homie-carousel-left,.homie-carousel-right,.homie-popular-arrow):disabled {opacity:.35!important;cursor:default;pointer-events:none;}
.homie-discover-carousel :is(.homie-carousel-left,.homie-carousel-right) {display:flex;}
/* Snap sliders compute their own overflow/disabled state. Do not reveal a one-page slider. */
.homie-snap-carousel :has(> [data-prev]) {opacity:1;}
/* Both legacy widget/gallery renderers put their controls beside the image anchor. */
body .homie-card-gallery:has(> .homie-card-prev),
 body .homie-card-gallery > div:has(> .homie-card-prev) {
  box-sizing:border-box!important; padding-inline:44px!important; position:relative;
 }
 body .homie-card-gallery :is(.homie-card-prev,.homie-card-next) {
  width:44px!important;height:44px!important;min-width:44px!important;
  display:flex;align-items:center;justify-content:center;padding:0!important;
 }
 body .homie-card-gallery .homie-card-prev {left:0!important;right:auto!important;}
 body .homie-card-gallery .homie-card-next {right:0!important;left:auto!important;}
/* Existing mobile swipe/dots and hidden section navigation retain their full width. */
@media(max-width:767px) {
 body.cms-index-index .homie-card-gallery:has(> .homie-card-prev),
 body.cms-index-index .homie-card-gallery > div:has(> .homie-card-prev) {padding-inline:0!important;}
 body .homie-blog-shell,body .homie-review-shell {padding-inline:0!important;}
}

/* PDP main gallery retains native zoom/pinch/fullscreen; only its image boxes gain gutters. */
#gallery .pdp_center_img:has(.homie-pdp-image-nav:not([style*="display: none"])) > .main-figure {
 box-sizing:border-box;padding-inline:52px;
}
#gallery .pdp_center_img:has(.homie-pdp-image-nav:not([style*="display: none"])) > template + .side-figure,
#gallery .pdp_center_img:has(.homie-pdp-image-nav:not([style*="display: none"])) > .side-figure {
 inset-inline:52px!important;width:auto!important;
}
#gallery .homie-pdp-image-nav {inset-inline:4px!important;}
#gallery .homie-pdp-image-nav > button {width:44px;height:44px;min-width:44px;padding:0;display:grid;place-items:center;}
/* Thumbnail controls occupy separate grid cells, not the first/last thumbnail. */
#gallery #gallery-thumbs:has(> button:not([style*="display: none"])) {
 display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px!important;gap:4px!important;
}
#gallery #gallery-thumbs:has(> button:not([style*="display: none"])) > button {
 position:static!important;inset:auto!important;width:44px!important;height:44px!important;padding:0!important;
}
#gallery #gallery-thumbs:has(> button:not([style*="display: none"])) > nav {
 grid-column:2;min-width:0;min-height:0;width:100%!important;
}
@media(min-width:1024px) {
 #gallery #gallery-thumbs.lg\:flex-col:has(> button:not([style*="display: none"])) {
  grid-template-columns:minmax(0,1fr)!important;grid-template-rows:44px minmax(0,1fr) 44px!important;justify-items:center;
 }
 #gallery #gallery-thumbs.lg\:flex-col:has(> button:not([style*="display: none"])) > nav {grid-column:1;grid-row:2;height:100%!important;}
}
/* Hyva category Splide and Page Builder sliders can be authored on CMS routes. */
.hyva-category .splide,
[data-content-type="slider"]:has([data-page-builder-slider-nav] [data-prev]) {
 position:relative;box-sizing:border-box;padding-inline:52px!important;
}
.hyva-category .splide .splide__arrow,
[data-content-type="slider"] [data-page-builder-slider-nav] > :is([data-prev],[data-next]) {
 position:absolute!important;top:50%!important;transform:translateY(-50%)!important;
 width:44px!important;height:44px!important;padding:0!important;z-index:22;
}
.hyva-category .splide .splide__arrow--prev {left:0!important;right:auto!important;}
.hyva-category .splide .splide__arrow--next {right:0!important;left:auto!important;}
[data-content-type="slider"] [data-page-builder-slider-nav] {position:static!important;}
[data-content-type="slider"] [data-page-builder-slider-nav] > [data-prev] {right:0!important;left:auto!important;}
[data-content-type="slider"] [data-page-builder-slider-nav] > [data-next] {left:0!important;right:auto!important;}
/* A one-page/single-image component does not reserve empty arrow columns. */
.homie-hero-carousel:not(:has(> .homie-carousel-left)),
.homie-carousel-shell:has(> .homie-carousel-left[style*="display: none"]),
body .homie-latest-slider:has(> .homie-latest-prev[style*="display: none"]),
body .homie-featured-products:has(.homie-featured-prev[style*="display: none"]) {padding-inline:0!important;}
/* Override the legacy Popular rule that hid a disabled end control entirely. */
body .homie-popular-carousel .homie-popular-arrow:disabled {opacity:.35!important;}

/* Narrow catalog/recommendation cards keep the full image width. Their existing
   photo buttons occupy a separate in-flow row, with dots between the buttons. */
@media(max-width:767px) {
 body:not(.cms-index-index) .homie-card-gallery:has(> .homie-card-prev),
 body:not(.cms-index-index) .homie-card-gallery:has(> div > .homie-card-prev) {
  display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px;
  grid-template-rows:auto minmax(44px,auto);align-items:center;
  padding-inline:0!important;column-gap:0;row-gap:0;
 }
 /* Native catalog renderer: image and navigation are direct children. */
 body:not(.cms-index-index) .homie-card-gallery:has(> .homie-card-prev) > a:first-child {
  grid-column:1 / -1;grid-row:1;min-width:0;width:100%;
 }
 /* Widget renderer nests the image/buttons, while dots and copy are siblings.
    Subgrid keeps its real event wrapper and shares the same navigation row. */
 body:not(.cms-index-index) .homie-card-gallery > div:has(> .homie-card-prev) {
  display:grid!important;grid-column:1 / -1;grid-row:1 / 3;
  grid-template-columns:subgrid;grid-template-rows:subgrid;
  padding-inline:0!important;align-items:center;
 }
 body:not(.cms-index-index) .homie-card-gallery > div:has(> .homie-card-prev) > a:first-child {
  grid-column:1 / -1;grid-row:1;min-width:0;width:100%;
 }
 body:not(.cms-index-index) .homie-card-gallery :is(.homie-card-prev,.homie-card-next) {
  position:static!important;inset:auto!important;transform:none!important;
  margin:0!important;opacity:1!important;grid-row:2;z-index:auto;
  width:44px!important;height:44px!important;min-width:44px!important;
  align-self:center;display:flex!important;
 }
 body:not(.cms-index-index) .homie-card-gallery .homie-card-prev {grid-column:1;justify-self:start;}
 body:not(.cms-index-index) .homie-card-gallery .homie-card-next {grid-column:3;justify-self:end;}
 body:not(.cms-index-index) .homie-card-gallery:has(.homie-card-prev) > .homie-card-dots {
  grid-column:2;grid-row:2;display:flex!important;flex-wrap:wrap;
  align-items:center;justify-content:center;min-width:0;width:100%;margin:0;padding:0;gap:0;
 }
 body:not(.cms-index-index) .homie-card-gallery:dir(rtl) .homie-card-prev {grid-column:3;justify-self:end;}
 body:not(.cms-index-index) .homie-card-gallery:dir(rtl) .homie-card-next {grid-column:1;justify-self:start;}
 body:not(.cms-index-index) .homie-card-dots > button {
  width:22px;height:22px;padding:8px;border:0;background:transparent;color:#b8c2c9;
 }
 body:not(.cms-index-index) .homie-card-dots > button::after {
  content:"";display:block;width:6px;height:6px;border-radius:50%;background:currentColor;
 }
 body:not(.cms-index-index) .homie-card-dots > button[aria-current="true"] {color:var(--color-primary,#236181);}
 body:not(.cms-index-index) .homie-card-gallery:has(.homie-card-prev) > :is(a:not(:first-child),div:not(:first-child):not(.homie-card-dots):not(.badgetextbox)) {
  grid-column:1 / -1;
 }
}

/* Conditional pager wrappers must not reserve space when there is no next page.
   Custom Latest controls already own that strip's navigation. */
.homie-carousel-pagination {padding-block:22px 0;min-height:0;}
.homie-carousel-pagination-row {padding-block:0!important;}
.homie-carousel-pagination .cursor-pointer {margin-block:0!important;}
.homie-latest-slider .homie-carousel-pagination {display:none!important;padding:0!important;margin:0!important;}
@media(max-width:767px) {.homie-carousel-pagination{padding-top:18px;}}
.homie-carousel-pagination[x-cloak] {display:none!important;}

/* Native snap buttons live in a nested heading row. Neither heading wrapper
   may establish their containing block: the carousel shell owns both gutters. */
body .homie-snap-carousel > div:has(> div > [data-prev]),
body .homie-snap-carousel > div > div:has(> [data-prev]) {
 position:static!important;transform:none!important;
}
body .homie-snap-carousel.snap-slider :is([data-prev],[data-next]) {
 position:absolute!important;top:var(--homie-carousel-image-y,50%)!important;bottom:auto!important;
 width:44px!important;height:44px!important;min-width:44px!important;
 margin:0!important;padding:0!important;transform:translateY(-50%)!important;
}
body .homie-snap-carousel.snap-slider [data-prev] {right:0!important;left:auto!important;}
body .homie-snap-carousel.snap-slider [data-next] {left:0!important;right:auto!important;}
