market-product-carousel {
  position: relative;
  display: block;
  padding-top: 60px;
  padding-bottom: 60px;
}
@media (max-width: 768px) {
  market-product-carousel header {
    padding-bottom: 15px;
  }
}
market-product-carousel header > *:empty {
  display: none;
}

market-product-carousel header {
  text-align: center;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}

market-product-carousel header span {
  line-height: 1.25;
  font-size: 1.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

market-product-carousel header h2 {
  font-weight: 700;
  font-size: 2rem;
}

market-product-carousel header p {
  font-weight: 400;
  line-height: 1.5rem;
  font-size: 16px;
  max-width: 640px;
}

@media (max-width: 768px) {
  market-product-carousel header p {
    font-size: 14px;
    line-height: 20px;
  }
}

market-product-carousel [viewport] {
  position: relative;
  margin-top: 45px;
}

market-product-carousel [carousel] {
  display: flex;
  justify-content: flex-start;
  gap: 30px;
  padding: 0 30px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

market-product-carousel:not([overflowing]) [carousel] {
  justify-content: center;
}

market-product-carousel [carousel]::-webkit-scrollbar {
  /* display: none; */
  background: var(--text);
}

@media (max-width: 768px) {
  market-product-carousel [carousel] {
    gap: 15px;
    padding: 0 15px;
    padding-bottom: 30px;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  market-product-carousel [carousel] {
    scroll-behavior: auto;
  }
}

/* ---------------- ARROWS ---------------- */
market-product-carousel [viewport] > button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--background);
  color: var(--text);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--text) 20%, transparent);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

market-product-carousel [viewport] > button svg {
  width: 24px;
  height: 24px;
}

market-product-carousel [viewport] > button[prev] {
  left: 15px;
}

market-product-carousel [viewport] > button[next] {
  right: 15px;
}

market-product-carousel [viewport] > button:disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* Fade in on hover (desktop with a fine pointer only) */
@media (hover: hover) and (pointer: fine) {
  market-product-carousel [viewport]:hover > button:not(:disabled) {
    opacity: 1;
  }
}

/* Hide arrows entirely on touch / mobile */
@media (hover: none), (max-width: 768px) {
  market-product-carousel [viewport] > button {
    display: none;
  }
}

market-product-carousel [carousel] [product] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-width: 22vw;
  max-width: 25vw;
  text-align: center;
}

@media (max-width: 768px) {
  market-product-carousel [carousel] [product] {
    min-width: 55vw;
    max-width: 55vw;
  }
}

market-product-carousel [carousel] [product] [media] {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1/1;
  border-radius: 10px;
  background: color-mix(in srgb, var(--background), var(--text) 8%);
  overflow: hidden;
  width: 100%;
}

market-product-carousel [carousel] [product] [media] svg-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

market-product-carousel [carousel] [product] [media] svg-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

market-product-carousel [carousel] [product] [media] svg-img svg {
  width: 45px;
  height: 45px;
}

market-product-carousel [carousel] [product] [badge] {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--background);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

market-product-carousel [carousel] [product] h3 {
  line-height: 22px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  market-product-carousel [carousel] [product] h3 {
    font-size: 12px;
    line-height: 18px;
  }
}

market-product-carousel [carousel] [product] p {
  font-size: 14px;
  line-height: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

market-product-carousel [carousel] [product] [cta] {
  margin-top: auto;
  width: 100%;
  padding: 16px 24px;
  border-radius: 10px;
  background: var(--text);
  color: var(--background);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
}
