﻿/* 1. RESET BODY (Usuwamy padding, bo nagłówek nie zasłania już treści) */
body { 
    font-family: Arial, sans-serif; 
    background-color: #f4f4f4; 
    margin: 0; 
    padding-top: 0; /* ZMIANA: Zero paddingu, bo nagłówek jest teraz normalny; gdyby header był fixed trzeba by dodać padding */
}

/* sticky wrapper dla wszystkich stron */
.cala-gora-fixed {
    position: sticky;
    top: 0;
    z-index: 1001;
    background-color: inherit; /* zachowuje tło w przewijaniu */
}

/* 3. HEADER (Fioletowy pasek - Znika przy przewijaniu) */
header {
    background: linear-gradient(90deg, #b326e4, #7f1ba1);
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Żeby szukajka i koszyk działały */
    z-index: 1001;
    color: white;
}

header h1 {
    color: white;
    margin: 0;
}

header h3 {
    color: white;
    margin: 0;
}

nav a { 
    color: white; 
    text-decoration: none; 
    margin: 0 15px; 
    font-size: 18px; 
    font-weight: bold;
    text-transform: uppercase;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

nav a.active {
    background-color: #e67e22;
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.8);
}


header > a:first-of-type {
    margin-left: 150px; /* TU STERUJESZ: Zmień na 200px lub 50px wedle uznania */
    display: flex;
    align-items: center;
}

.tlo-fioletowe {
    background-color: #b326e4;
}

.tlo-czerwone {
    background-color: #FF213E;
}

.tlo-pomaranczowe {
    background-color: #ff851d;
}

.tlo-ametystowe {
    background-color: #7f1ba1;
}

.tlo-morskie{
    background-color: #5ED4FF;
}

.tlo-niebieskie{
    background-color: #5667ff;
}


.uklad-pionowy {
    display: flex;
    flex-direction: column; 
    align-items: center;
    text-align: center;
}

.uklad-pionowy img {
    width: 100px;
    height: auto;
    margin-bottom: 10px;
}


.uklad-poziomy {
    font-size: 80px;
    display: flex;
    flex-direction: row;    
    align-items: center;    
    gap: 30px;              
}

.uklad-poziomy img {
    width: 80px; 
    height: auto;
}

.uklad-poziomy h1 {
    font-size: 40px;
    margin: 0;
    text-transform: uppercase;
}

.Koszyk {
    background-color: #e67e22;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.Koszyk:hover {
    background-color: #d56e1a;
    transform: scale(1.05);
}

nav {   
    padding: 10px; 
    text-align: center; 
}

nav a { 
    color: white; 
    text-decoration: none; 
    margin: 0 15px; 
    font-size: 18px; 
}

.kontener { 
    display: flex; 
    justify-content: center; 
    padding: 20px; 
    gap: 20px; 
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.produkt { 
    background: white; 
    border: 1px solid #ccc;
    padding: 15px; 
    width: 250px; 
    text-align: center; 
    border-radius: 8px;
}

.produkt img { 
    width: 100%; 
    height: auto; 
    border-radius: 5px; 
}

.cena { 
    color: #e74c3c; 
    font-weight: bold; 
    font-size: 20px; 
}

button { 
    background-color: #27ae60; 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    cursor: pointer; 
}

button:hover { 
    background-color: #219150; 
}

.okno-koszyka {
    display: flex;          
    max-width: 1200px;      
    margin: 40px auto;      
    gap: 30px;              
    padding: 0 20px;
    align-items: flex-start; 
}

.lewa-kolumna {
    flex: 2; 
    background: white;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.prawa-kolumna {
    flex: 1;
}

.tabela-koszyka {
    width: 100%;
    border-collapse: collapse;
}

.tabela-koszyka td, .tabela-koszyka th {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.wielka-suma {
    font-size: 30px;
    font-weight: bold;
    color: #2c3e50;
    margin: 15px 0;
}

.btn-kupuje {
    width: 100%;
    background-color: #e67e22;
    color: white;
    font-size: 18px;
    padding: 15px;
    border: none;
    cursor: pointer;
}

.btn-usun {
    background-color: #e74c3c;
    color: white;
    border: none;            
    width: 30px;                
    height: 30px;              
    border-radius: 5px;         
    cursor: pointer;            
    font-size: 18px;            
    font-weight: bold;          
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;           
}
.btn-usun:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

.ilosc-input {
    width: 50px;
    padding: 5px;
    text-align: center; 
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

        .social-media-box {
            text-align: center;
            padding: 40px 20px;
            background-color: #f9f9f9;
            border-top: 1px solid #ddd;
            margin-top: 50px;
        }

        .social-media-box h2 {
            color: #333;
            margin-bottom: 30px;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-size: 24px;
        }

        @media (max-width: 850px) {
            /* Naprawa rozmiaru ikon social tylko na mobilkach */
            .ikony-kontener {
                display: flex !important;
                justify-content: center !important;
                gap: 20px !important;
                flex-wrap: wrap !important;
            }

            .ikony-kontener .ikona-social,
            img.ikona-social {
                max-height: 56px !important; /* domyślna wysokość ikon na telefonie */
                height: 56px !important;
                width: auto !important;
                object-fit: contain !important;
            }

            /* TikTok nieco większy, Instagram lekko większy niż domyślne */
            img[alt="TikTok"], .ikony-kontener img[src*="tiktok"] {
                max-height: 75px !important;
                height: 75px !important;
            }

            img[alt="Instagram"], .ikony-kontener img[src*="instagram"] {
                max-height: 60px !important;
                height: 60px !important;
            }
        }

        .ikony-kontener {
            display: flex;
            justify-content: center;
            align-items: center; /* To centruje ikony w pionie względem siebie */
            gap: 40px; /* Zwiększyłem odstęp, żeby było czytelniej */
        }

        .ikona-social {
            height: 50px; /* KLUCZOWE: Ustawiamy stałą wysokość, a nie szerokość */
            width: auto;  /* Szerokość dopasuje się sama, żeby nie spłaszczyć ikony */
            transition: transform 0.3s ease;
            filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2)); /* Lekki cień dla efektu 3D */
        }

        .ikona-social:hover {
            transform: scale(1.15); /* Powiększenie po najechaniu */
        }

    /* Styl paska wyszukiwania */
.szukajka {
    position: absolute;          /* Wyjmij z szeregu */
    left: 50%;                   /* Ustaw na 50% szerokości ekranu */
    transform: translateX(-50%); /* Cofnij o połowę (idealne centrowanie) */
    
        width: 350px;                /* Szerokość paska */
        max-width: 400px;            /* Ograniczenie szerokości na desktopie */
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    font-size: 16px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ================= BANER COOKIES ================= */
#baner-cookies {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #222;
    color: #f4f4f4;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    z-index: 99999;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#baner-cookies.pokaz {
    opacity: 1;
    transform: translateY(0);
}

#baner-cookies p {
    margin: 0;
    flex: 1;
    min-width: 0;
}

#baner-cookies a {
    color: #ffd166;
    text-decoration: underline;
    font-weight: 600;
}

#baner-cookies a:hover {
    text-decoration: none;
}

#baner-cookies button,
.btn-cookie {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.25s ease;
}

#baner-cookies button:hover,
.btn-cookie:hover {
    background-color: #1f8a4c;
}

@media (max-width: 780px) {
    #baner-cookies {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 16px 18px;
    }
    #baner-cookies p {
        font-size: 13px;
    }
    #baner-cookies button {
        width: 100%;
        margin-top: 12px;
    }
}

/* RWD - na telefony baner przyklei się do samego dołu */
@media (max-width: 600px) {
    #baner-cookies {
        flex-direction: column;
        text-align: center;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0;
    }
    .btn-cookie {
        width: 100%;
    }
}

/* ======= success page ======= */
body.success-page {
    background-color: #e8f5e9;
}

/* utility container used on several pages including sukces.html */
.container {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: center;
}

.card h1 {
    margin-top: 0;
    color: #27ae60;
}

.info {
    text-align: left;
    background: #f4f4f4;
    border-left: 5px solid #27ae60;
    padding: 20px;
    margin: 20px 0;
}

.btn-primary {
    display: inline-block;
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    margin-top: 20px;
}

footer {
    text-align: center;
    padding: 15px 10px;
    font-size: 0.9rem;
    color: #555;
}

/* ================= PRZYCISKI W HEADERZE ================= */
#btn-logowanie {
    background-color: transparent;
    color: white;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

#btn-logowanie:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* ================= DROPDOWN MENU UŻYTKOWNIKA ================= */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: #e67e22;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1002; /* Nad nagłówkiem */
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
    text-transform: none; /* Nadpisuje wielkie litery z menu głównego */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #d56e1a;
    transform: scale(1.05);
}

.profil-container {
            max-width: 900px;
            margin: 40px auto;
            padding: 20px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .powitanie-box {
            background: #f9f9f9;
            padding: 20px;
            border-left: 5px solid #27ae60;
            margin-bottom: 30px;
            border-radius: 4px;
        }

        .zamowienie-karta {
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 15px;
            background: #fff;
            transition: 0.3s;
        }
        
        .zamowienie-karta:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .zamowienie-header {
            display: flex;
            justify-content: space-between;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
            margin-bottom: 10px;
            font-weight: bold;
            color: #2c3e50;
        }

        .status-nowe { color: #e67e22; font-weight: bold; }
        .status-wyslane { color: #27ae60; font-weight: bold; }
        
@media (max-width: 850px) {
    header.tlo-fioletowe {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        height: auto !important;
        padding: 20px 15px !important;
    }

    header.tlo-fioletowe > a:first-of-type {
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block !important;
    }

    header.tlo-fioletowe > a:first-of-type img {
        margin: 0 auto !important;
        display: block !important;
    }

    header.tlo-fioletowe .szukajka {
        position: relative !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
    }

    header.tlo-fioletowe > div {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .cala-gora-fixed {
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        width: 100% !important;
    }

    header.tlo-fioletowe {
        position: sticky !important;
        top: 0 !important;
        z-index: 1002 !important;
        width: 100% !important;
    }

    header.tlo-fioletowe .dropdown,
    header.tlo-fioletowe .Koszyk,
    header.tlo-fioletowe #btn-logowanie {
        position: relative !important;
        transform: none !important;
        margin: 0 !important;
    }

    nav.tlo-ametystowe {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 10px 15px !important;
    }

    nav.tlo-ametystowe a {
        margin: 5px !important;
        font-size: 15px !important;
        padding: 8px 12px !important;
    }

    header.tlo-fioletowe {
        padding: 14px 12px !important;
    }

    header.tlo-fioletowe > a:first-of-type img {
        width: 52px !important;
    }

    header.tlo-fioletowe .szukajka {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    header.tlo-fioletowe .dropdown,
    header.tlo-fioletowe .Koszyk,
    header.tlo-fioletowe #btn-logowanie {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }

    header.tlo-fioletowe > div {
        gap: 8px !important;
    }
}
        
/* Dodatkowe poprawki mobilne: zapobiegają poziomemu przewijaniu
   i utrzymują kontenery, tabele i formularze w granicach ekranu */
@media (max-width: 850px) {
    html, body {
        overflow-x: hidden; /* usuwa przypadkowy poziomy overflow na wąskich ekranach */
    }

    *, *::before, *::after {
        box-sizing: border-box; /* ułatwia kontrolę szerokości elementów */
    }

    /* Ograniczamy szerokość głównych kontenerów i dajemy padding po bokach */
    .kontener, .container, .profil-container, .okno-koszyka, .admin-produkt {
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Obrazki i ikony nie wychodzą poza ekran */
    img, .ikona-social, .admin-produkt img, .produkty img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Formularze i pola wejściowe (np. kody promocyjne) skalują się do szerokości ekranu */
    input[type="text"], input[type="number"], textarea, select, .ilosc-input, .szukajka {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tabele koszyka - przewijanie poziome gdy zawartość jest za szeroka */
    .tabela-koszyka {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .tabela-koszyka td, .tabela-koszyka th {
        min-width: 60px !important;
        box-sizing: border-box !important;
    }

    /* Paginacje / kropki / suwaki - nie wychodzą poza ekran */
    .pagination, .dots, .slider-dots, .ikony-kontener {
        max-width: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* Przyciski i linki w koszyku/regulaminie lepiej się mieszczą */
    .btn-kupuje, .btn-primary, .dropbtn, .Koszyk, #btn-logowanie {
        max-width: 100% !important;
        white-space: normal !important;
    }
}

#pole-adresu {
    margin-bottom: 20px;
}

#pole-adresu label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

#pole-adresu .adres-grid-inputy {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "ulica nr_domu"
        "kod_pocztowy miasto";
    gap: 12px;
}

#pole-adresu input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#ulica { grid-area: ulica; }
#nr_domu { grid-area: nr_domu; }
#kod_pocztowy { grid-area: kod_pocztowy; }
#miasto { grid-area: miasto; }

@media (max-width: 768px) {
    #pole-adresu .adres-grid-inputy {
        grid-template-columns: 1fr;
        grid-template-areas:
            "ulica"
            "nr_domu"
            "kod_pocztowy"
            "miasto";
    }
}

        .produkty-lista { margin: 0; padding-left: 20px; font-size: 14px; color: #555; }

/* STYLE DLA LISTY PRODUKTÓW W ADMINIE */
        .admin-produkt { border: 1px solid #ccc; padding: 10px; border-radius: 5px; background: #f9f9f9; width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 15px; margin-bottom: 10px;}
        .admin-produkt img { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; }
        .admin-produkt-info { flex-grow: 1; }
        .admin-produkt-info h4 { margin: 0 0 5px 0; font-size: 16px; }
        .admin-produkt-info p { margin: 0; font-size: 14px; color: #555; }
        .btn-edycja { background: #f39c12; color: white; border: none; padding: 8px 15px; border-radius: 4px; font-weight: bold; }

/* ================= POWIADOMIENIA TOAST ================= */
#toast-powiadomienie {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #27ae60; /* Ładny zielony */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10000;
    
    /* Animacja z prawej strony */
    transform: translateX(120%);
    transition: transform 0.3s ease-in-out;
}

#toast-powiadomienie.pokaz {
    transform: translateX(0);
}

/* Dodatkowe reguły mobilne dla strony koszyka */
@media (max-width: 850px) {
    .okno-koszyka {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 0 12px !important;
    }

    .okno-koszyka .lewa-kolumna,
    .okno-koszyka .prawa-kolumna {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .lewa-kolumna { order: 1; }
    .prawa-kolumna { order: 2; }

    .box-podsumowania {
        width: 100% !important;
        padding: 12px !important;
    }

    .box-podsumowania p, .box-podsumowania label {
        font-size: 14px !important;
    }

    /* Ustawienie inputów kodu rabatowego i przycisku w kolumnie */
    .box-podsumowania > div[style*="display: flex"],
    .box-podsumowania > div[style*="display:flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    #input-kod {
        width: 100% !important;
        max-width: 100% !important;
    }

    .box-podsumowania input[type="text"],
    .box-podsumowania button {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-kupuje { padding: 12px 10px !important; font-size: 16px !important; }

    /* Tabela koszyka przewijana poziomo zamiast rozrywania układu */
    .tabela-koszyka {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tabela-koszyka thead,
    .tabela-koszyka tbody,
    .tabela-koszyka tr {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
    }

    .tabela-koszyka td, .tabela-koszyka th {
        padding: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        box-sizing: border-box !important;
    }
}

@media print {
    /* Ukrywamy nagłówek, nawigację, stopkę i inne niepotrzebne bajery */
    .cala-gora-fixed,
    header,
    nav,
    footer,
    #site-footer,
    #baner-cookies,
    #toast-powiadomienie,
    .social-media-box,
    button[onclick="window.print()"] /* Ukrywa też sam przycisk "Drukuj" na wydruku */ {
        display: none !important;
    }

    /* Resetujemy tło na czysto białe i usuwamy marginesy, żeby formularz był na całą stronę */
    body {
        background-color: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Wymuszamy czarny kolor tekstu dla lepszego kontrastu na papierze */
    body, p, h1, h2, h3, h4, h5, h6, span, div {
        color: black !important;
    }
}

