/* ════════════════════════════════════════════════════════════════
   FILTER.CSS — System filtrowania produktów (chipy/tagi)
   ogrodowy.expert | 2026
   ════════════════════════════════════════════════════════════════ */

/* ═══ 1. WRAPPER FILTRÓW ════════════════════════════════════════ */

.filter-section {
  padding: 48px 0 32px;
  background: var(--bg-alt, #F4F0E8);
}

.filter-section--dark {
  background: #1a1a1a;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ═══ 2. JEDNA GRUPA FILTRÓW ════════════════════════════════════ */

.filter-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group__label {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
  padding-top: 8px;
  min-width: 120px;
  flex-shrink: 0;
}

.filter-group--dark .filter-group__label {
  color: rgba(255,255,255,0.4);
}

.filter-group__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══ 3. CHIP ════════════════════════════════════════════════════ */

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,0.18);
  background: transparent;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}

.filter-chip:hover {
  border-color: var(--gold, #c8a96e);
  color: var(--gold, #c8a96e);
}

.filter-chip.is-active {
  background: var(--gold, #c8a96e);
  border-color: var(--gold, #c8a96e);
  color: #fff;
}

/* Wariant ciemny (na dark bg) */
.filter-section--dark .filter-chip {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}

.filter-section--dark .filter-chip:hover {
  border-color: var(--gold, #c8a96e);
  color: var(--gold, #c8a96e);
}

.filter-section--dark .filter-chip.is-active {
  background: var(--gold, #c8a96e);
  border-color: var(--gold, #c8a96e);
  color: #fff;
}

/* Chip "Resetuj" */
.filter-chip--reset {
  border-color: transparent;
  color: var(--text-muted, #888);
  padding-left: 4px;
  font-size: 12px;
}

.filter-chip--reset:hover {
  border-color: transparent;
  color: var(--text, #1a1a1a);
  background: transparent;
}

.filter-chip--reset svg {
  width: 14px;
  height: 14px;
}

/* ═══ 4. PASEK WYNIKÓW ══════════════════════════════════════════ */

.filter-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 8px;
}

.filter-results-bar--dark {
  border-color: rgba(255,255,255,0.08);
}

.filter-count {
  font-size: 13px;
  color: var(--text-muted, #888);
}

.filter-count strong {
  color: var(--text, #1a1a1a);
  font-weight: 600;
}

.filter-section--dark .filter-count strong {
  color: #fff;
}

/* ═══ 5. LAYOUT: SIDEBAR + SIATKA 3-KOLUMNOWA ═════════════════ */

.cat-products .container {
  max-width: 100%;
  padding: 0 clamp(20px, 3vw, 48px);
}

.cat-shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.cat-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cat-sidebar__card {
  border: 1px solid #e5e0da;
  border-radius: 10px;
  padding: 24px 20px;
  background: #fff;
}
.cat-sidebar__card--season {
  border-color: #B8965A;
  background: linear-gradient(135deg, #fdfbf7 0%, #f5eed9 100%);
}
.cat-sidebar__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: #1C2B1A;
  margin: 0 0 8px;
  line-height: 1.3;
}
.cat-sidebar__text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 14px;
}
.cat-sidebar__text:last-child { margin-bottom: 0; }
.cat-sidebar__cta {
  display: inline-block;
  background: #B8965A;
  color: #fff;
  text-decoration: none;
  padding: 9px 20px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}
.cat-sidebar__cta:hover { background: #a07d4a; }

.cat-sidebar__swatches {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.cat-sidebar__swatch {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.cat-sidebar__swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-sidebar__badge {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #1C2B1A;
  border-radius: 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  text-align: center;
  justify-content: center;
}

.cat-shop-main {
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 0 80px;
}

/* ═══ 6. KARTA PRODUKTU ═════════════════════════════════════════ */

.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.product-card__img-wrap {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  background: var(--bg-alt, #F4F0E8);
  container-type: inline-size;
}

/* Zdjęcie rośnie proporcjonalnie do szerokości karty */
@container (min-width: 340px) {
  .product-card__img-wrap { aspect-ratio: 4 / 3; }
}
@container (min-width: 440px) {
  .product-card__img-wrap { aspect-ratio: 3 / 2; }
}

.product-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__img-wrap img {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold, #c8a96e);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.product-card__body {
  padding: 20px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card__name {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  line-height: 1.25;
  margin: 0;
}

.product-card__desc {
  font-size: 13px;
  color: var(--text-muted, #888);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.product-card__feature-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #888);
  background: var(--bg-alt, #F4F0E8);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.product-card__footer {
  padding: 14px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: auto;
}

.product-card__price {
  display: flex;
  flex-direction: column;
}

.product-card__price-main {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  line-height: 1;
}

.product-card__price-year {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-top: 2px;
}

.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--gold, #c8a96e);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.product-card__cta:hover {
  background: var(--gold-dark, #b8944f);
  transform: translateY(-1px);
}

.product-card__cta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ═══ 7. EMPTY STATE ════════════════════════════════════════════ */

.filter-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted, #888);
  grid-column: 1 / -1;
}

.filter-empty__icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.filter-empty p {
  font-size: 15px;
  margin: 0 0 16px;
}

.filter-empty .filter-chip--reset {
  border: 1.5px solid rgba(0,0,0,0.18);
  padding: 8px 20px;
  color: var(--text, #1a1a1a);
  font-size: 14px;
}

/* ═══ 8. ANIMACJA KART ══════════════════════════════════════════ */

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.product-card {
  animation: cardFadeIn 0.25s ease both;
}

/* ═══ 9. RESPONSIVE ═════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .cat-shop-layout {
    grid-template-columns: 240px 1fr;
    gap: 24px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 800px) {
  .cat-shop-layout {
    grid-template-columns: 1fr;
  }

  /* ── Mobile sidebar: kompaktowy pasek ── */
  .cat-sidebar {
    position: static;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1.5px solid #B8965A;
    border-radius: 10px;
    background: linear-gradient(135deg, #fdfbf7 0%, #f5eed9 100%);
    max-height: 54px;
    transition: max-height 0.45s ease-out, border-color 0.3s;
    cursor: pointer;
  }

  .cat-sidebar::before {
    content: '\23F0  Sezon 2026 \00b7 Dostawa 2-5 dni \00b7 Doradztwo gratis';
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 44px 0 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1C2B1A;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    animation: sidebar-pulse 3s ease-in-out infinite;
  }

  .cat-sidebar::after {
    content: '\25BE';
    position: absolute;
    top: 0;
    right: 16px;
    height: 54px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    color: #B8965A;
    transition: transform 0.3s;
    pointer-events: none;
  }

  .cat-sidebar {
    position: relative;
  }

  .cat-sidebar__card {
    flex: 1 1 100%;
    margin: 0 12px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
  }

  .cat-sidebar__badge {
    margin: 0 12px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s;
  }

  /* ── Otwarty stan ── */
  .cat-sidebar.is-open {
    max-height: 700px;
    gap: 12px;
    padding-top: 54px;
    padding-bottom: 12px;
    cursor: default;
    animation: none;
  }

  .cat-sidebar.is-open::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
  }

  .cat-sidebar.is-open::after {
    content: '\25B4';
    cursor: pointer;
  }

  .cat-sidebar.is-open .cat-sidebar__card,
  .cat-sidebar.is-open .cat-sidebar__badge {
    opacity: 1;
    transform: none;
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@keyframes sidebar-pulse {
  0%, 100% { background: linear-gradient(135deg, #fdfbf7 0%, #f5eed9 100%); }
  50%      { background: linear-gradient(135deg, #faf5e8 0%, #f0e4c4 100%); }
}

@media (max-width: 768px) {
  .filter-group {
    flex-direction: column;
    gap: 8px;
  }

  .filter-group__label {
    min-width: auto;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .cat-products .container {
    padding-left: 0;
    padding-right: 0;
  }
  .cat-sidebar {
    padding: 0 16px;
  }
  .product-grid {
    grid-template-columns: 1fr;
    padding-left: 0;
    padding-right: 0;
    gap: 16px;
  }
  .product-card {
    border-radius: 0;
  }
}
