/* ==========================================================================
   NOORD THEME: CATEGORIES CAROUSEL
   Referência: MANORS Golf (manorsgolf.com)
   ========================================================================== */

/* Padding lateral: referência MANORS — ~60–80px em laptop, teto em monitores largos */
:root {
  --categories-side-pad: clamp(40px, 5.5vw, 80px);
}

/* ── Seção ── */

.noord-categories-section {
  background-color: var(--color-bg, #f5f5f0);
  padding: 60px 0 80px;
  overflow-x: clip; /* clips horizontal overflow sem bloquear scroll interno */
  overflow-y: visible;
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* ── Header: título + setas na mesma linha ── */

.noord-categories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 0 var(--categories-side-pad);
}

.noord-categories-header .section-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text, #111111);
  margin: 0;
}

/* ── Botões de navegação ── */

.noord-categories-nav {
  display: flex;
  gap: 8px;
}

.noord-categories-prev,
.noord-categories-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--color-text, #111111);
  color: var(--color-text, #111111);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.noord-categories-prev:hover,
.noord-categories-next:hover {
  background: var(--color-text, #111111);
  color: #ffffff;
}

.noord-categories-prev:disabled,
.noord-categories-next:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.noord-categories-prev *,
.noord-categories-next * {
  pointer-events: none;
}

/* ── Máscara esquerda: oculta o card que sai pela margem ──
   Cobre 0 → var(--categories-side-pad) com a cor do fundo da seção.
   O card anterior desliza POR BAIXO dela e some, sem aparecer parcialmente.
   ── */

.noord-categories-carousel {
  position: relative;
}

.noord-categories-carousel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--categories-side-pad);
  background: var(--color-bg, #f5f5f0);
  z-index: 3;
  pointer-events: none;
}

/* ── Carrossel: track scrollável ── */

.noord-categories-list {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth;
  scroll-padding-left: var(--categories-side-pad);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-left: var(--categories-side-pad) !important;
  gap: 16px !important;
  width: 100% !important;
}

.noord-categories-list::-webkit-scrollbar {
  display: none !important;
}

/* ── Items: 3 visíveis + peek do 4º ──
   Fórmula: (100vw - side_pad - 3_gaps) / (3 + peek_fraction)
   3 gaps de 16px = 48px. Peek ≈ 15% do card → divisor 3.15
   ── */

.noord-category-item {
  flex: 0 0 calc((100vw - var(--categories-side-pad) - 48px) / 3.15) !important;
  width: calc((100vw - var(--categories-side-pad) - 48px) / 3.15) !important;
  min-width: 160px !important;
  scroll-snap-align: start !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* ── Card: link com flex column (imagem + nome) ── */

.noord-category-card {
  display: flex !important;
  flex-direction: column !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* ── Imagem: portrait 2/3, object-fit cover ── */

.noord-category-image {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  background-color: #efefea;
  width: 100%;
}

.noord-category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.noord-category-card:hover .noord-category-image img {
  transform: scale(1.02);
}

/* ── Nome da categoria: abaixo da imagem ── */

.noord-category-name {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text, #111111);
  text-align: left;
}

/* ── Tablet: 2 cards visíveis + peek do 3º (2 gaps = 32px) ── */

@media (max-width: 1024px) {
  .noord-category-item {
    flex: 0 0 calc((100vw - var(--categories-side-pad) - 32px) / 2.15) !important;
    width: calc((100vw - var(--categories-side-pad) - 32px) / 2.15) !important;
  }
}

/* ── Mobile: 1 card + peek (1 gap = 16px) ── */

@media (max-width: 768px) {
  .noord-categories-section {
    padding: 40px 0 60px;
  }

  .noord-categories-header {
    margin-bottom: 16px;
  }

  .noord-categories-list {
    gap: 12px !important;
    scroll-padding-left: var(--categories-side-pad);
  }

  .noord-category-item {
    flex: 0 0 calc((100vw - var(--categories-side-pad) - 16px) / 1.85) !important;
    width: calc((100vw - var(--categories-side-pad) - 16px) / 1.85) !important;
    min-width: 120px !important;
  }

  .noord-categories-nav {
    display: flex;
  }

  .noord-categories-prev,
  .noord-categories-next {
    width: 32px;
    height: 32px;
  }
}
