/* --- Reset CSS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Model pudełkowy */
}

/* --- Globalne Style --- */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Strona zajmuje całą wysokość widoku */
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    color: #333;
}

/* --- Układ Główny --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    display: flex; /* Flexbox dla sidebara i contentu */
    gap: 20px; /* Odstęp między sidebarem a contentem */
    flex-grow: 1; /* Pozwala kontenerowi rosnąć i wypełniać dostępną przestrzeń */
}

/* --- Nagłówek (Header) --- */
header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    border-bottom: 3px solid #007bff;
}

.header-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Pozwala elementom zawijać się na mniejszych ekranach */
}

.logo img {
    height: 50px; /* Przykład wysokości logo */
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: #fff;
    padding: 5px 10px;
    transition: background-color 0.3s ease;
}

.main-nav ul li a:hover {
    background-color: #0056b3;
    border-radius: 4px;
    text-decoration: none;
}

.lang-selector img {
    width: 24px; /* Rozmiar ikon flag */
    height: 24px;
    margin-left: 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

/* --- Sidebar --- */
.sidebar {
    flex: 0 0 250px; /* Sztywna szerokość sidebara */
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    align-self: flex-start; /* Przylega do góry kontenera flex */
}

.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #007bff;
}

.sidebar input[type="text"] {
    width: calc(100% - 60px); /* Szerokość pola wyszukiwania */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    vertical-align: middle;
}

.sidebar button {
    padding: 8px 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    vertical-align: middle;
}

.sidebar button:hover {
    background-color: #0056b3;
}

.sidebar ul {
    padding-left: 15px; /* Wcięcia dla list */
}

.sidebar ul li a {
    display: block;
    padding: 5px 0;
    color: #555;
}

.sidebar ul li a:hover {
    color: #007bff;
    text-decoration: none;
}

.sidebar ul ul { /* Style dla subkategorii */
    padding-left: 25px;
    border-left: 1px dashed #eee;
    margin-top: 5px;
}

.sidebar .filters-section label {
    display: block;
    margin-bottom: 5px;
}

/* --- Główna Zawartość (Content Area) --- */
.content-area {
    flex-grow: 1; /* Pozwala zająć całą dostępną przestrzeń */
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- Stopka (Footer) --- */
footer {
    background: #333;
    color: #fff;
    padding: 1.5rem 0;
    margin-top: 30px; /* Odstęp od contentu */
    text-align: center;
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9em;
}

.footer-content p {
    margin: 5px 0;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-nav ul li {
    margin: 0 10px;
}

.footer-nav ul li a {
    color: #fff;
    transition: color 0.3s ease;
}

.footer-nav ul li a:hover {
    color: #007bff;
    text-decoration: none;
}

.copyright {
    text-align: right;
}

/* --- Responsywność (podstawowa) --- */
@media (max-width: 768px) {
    .header-content, .footer-content, .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        flex-direction: column;
        margin-top: 15px;
    }

    .main-nav ul li {
        margin: 5px 0;
    }

    .lang-selector {
        margin-top: 15px;
    }

    .sidebar {
        flex: 0 0 auto; /* Sidebar zajmuje całą szerokość */
        width: 100%;
    }

    .container {
        gap: 0; /* Usuń odstęp, gdy elementy są w kolumnie */
    }

    .footer-nav ul {
        margin-top: 10px;
    }
}
/* --- Style dla Sekcji Strony Głównej (home.php) --- */

.hero-section {
    background-color: #e6f2ff; /* Jasny błękit */
    padding: 60px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 30px;
}

.hero-section h1 {
    color: #007bff;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 5px;
}

.primary-button {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

.primary-button:hover {
    background-color: #0056b3;
    color: #fff;
    text-decoration: none;
}

.secondary-button {
    background-color: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
}

.secondary-button:hover {
    background-color: #5a6268;
    color: #fff;
    text-decoration: none;
}

.tertiary-button {
    background-color: #f8f9fa;
    color: #007bff;
    border: 1px solid #007bff;
}

.tertiary-button:hover {
    background-color: #e2e6ea;
    color: #0056b3;
    text-decoration: none;
}


.featured-products-section, .about-us-mini-section {
    background-color: #fff;
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.featured-products-section h2, .about-us-mini-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 2em;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsywna siatka */
    gap: 20px;
    justify-content: center;
}

.product-card {
    background-color: #fcfcfc;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    max-width: 100%;
    height: 180px; /* Stała wysokość dla obrazów produktów */
    object-fit: contain; /* Obraz będzie dopasowany, bez przycinania */
    margin-bottom: 15px;
    border-radius: 4px;
}

.product-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #007bff;
}

.product-card .catalog-number {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 10px;
}

.product-card p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1; /* Pozwala opisowi zająć dostępną przestrzeń */
}

/* Dostosowanie dla responsywności, jeśli już masz media queries */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr; /* Na małych ekranach produkty jeden pod drugim */
    }
}
/* Sekcja wyróżnionych produktów */
.featured-products-section {
    padding: 20px 0;
    text-align: center;
}

.featured-products-section h2 {
    margin-bottom: 30px;
    font-size: 2em;
    color: #333;
}

/* Kontener siatki produktów - Użycie Flexbox */
.product-grid {
    display: flex; /* Użyj flexboxa do układania elementów */
    flex-wrap: wrap; /* Zezwól na zawijanie się elementów do nowego wiersza */
    gap: 20px; /* Odstęp między kartami produktów */
    justify-content: center; /* Wyśrodkuj karty, jeśli nie wypełniają całego wiersza */
    margin: 0 auto; /* Wyśrodkowanie samego grida */
    max-width: 1200px; /* Ogranicz szerokość grida dla dużych ekranów */
    padding: 0 15px; /* Dodaj padding po bokach */
}

/* Karta produktu */
.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: left; /* Przywróć wyrównanie tekstu wewnątrz karty do lewej */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 1 1 calc(33.333% - 20px); /* Domyślnie 3 w rzędzie (100% / 3 = 33.333%) minus gap */
    min-width: 280px; /* Minimalna szerokość karty, aby nie były zbyt małe */
    box-sizing: border-box; /* Ważne dla poprawnego obliczania szerokości z paddingiem i borderem */
    display: flex; /* Użyj flexboxa wewnątrz karty */
    flex-direction: column; /* Ułóż zawartość karty pionowo */
    justify-content: space-between; /* Rozłóż zawartość karty równomiernie */
}

.product-card img {
    max-width: 100%; /* Obrazek nigdy nie wyjdzie poza swoją kartę */
    height: 200px; /* Ustaw stałą wysokość dla zdjęć */
    object-fit: contain; /* Zachowaj proporcje obrazka, ale dopasuj do pudełka */
    display: block; /* Usuń ewentualne marginesy poniżej obrazka */
    margin: 0 auto 15px auto; /* Wyśrodkuj obrazek i dodaj margines na dole */
    border: 1px solid #eee; /* Lekka ramka dla obrazka */
    border-radius: 4px;
}

.product-card h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 10px;
    color: #0056b3;
    min-height: 50px; /* Zapewnij stałą wysokość dla tytułu, aby karty miały podobną wysokość */
}

.product-card .catalog-number {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.product-card p {
    font-size: 1em;
    color: #444;
    line-height: 1.5;
    flex-grow: 1; /* Pozwól akapitowi rozszerzyć się, aby wypełnić dostępną przestrzeń */
}

.product-card .button {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Przycisk wyrównany do lewej w ramach karty */
}

.product-card .button:hover {
    background-color: #0056b3;
}

/* Media Queries dla responsywności (2 w rzędzie na mniejszych ekranach) */
@media (max-width: 992px) {
    .product-card {
        flex: 1 1 calc(50% - 20px); /* 2 w rzędzie na tabletach i mniejszych laptopach */
    }
}

/* Media Queries dla responsywności (1 w rzędzie na bardzo małych ekranach) */
@media (max-width: 576px) {
    .product-card {
        flex: 1 1 100%; /* 1 w rzędzie na telefonach */
    }
}