/* RESPONSYWNOŚĆ (MEDIA QUERIES) */

/* --- TABLETY I DUŻE TELEFONY (poniżej 1024px) --- */
@media (max-width: 1024px) {
    section {
        margin: 2rem auto;
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .nav-links {
        gap: 1.2rem; /* Ciaśniejsze menu */
    }
}

/* --- TABLETY PORTRETOWE (poniżej 768px) --- */
@media (max-width: 768px) {
    nav {
        flex-direction: column; /* Logo nad menu */
        text-align: center;
    }

    .nav-links {
        flex-wrap: wrap; /* Linki mogą przejść do nowej linii */
        justify-content: center;
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 100px 20px;
    }

        .hero h1 {
            font-size: 2.2rem;
        }

    /* Ukrywamy strzałki w sliderze - na dotyku używamy palca */
    .nav-btn {
        display: none;
    }

    .products-grid {
        grid-auto-columns: 260px; /* Nieco mniejsze karty na tabletach */
        gap: 1rem;
    }
}

/* --- TELEFONY (poniżej 480px) --- */
@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 0.8rem;
    }

    /* Ukrywamy tekst "Koszyk", zostawiamy samą ikonę z liczbą */
    .cart-text {
        display: none;
    }

    .cart-link {
        font-size: 1.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .products-grid {
        grid-auto-columns: 85%; /* Karta zajmuje prawie cały ekran */
        padding-left: 10px;
    }

    footer {
        padding: 2rem 1rem;
    }

    .footer-links a {
        display: block; /* Linki w stopce jeden pod drugim */
        margin: 10px 0;
    }
}

/* --- BARDZO DUŻE EKRANY (powyżej 1440px) --- */
@media (min-width: 1440px) {
    section {
        max-width: 1400px; /* Szerszy layout dla monitorów 4K/wide */
    }

    .products-grid {
        grid-auto-columns: 320px; /* Większe karty na dużym ekranie */
    }
}


/* RESET I USTAWIENIA OGÓLNE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    color: #3f2a1e;
    background: #f8f1e3;
}

section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #5c4033;
}

h3 {
    color: #5c4033;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/*  2. NAWIGACJA (HEADER) */
header {
    background: #5c4032;
    color: #f8f1e3;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    background: #5c4032;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row; /* Ustawia logo na lewo od menu */
    align-items: center; /* Środkuje w poziomie */
    gap: 1rem; /* Odstęp między logo a linkami */
}

.logo {
    font-size: 1.9rem;
    font-weight: bold;
    line-height: 1.1;
}

    .logo span {
        font-size: 1.1rem;
        font-weight: normal;
        display: block;
        opacity: 0.9;
    }

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    justify-content: center; /* Środkuje linki względem siebie */
}

    .nav-links a {
        color: #f8f1e3;
        text-decoration: none;
        font-weight: 500;
        transition: 0.3s;
    }

        .nav-links a:hover {
            text-decoration: underline;
            opacity: 0.8;
        }
.cart-link {
    display: flex;
    align-items: center; /* Środkuje napis i ikonę w pionie */
    gap: 10px; /* Odstęp między napisem a ikoną */
    text-decoration: none;
    color: #f8f1e3;
    transition: 0.3s;
}

.cart-text {
    font-weight: 500;
    font-size: 1rem;
}

.cart-icon-wrapper {
    position: relative; /* Baza dla pozycjonowania licznika */
    display: flex;
    align-items: center;
    font-size: 1.3rem; /* Rozmiar samej ikony */
}

/* Stylizacja "badge" (licznik) */
#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #d9534f; /* Czerwień lub ciemny brąz */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* =========================================
   3. HERO SECTION
========================================= */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1517953405523-5b9d8d6c3f9e?q=80&w=2070') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: 160px 20px;
}

    .hero h1 {
        font-size: 3.5rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1.4rem;
        max-width: 700px;
        margin: 0 auto 2rem;
    }

/* =========================================
   4. PRODUKTY I KATEGORIE
========================================= */
.slider-wrapper{
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.products-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 300px;
    gap: 2rem;
    justify-content: center;
}
.products-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 4rem) / 3);
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 20px 10px;
}
.products-slider::-webkit-scrollbar {
    display: none;
}
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    width: 100%;
    scroll-snap-align: start;
    color: #3f2a1e;
}

    .product-card:hover {
        transform: translateY(-6px);
    }

    .product-card img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        display: block;
    }

    .product-image-wrapper {
        width: 100%;
        height: 250px; /* Stała wysokość miejsca na zdjęcie */
        overflow: hidden;
    }

    .product-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* "Cover" wypełni obszar (może lekko uciąć boki), 
                          "Contain" pokaże całe zdjęcie (mogą być puste paski) */
    }


.product-info {
    padding: 1.2rem;
    background: white;
    flex-grow: 1;
}

    .product-info h3 {
        margin-bottom: 0.5rem;
        font-size: 1.3rem;
    }

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #5c4033;
    margin: 0.8rem 0;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.category {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Przycisk uniwersalny */
.btn {
    display: inline-block;
    background: #5c4033;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

    .btn:hover {
        background: #3f2a1e;
    }

/*Przycisk do slider*/
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #5c4033;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: 0.3s;
}
    .nav-btn:hover {
        background: #3f2a1e;
        transform: translateY(-50%) scale(1.1);
    }
    .nav-btn.prev { left: -45px; }
    .nav-btn.next { right: -45px; }
/* =========================================
   5. SEKCJA KONTAKT (FORMULARZ)
========================================= */
#kontakt {
    padding: 60px 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f8f1e3;
}

#kontakt form {
    background: #ffffff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 30px rgba(63, 42, 30, 0.1);
    width: 100%;
    max-width: 1000px;
    /* AKTYWACJA SIATKI */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dwie równe kolumny */
    column-gap: 40px; /* Odstęp między lewą a prawą stroną */
}

    /* LEWA KOLUMNA - Pozycjonowanie pól (Imię, Email, Temat) */
    #kontakt form > *:nth-child(1), /* Label Imię */
    #kontakt form > *:nth-child(2), /* Input Imię */
    #kontakt form > *:nth-child(3), /* Label Email */
    #kontakt form > *:nth-child(4), /* Input Email */
    #kontakt form > *:nth-child(5), /* Label Temat */
    #kontakt form > *:nth-child(6) /* Select Temat */ {
        grid-column: 1;
    }

    /* PRAWA KOLUMNA - Pozycjonowanie Wiadomości */
    #kontakt form > *:nth-child(7) { /* Label Wiadomość */
        grid-column: 2;
        grid-row: 1; /* Wymuszamy start od samej góry */
    }

    #kontakt form > *:nth-child(8) { /* Textarea */
        grid-column: 2;
        grid-row: 2 / 7; /* Rozciąga pole od 2 wiersza aż do przycisku */
        height: calc(100% - 25px); /* Dopasowanie wysokości z uwzględnieniem marginesów */
        margin-bottom: 25px;
    }

/* PRZYCISK - Na całą szerokość */
#kontakt button {
    grid-column: 1 / 3; /* Rozciągnięcie od 1 do 3 linii siatki (całość) */
    width: 100%;
    padding: 15px;
    background-color: #5c4032;
    color: #f8f1e3;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s ease;
    margin-top: 10px;
}
    #kontakt label {
        display: block;
        margin-bottom: 8px;
        color: #5c4032;
        font-weight: 600;
        font-size: 0.9rem;
    }

    #kontakt input,
    #kontakt select,
    #kontakt textarea {
        width: 100%;
        padding: 12px 15px;
        margin-bottom: 25px;
        border: 2px solid #eeebe6;
        border-radius: 8px;
        background-color: #faf9f7;
        font-family: inherit;
        font-size: 1rem;
        color: #3f2a1e;
        transition: all 0.3s ease;
    }

        #kontakt input:focus,
        #kontakt select:focus,
        #kontakt textarea:focus {
            outline: none;
            border-color: #5c4032;
            background-color: #ffffff;
            box-shadow: 0 0 8px rgba(92, 64, 50, 0.2);
        }

    #kontakt button {
        width: 100%;
        padding: 15px;
        background-color: #5c4032;
        color: #f8f1e3;
        border: none;
        border-radius: 8px;
        font-size: 1.1rem;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        transition: 0.3s ease;
    }

        #kontakt button:hover {
            background-color: #3f2a1e;
        }

        #kontakt button:active {
            transform: scale(0.98);
        }

/* =========================================
   6. STOPKA
========================================= */
footer {
    background: #000000;
    color: #f8f1e3;
    padding: 3rem 2rem 1.5rem;
    text-align: center;
}

.footer-links {
    margin: 1.5rem 0;
}

    .footer-links a {
        color: #f8f1e3;
        margin: 0 15px;
        text-decoration: none;
        transition: 0.3s;
    }

        .footer-links a:hover {
            opacity: 0.7;
        }

/* --- STYLE STRONY KOSZYKA --- */
.cart-container-main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 20px;
}

.cart-products-list {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cart-product-row {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0ede9;
    transition: opacity 0.3s ease;
}

    .cart-product-row:last-child {
        border: none;
    }

.cart-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 20px;
}

.cart-details {
    flex: 1;
}

    .cart-details h4 {
        color: #5c4033;
        margin-bottom: 5px;
    }

    .cart-details p {
        color: #999;
        font-size: 0.85rem;
    }

.quantity-wrapper {
    display: flex;
    align-items: center;
    background: #f8f1e3;
    border-radius: 8px;
    margin: 0 30px;
}

.qty-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    color: #5c4033;
}

.qty-input {
    width: 30px;
    border: none;
    background: none;
    text-align: center;
    font-weight: bold;
    color: #5c4033;
}

.remove-item {
    color: #cc0000;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 10px;
}

/* PODSUMOWANIE */
.cart-summary-box {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #666;
}

.summary-total-line {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f8f1e3;
    font-size: 1.3rem;
    font-weight: bold;
    color: #5c4033;
}

.checkout-btn {
    width: 100%;
    background: #5c4033;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

    .checkout-btn:hover {
        background: #3f2a1e;
    }

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #5c4033;
    text-decoration: none;
    font-size: 0.9rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}
.modal-overlay {
    display: none; /* Domyślnie ukryte */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.modal-content p {
    font-size: 1.1rem;
    color: #4a332a; /* Ciemnobrązowy z Twojego motywu */
    margin-bottom: 25px;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-yes, .btn-no {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-yes {
    background-color: #e74c3c; /* Czerwony - akcja destrukcyjna */
    color: white;
}

.btn-yes:hover {
    background-color: #c0392b;
}

.btn-no {
    background-color: #4a332a; /* Brązowy z motywu */
    color: white;
}

.btn-no:hover {
    background-color: #36241d;
}

.empty-cart-msg {
    color: #888; /* Szary kolor */
    font-size: 1.5rem;
    text-align: center;
    padding: 50px 20px;
    font-weight: bold;
}

/* Stylizacja specyficzna dla okna płatności */
.checkout-content {
    max-width: 700px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.checkout-section h3 {
    text-align: left;
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #f8f1e3;
    padding-bottom: 5px;
}

.checkout-section input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

.zip-city {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
}

/* Kontener na metody płatności - ograniczamy szerokość */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 75px; /* Zwiększona szerokość, by napisy się mieściły */
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #eeebe6;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    justify-content: flex-start; /* Wszystko do lewej */
}

    /* Styl kółka wyboru */
    .payment-option input[type="radio"] {
        margin: 0 20px 0 0; /* Odstęp tylko z prawej strony kółka */
        cursor: pointer;
        accent-color: #5c4033;
        flex-shrink: 0; /* Kółko nie może się zgnieść */
    }

    /* Napis i ikona razem */
    .payment-option span {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
        color: #5c4033;
        font-weight: 400;
        white-space: nowrap; /* Blokuje łamanie tekstu do nowej linii */
    }

    /* Stała szerokość ikony, by teksty pod sobą były równe */
    .payment-option i {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }

    /* Efekt po wybraniu */
    .payment-option:has(input:checked) {
        border-color: #5c4033;
        background-color: #fcfaf7;
    }

.final-summary {
    background: #f8f1e3;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 75%;
}

.checkout-submit-btn {
    background: #27ae60; /* Zielony dla płatności */
    font-size: 1.1rem;
    max-width: 200px;
}

    .checkout-submit-btn:hover {
        background: #219150;
    }


/* GŁÓWNE OKNO (MODAL) */
.modal {
    display: none; /* Ukrywamy okno na start */
    position: fixed; /* Wyciągamy je z układu strony - teraz nie "pcha" innych elementów */
    z-index: 2000; /* Bardzo wysoki numer, by okno było nad menu i stopką */
    left: 0;
    top: 0;
    width: 100%; /* Przykrywamy całą szerokość ekranu */
    height: 100%; /* Przykrywamy całą wysokość ekranu */
    background-color: rgba(0,0,0,0.6); /* Półprzezroczyste tło (przyciemnienie) */
    backdrop-filter: blur(4px); /* Efekt rozmycia strony pod spodem */
    overflow-y: auto; /* Pozwala przewijać, jeśli formularz nie mieści się na ekranie */
}

/* PUDEŁKO Z TREŚCIĄ (BIAŁA KARTA) */
.modal-content.checkout-content {
    background-color: #f8f1e3;
    margin: 50px auto; /* Środkowanie w poziomie i odstęp od góry */
    padding: 40px;
    border-radius: 20px;
    width: 95%;
    max-width: 700px; /* Maksymalna szerokość okna płatności */
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* PRZYCISK ZAMYKANIA (X) */
.close-modal {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #5c4033;
    cursor: pointer;
    line-height: 1;
}

    .close-modal:hover {
        color: #cc0000; /* Zmiana koloru na czerwony przy najechaniu */
    }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px; /* Produkty po lewej, podsumowanie po prawej */
    gap: 30px;
    margin: 0 auto; /* Środkowanie kontenera */
    max-width: 1200px; /* Szerokość taka sama jak reszta strony */
    align-items: start;
}
@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr; /* Jeden pod drugim na małym ekranie */
    }
}
