/*
  mercat_carrusel.css

  Purpose:
    Presentation-only stylesheet for the full-bleed mercat carousel used
    on the public mercat page. Keep rules scoped to `.mercat-carrusel`
    to avoid affecting other header or media components.

  Conventions:
    - Horizontal breathing: `padding-inline: 12px`
    - Internal gap between items: `gap: 2px`
    - Image height: `150px`
    - Corner radius: `16px` on the first and last images
    - Indicator spacing controlled via `--md-carrusel-indicator-gap`
*/

:root {
  --md-carrusel-indicator-gap: 12px;
}

.mercat-carrusel {
  display: flex;
  gap: 3px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-inline: 12px;
  scroll-padding-inline: 12px;
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mercat-carrusel > * {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.mercat-carrusel img {
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.mercat-carrusel > img:first-child {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.mercat-carrusel > img:last-child {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.hd-media.fullwidth {
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .hd-media.fullwidth {
    grid-column: 1 / -1;
  }
}

.hd-root > .hd-media.fullwidth {
  margin-left: -12px !important;
  margin-right: -12px !important;
  width: calc(100% + 24px) !important;
  box-sizing: border-box !important;
}

.mercat-carrusel-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--md-carrusel-indicator-gap);
  padding-inline: 12px;
}

.mercat-carrusel-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #cfcfcf; /* gris claro */
  border-radius: 50%;
  transition: all .18s ease;
}

.mercat-carrusel-indicator span.active {
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: #cfcfcf; /* gris claro */
}

.mercat-carrusel::-webkit-scrollbar {
  height: 0;
  display: none;
}

/* Override header-utils reset that removes vertical margins inside .hd-root blocks.
   Ensure the carousel indicator keeps vertical spacing from the carousel. */
.hd-root > .hd-block .mercat-carrusel-indicator {
  margin-top: var(--md-carrusel-indicator-gap) !important;
}
