/* Generalne resetowanie i podstawowe style */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background-color: #0d0d0d; /* Bardzo ciemne tło */
  color: #e0e0e0; /* Jasny, ale nie śnieżnobiały tekst */
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Zapobiega poziomemu scrollowaniu na małych ekranach */
}

/* --- NAGŁÓWEK --- */
.main-header {
  background: linear-gradient(to right, #1a1a1a, #0a0a0a); /* Delikatny gradient */
  border-bottom: 3px solid #ff0033; /* Gruby czerwony pasek */
  padding: 15px 30px; /* Większy padding po bokach */
  position: sticky; /* Sticky header, żeby zawsze był widoczny */
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 6px 15px rgba(255, 0, 51, 0.4); /* Wyraźny czerwony cień */
  display: flex;
  justify-content: center; /* Wyśrodkowanie zawartości nagłówka */
}

.header-content {
  width: 100%;
  max-width: 1400px; /* Maksymalna szerokość zawartości nagłówka */
  display: flex;
  align-items: center;
  justify-content: space-between; /* Rozłożenie elementów */
  flex-wrap: wrap; /* Zawijanie na mniejszych ekranach */
  gap: 15px; /* Odstęp między elementami */
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 45px; /* Nieco większe logo */
  filter: drop-shadow(0 0 8px rgba(255, 0, 51, 0.7)); /* Bardziej intensywny cień dla logo */
  transition: transform 0.3s ease;
}

.header-logo:hover {
  transform: scale(1.05);
}

.site-title {
  color: #ff0033; /* Czerwony tytuł */
  font-size: 1.8rem; /* Większy rozmiar tytułu */
  font-weight: 700;
  text-shadow: 0 0 5px rgba(255, 0, 51, 0.5);
}

.search-area {
  flex-grow: 1; /* Pozwala polu wyszukiwania na rozszerzanie się */
  max-width: 400px; /* Maksymalna szerokość pola wyszukiwania */
}

#searchInput {
  width: 100%;
  padding: 10px 15px; /* Większy padding */
  background: #0d0d0d;
  border: 1px solid #ff0033;
  border-radius: 25px; /* Bardziej zaokrąglone rogi */
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 0 5px rgba(255, 0, 51, 0.2);
}

#searchInput::placeholder {
  color: #a0a0a0;
}

#searchInput:focus {
  border-color: #ff3366;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.7);
  outline: none;
}

.main-nav {
  display: flex;
  gap: 15px;
}

.nav-btn {
  display: inline-block;
  padding: 8px 15px;
  background: none;
  color: #e0e0e0;
  border: 1px solid #ff0033;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 0, 51, 0.2);
}

.nav-btn:hover {
  background: #ff0033;
  color: #0d0d0d;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 5px 15px rgba(255, 0, 51, 0.6);
}

/* --- GŁÓWNA TREŚĆ I PANEL FILTRA --- */
.content-wrapper {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px;
  position: relative;
}

.filter-panel-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #ff0033; /* Domyślny kolor */
  color: #0d0d0d;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 35px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 5px 20px rgba(255, 0, 51, 0.7);
  transition: all 0.3s ease; /* Przejścia dla animacji */
}

.filter-panel-toggle:hover {
  background-color: #ff3366; /* Kolor na hover */
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(255, 51, 102, 0.9);
}

/* Stan aktywacji przycisku (gdy panel jest otwarty) */
.filter-panel-toggle.show { /* Używamy klasy 'show' która jest dodawana przez JS */
  background-color: #ff3366; /* Kolor jak na hover */
  transform: scale(1.1) rotate(5deg); /* Przechylenie */
  box-shadow: 0 8px 25px rgba(255, 51, 102, 0.9); /* Cień jak na hover */
}


/* PANEL FILTRA - DEFAULT (Desktop) - wysuwa się z lewej */
.filter-sidebar {
  position: fixed;
  top: 0; 
  left: -320px; /* Ukryty po lewej */
  width: 320px;
  height: 100%;
  background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
  border-right: 2px solid #ff0033;
  padding: 30px;
  overflow-y: auto;
  transition: left 0.4s ease-out, box-shadow 0.4s ease; /* Zmiana na 'left' */
  z-index: 998;
  box-shadow: 8px 0 20px rgba(255, 0, 51, 0.5);
}

.filter-sidebar.show {
  left: 0; /* Pokazany z lewej */
}

.filter-sidebar h3 {
  color: #ff0033;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.3rem;
  text-transform: uppercase;
  border-bottom: 1px dashed rgba(255, 0, 51, 0.3);
  padding-bottom: 8px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: flex-start;
}

.filter-sidebar button {
  padding: 6px 8px; /* Zmniejszony padding */
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  flex-grow: 0;
  flex-shrink: 0;
  width: auto; /* Pozwoli szerokości dopasować się do zawartości */
}

.filter-sidebar button:hover {
  background: #ff0033;
  color: #0d0d0d;
  border-color: #ff0033;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 0, 51, 0.5);
}

.filter-sidebar button.active {
  background: #ff0033;
  color: #0d0d0d;
  border-color: #ff0033;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(255, 0, 51, 0.7);
}

.price-filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-filter-group input {
  width: 100%;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #ff0033;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 0 5px rgba(255, 0, 51, 0.2);
}

.price-filter-group input:focus {
  border-color: #ff3366;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.7);
  outline: none;
}

.price-filter-group button {
  width: 100%;
  background: #ff0033;
  color: #0d0d0d;
  border: none;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(255, 0, 51, 0.5);
}

.price-filter-group button:hover {
  background-color: #ff3366;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 51, 102, 0.7);
}

/* --- SIATKA PRODUKTÓW --- */
.product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Domyślna szerokość na desktop */
  gap: 25px;
  padding-bottom: 50px;
  justify-content: center;
}

/* Selektor .product odpowiada za całą kartę produktu generowaną przez JS */
.product {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 15px;
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 0, 51, 0.2);
  display: flex;
  flex-direction: column;
}

.product:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: #ff0033;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 0, 51, 0.6);
}

.product img {
  width: 100%;
  aspect-ratio: 1 / 1; /* Obraz zawsze kwadratowy */
  object-fit: cover;
  border-bottom: 1px solid #333;
  transition: transform 0.3s ease;
}

.product:hover img {
  transform: scale(1.05);
}

/* Zmienione: Bezpośrednie style dla tagów, bez tag-container */
/* Wąskie tagi, niżej pod obrazkiem */
.product .tag {
  background: #ff0033;
  color: #0d0d0d;
  padding: 1px 3px; /* Ultra-wąski padding poziomy */
  border-radius: 4px;
  font-size: 0.7rem; /* Zmniejszona czcionka */
  font-weight: 500;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 5px; /* Odstęp od obrazka */
  margin-bottom: 0; /* Brak dolnego marginesu na tagu */
  margin-left: 1px; /* Odstęp między tagami */
  margin-right: 1px; /* Odstęp między tagami */
  position: static; /* Upewniamy się, że nie ma pozycjonowania */
  z-index: auto;
}

/* Zmienione: Kwota ma mieć kolor biały */
.product p.price {
  font-size: 1.4rem;
  font-weight: bold;
  color: #ffffff; /* Biały kolor dla ceny */
  margin: auto 15px 15px;
}

/* Dopasowanie nagłówka H3 produktu, aby odsunąć się od tagów */
.product h3 {
  font-size: 1.15rem;
  color: #ff0033;
  margin-top: 8px; /* Odstęp od tagów */
  margin-left: 15px;
  margin-right: 15px;
  margin-bottom: 8px;
  font-weight: 600;
}

.product a {
  display: block;
  width: 90%;
  margin: 0 auto 15px;
  padding: 10px 15px;
  background: #ff0033;
  color: #0d0d0d;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 0, 51, 0.4);
}

.product a:hover {
  background: #ff3366;
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 18px rgba(255, 51, 102, 0.6);
}


/* --- RESPONSYWNOŚĆ --- */

/* Pulpit - ekrany większe niż 1024px */
@media (min-width: 1025px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Domyślna szerokość na desktop */
  }
}

/* Tablety i mniejsze laptopy - 769px do 1024px */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  .search-area {
    order: 3;
    width: 100%;
    max-width: none;
  }
  .main-nav {
    margin-top: 15px;
    justify-content: center;
    order: 2;
  }
  .logo-area {
    order: 1;
    justify-content: center;
  }

  .content-wrapper {
    padding: 0 15px;
    margin-top: 20px;
    flex-direction: row;
  }
  
  .filter-sidebar {
    width: 280px;
    left: -280px;
    box-shadow: 5px 0 15px rgba(255, 0, 51, 0.4);
    top: 0;
    bottom: auto;
    border-right: 2px solid #ff0033;
    border-top: none;
    border-left: none;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Zmniejsz min-width dla tabletów */
    gap: 20px;
  }

  .product h3 {
    font-size: 1.05rem;
    margin-top: 6px; /* Dopasowany odstęp od tagów na tabletach */
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 6px;
  }
  .product .tag {
    font-size: 0.7rem;
    padding: 1px 4px;
    margin-top: 4px;
    margin-left: 1px;
    margin-right: 1px;
    margin-bottom: 0;
  }
  .product p.price {
    font-size: 1.2rem;
    margin: auto 12px 12px;
  }
  .product a {
    padding: 8px 12px;
    font-size: 0.9rem;
    margin: 0 auto 12px;
  }
}

/* Telefony poziomo i małe tablety (od 577px do 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Optymalnie 2-3 kolumny */
    gap: 15px;
  }
}


/* Telefony pionowo (do 576px) */
@media (max-width: 576px) {
  .main-header {
    padding: 10px 15px;
  }
  .site-title {
    font-size: 1.5rem;
  }
  .nav-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
  }

  .content-wrapper {
    flex-direction: column;
    padding: 0 10px;
  }

  /* PANEL FILTRA NA TELEFONIE (wysuwa się z dołu) */
  .filter-sidebar {
    width: 90%;
    left: 5%;
    right: 5%;
    max-width: 400px;
    top: auto;
    bottom: -100%;
    height: auto;
    max-height: 70vh;
    border-right: none;
    border-top: 2px solid #ff0033;
    box-shadow: 0 -5px 15px rgba(255, 0, 51, 0.4);
    transition: bottom 0.4s ease-out, box-shadow 0.4s ease;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .filter-sidebar.show {
    bottom: 0;
    left: 5%;
    right: 5%;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Dwa produkty w kolumnie na telefonach */
    gap: 15px;
    padding: 10px;
  }

  .product h3 {
    font-size: 0.95rem;
    margin-top: 5px; /* Dopasowany odstęp od tagów na telefonach */
    margin-left: 10px;
    margin-right: 10px;
    margin-bottom: 5px;
  }
  .product .tag {
    font-size: 0.6rem; /* Mniejszy tekst filtrów */
    padding: 0px 2px; /* Bardziej zmniejszony padding poziomy */
    margin-top: 3px;
    margin-left: 1px;
    margin-right: 1px;
    margin-bottom: 0;
  }
  .product p.price {
    font-size: 1.05rem;
    margin: auto 10px 10px;
  }
  .product a {
    padding: 6px 10px;
    font-size: 0.8rem;
    margin: 0 auto 10px;
  }

  .filter-panel-toggle {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 28px;
  }

  .filter-sidebar button { /* Mniejszy tekst w filtrach */
    font-size: 0.8rem;
    padding: 5px 7px;
  }
}

/* Bardzo małe telefony - do 360px (opcjonalnie, jeśli chcesz 1 kolumnę) */
@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr; /* 1 kolumna na najmniejszych telefonach */
    gap: 15px;
  }
  .product h3 {
    font-size: 0.9rem;
    margin-top: 4px; /* Dopasowany odstęp od tagów na bardzo małych telefonach */
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 4px;
  }
  .product .tag {
    font-size: 0.55rem; /* ULTRA ZMNIEJSZONA CZCIONKA */
    padding: 0px 1px; /* MINIMALNY PADDING */
    margin-top: 2px;
    margin-left: 1px;
    margin-right: 1px;
    margin-bottom: 0;
  }
  .product p.price {
    font-size: 1rem;
    margin: auto 8px 8px;
  }
  .product a {
    padding: 5px 8px;
    font-size: 0.75rem;
    margin: 0 auto 8px;
  }
}
