/* ShopLight product carousel overrides */

.shoplight-wp-product,
.shoplight-wp-product img,
.shoplight-wp-add,
.shoplight-wp-add.btn,
.shoplight-wp-products .btn,
.shoplight-wp-products .btn-primary {
  border-radius: 0 !important;
}

/* Hide collection title (e.g. Femalegra) */
.shoplight-wp-collection-fragment.is-products-layout-carousel .shoplight-wp-collection-head {
  display: none !important;
}

/* Center description under carousel */
.shoplight-wp-collection-fragment.is-products-layout-carousel .shoplight-wp-category-route-description,
.shoplight-wp-collection-fragment.is-products-layout-carousel .shoplight-wp-description-panel {
  text-align: center;
  margin-top: 20px;
}

.shoplight-wp-collection-fragment.is-products-layout-carousel .shoplight-wp-category-route-description p,
.shoplight-wp-collection-fragment.is-products-layout-carousel .shoplight-wp-description-panel p {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.shoplight-wp-collection-fragment.is-products-layout-carousel {
  --slwp-gap: 16px;
  --slwp-visible: 4;
  position: relative;
}

.shoplight-wp-products.is-products-layout-carousel {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--slwp-gap);
  width: calc(100% - 96px);
  max-width: calc(100% - 96px);
  margin: 0 48px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
}

.shoplight-wp-products.is-products-layout-carousel::-webkit-scrollbar {
  display: none;
}

/* Exact card widths so only full cards are visible (no 5th-card tail) */
.shoplight-wp-products.is-products-layout-carousel > .shoplight-wp-product {
  box-sizing: border-box;
  flex: 0 0 calc((100% - (var(--slwp-visible) - 1) * var(--slwp-gap)) / var(--slwp-visible)) !important;
  width: calc((100% - (var(--slwp-visible) - 1) * var(--slwp-gap)) / var(--slwp-visible)) !important;
  max-width: calc((100% - (var(--slwp-visible) - 1) * var(--slwp-gap)) / var(--slwp-visible)) !important;
  min-width: 0 !important;
  scroll-snap-align: start;
  display: flex !important;
  flex-direction: column;
  height: auto;
  align-self: stretch;
}

.shoplight-wp-products.is-products-layout-carousel .shoplight-wp-product-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.shoplight-wp-products.is-products-layout-carousel .shoplight-wp-product-body h3 {
  min-height: 2.6em;
  margin: 0 0 8px;
  line-height: 1.3;
}

.shoplight-wp-products.is-products-layout-carousel .shoplight-wp-add,
.shoplight-wp-products.is-products-layout-carousel .shoplight-wp-add.btn {
  margin-top: auto;
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shoplight-wp-carousel-nav {
  position: absolute;
  top: 42%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9e9e9e;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.shoplight-wp-carousel-nav:hover,
.shoplight-wp-carousel-nav:focus-visible {
  color: #2d7d6d;
  outline: none;
}

.shoplight-wp-carousel-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.shoplight-wp-carousel-nav svg {
  display: block;
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.shoplight-wp-carousel-nav--prev {
  left: 0;
}

.shoplight-wp-carousel-nav--next {
  right: 0;
}

@media (max-width: 1024px) {
  .shoplight-wp-collection-fragment.is-products-layout-carousel {
    --slwp-visible: 2;
  }
}

@media (max-width: 640px) {
  .shoplight-wp-collection-fragment.is-products-layout-carousel {
    --slwp-visible: 1;
  }

  .shoplight-wp-products.is-products-layout-carousel {
    width: calc(100% - 80px);
    max-width: calc(100% - 80px);
    margin: 0 40px;
  }
}
