/* Naši proizvodi (product list)
   Tokens, .section, .product-card, .link-arrow live in styles.css. */

.page-products { background: #fff; }

.products-list { padding-block: var(--space-7) var(--space-7); }

.products-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);   /* design has no divider under the header */
}

.products-list__title {
  font-size: var(--fs-md);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0;
}

.products-list__filter {
  background: none;
  border: 0;
  font: inherit;
  font-size: var(--fs-sm);
  letter-spacing: -0.04em;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
}

.products-list__filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.products-list__filter.is-active .products-list__filter-dot {
  box-shadow: 0 0 0 4px var(--color-line);
}

/* ---------- Filter panel (animated open/close via grid-rows) ---------- */
.products-filters {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-bottom: 0;
  transition: grid-template-rows 0.35s ease, opacity 0.25s ease, margin-bottom 0.35s ease,
    visibility 0s linear 0.35s;
}

.products-filters.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-bottom: var(--space-6);
  transition: grid-template-rows 0.35s ease, opacity 0.3s ease 0.06s, margin-bottom 0.35s ease,
    visibility 0s;
}

.products-filters__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
  min-height: 0;
}

.products-filters__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.products-filters__label {
  flex: 0 0 auto;
  min-width: 72px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--color-fg-muted);
}

.products-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-chip {
  font: inherit;
  font-size: var(--fs-xs);
  letter-spacing: -0.02em;
  line-height: 1;
  padding: 7px 13px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-chip:hover { border-color: var(--color-fg); }

.filter-chip.is-active {
  background: var(--color-fg);
  border-color: var(--color-fg);
  color: var(--color-invert);
}

.products-list__empty {
  padding: var(--space-7) 0;
  font-size: var(--fs-sm);
  color: var(--color-fg-muted);
}

.products-list__empty[hidden] { display: none; }

.products-list__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* Override the homepage scroller behaviour — keep the cards as a simple grid here */
.products-list__grid .product-card {
  flex: initial;
  scroll-snap-align: none;
}

.products-list__grid .product-card__media {
  aspect-ratio: 453 / 400;   /* design: card media is landscape 453×400, not portrait */
  background: var(--color-bg);
  position: relative;        /* anchor for the hover image overlay */
  overflow: hidden;
}

.products-list__grid .product-card__media img:not(.product-card__media-hover) {
  width: 33%;                /* design: bottle 149px in a 453px card */
}

/* Design has no divider under the card — drop the base meta border + its padding */
.products-list__grid .product-card__meta {
  padding-bottom: 0;
  border-bottom: none;
}

/* ---------- Second image revealed on hover ---------- */
.products-list__grid .product-card__media-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .products-list__grid .product-card--has-hover:hover .product-card__media-hover { opacity: 1; }
}

/* ---------- Animated underline on the product name ----------
   Every card gets the underline on hover; only cards with a hover image
   additionally cross-fade to the second image. */
.products-list__grid .product-card__name {
  position: relative;
  display: inline-block;
}

.products-list__grid .product-card__name::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease;
}

@media (hover: hover) {
  .products-list__grid .product-card:hover .product-card__name::after { transform: scaleX(1); }
}

.products-list__more {
  display: flex;
  justify-content: center;
  margin-top: var(--space-7);
}

.products-list__more[hidden] { display: none; }

/* The CTA uses .link-arrow--right (margin-left:auto) elsewhere — keep it centered here */
.products-list__more .products-list__cta { margin-left: 0; }

/* ---------- Wide feature image at section bottom ---------- */
.products-list__feature {
  margin: 0;
  aspect-ratio: 375 / 320;
  overflow: hidden;
}

.products-list__feature img {
  display: block;
  width: 100%;
  height: 100%;          /* no parallax here — fill the figure, no headroom */
  object-fit: cover;
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .products-list { padding-block: var(--space-9); }

  .products-list__head {
    margin-bottom: var(--space-7);
  }

  .products-list__title {
    font-size: clamp(2rem, 4vw, 2.625rem);
  }

  .products-list__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-7) var(--space-5);
  }

  .products-list__feature {
    aspect-ratio: 1440 / 659;
  }
}

@media (min-width: 1024px) {
  .products-list__title { font-size: clamp(2rem, 3.5vw, 2.625rem); }
  .products-list__grid { gap: var(--space-8) var(--space-6); }
}
