/* ================================================================= */
/* RESET I GLOBALNE STYLE                                            */
/* ================================================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    padding: 0;
    background-color: #f2f2f2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================================================================= */
/* LAYOUT - GŁÓWNY                                                   */
/* ================================================================= */
#banner {
    position: relative;
    text-align: center;
    color: white;
}

main {
    padding: 20px;
    flex: 1;
}

main h1 {
    color: #000000;
    margin-bottom: 15px;
}

/* ================================================================= */
/* KARTY PRODUKTÓW                                                   */
/* ================================================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding-bottom: 10px;
}

@media (min-width: 1200px) {
    .products-grid {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
    }
    
    .products-grid::-webkit-scrollbar {
        height: 10px;
    }
    
    .products-grid::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 5px;
    }
}

.product-card {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    padding: 18px;
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

@media (min-width: 1200px) {
    .product-card {
        flex: 0 0 300px;
        min-width: 250px;
        max-width: 350px;
    }
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.product-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 16px;
}

.product-name {
    margin: 10px 0 5px;
    font-size: 22px;
    color: #0e0e0e;
    word-break: break-word;
}

.product-price {
    margin: 5px 0;
    font-weight: bold;
    color: #696969;
    font-size: 20px;
}

/* ================================================================= */
/* BANNER                                                              */
/* ================================================================= */
#banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ================================================================= */
/* FILTRY I SORTOWANIE                                                */
/* ================================================================= */
#controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 18px 24px;
    margin-bottom: 28px;
}

#controls label {
    font-size: 14px;
    color: #222;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#controls select,
#controls input[type="number"] {
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: #fafafa;
    transition: border-color 0.2s;
}

#controls select:focus,
#controls input[type="number"]:focus {
    border-color: #111;
    outline: none;
}

#controls input[type="checkbox"] {
    accent-color: #d32f2f;
    width: 18px;
    height: 18px;
    margin-right: 4px;
}

#controls button {
    padding: 8px 18px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#controls button:hover {
    background: #b71c1c;
}

#controls #count {
    font-size: 15px;
    color: #333;
    margin-left: 10px;
}

.dynamic-filters{
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-box option:checked{
    background-color: #b71c1c;
}

/* ================================================================= */
/* Bill                                                      */
/* ================================================================= */

.bill-container {
            max-width: 700px;
            margin: 40px auto;
            padding: 30px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
        }
        .bill-container h1 {
            margin-bottom: 20px;
            text-align: center;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 25px;
        }
        table th, table td {
            padding: 12px;
            border-bottom: 1px solid #ddd;
            text-align: left;
        }
        table th {
            background: #f5f5f5;
        }
        .total-line {
            text-align: right;
            font-size: 20px;
            font-weight: 700;
            margin-top: 10px;
        }
        .print-btn {
            display: block;
            width: 100%;
            text-align: center;
            padding: 12px;
            margin-top: 20px;
            background: #111;
            color: #fff;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 600;
        }
        .print-btn:hover {
            background: #222;
        }
/* ================================================================= */
/* RESPONSYWNOŚĆ                                                      */
/* ================================================================= */
@media (max-width: 900px) {
    main {
        padding: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-card {
        padding: 12px;
    }

    .product-name {
        font-size: 16px;
    }

    .product-price {
        font-size: 16px;
    }

    #controls {
        padding: 12px 16px;
    }

    #controls label {
        font-size: 12px;
    }

    #controls select,
    #controls input[type="number"] {
        font-size: 12px;
        padding: 5px 8px;
    }

    #controls button {
        font-size: 13px;
        padding: 6px 12px;
    }

    #controls #count {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        padding: 15px;
    }
    
    .product-name {
        font-size: 18px;
    }
    
    .product-price {
        font-size: 18px;
    }
}
/* ================================================================= */
/* STRONA PRODUKTU - PRODUCT.PHP                                      */
/* ================================================================= */
.product-main-grid {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.preview {
    flex: 1 1 400px;
    max-width: 500px;
}

.preview h2 {
    font-size: 26px;
    margin-bottom: 20px;
}

.preview img#mainImage {
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
    margin-bottom: 12px;
}

.thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbs .thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
}

.thumbs .thumb:hover {
    border-color: #d32f2f;
}

.statArea {
    flex: 1 1 300px;
    max-width: 400px;
}

.statArea ol {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.statArea ol li {
    font-size: 16px;
    margin-bottom: 8px;
}

.statArea form button {
    padding: 10px 20px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.statArea form button:hover {
    background: #b71c1c;
}

.color-picker h3 {
    margin: 20px 0 10px;
    font-size: 18px;
}

.color-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #000;
    font-size: 14px;
    transition: transform 0.2s;
}

.color-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}

.color-item:hover {
    transform: scale(1.05);
}

.descArea {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.descArea img {
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
}

.descArea p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 900px) {
    .product-main-grid {
        flex-direction: column;
        gap: 25px;
    }

    .statArea, .preview {
        max-width: 100%;
    }

    .thumbs .thumb {
        width: 50px;
        height: 50px;
    }

    .color-item img {
        width: 40px;
        height: 40px;
    }
}

/* ================================================================= */
/* STRONA PRODUKTU - product.php (LEWY/ PRAWY + OPIS NA DOLE)        */
/* ================================================================= */

main {
    max-width: 1000px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* GŁÓWNY GRID PRODUKTU */
.product-main-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

/* PREVIEW - LEWA STRONA */
.preview {
    flex: 1 1 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preview h2 {
    font-size: 26px;
    margin: 0;
    color: #000;
}

#mainImage {
    width: 100%;
    max-width: 500px;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.thumbs {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.thumb {
    width: 80px;
    height: 80px;
    flex: 0 0 auto;
    border: 2px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    object-fit: cover;
    transition: all 0.2s;
}

.thumb:hover {
    border-color: #000;
    transform: scale(1.05);
}

/* STAT AREA - PRAWA STRONA */
.statArea {
    flex: 1 1 400px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.statArea ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.statArea li {
    margin-bottom: 12px;
    font-size: 15px;
}

.statArea strong {
    font-weight: 600;
    color: #000;
}

/* FORMULARZ DODANIA DO KOSZYKA */
form {
    display: flex;
    justify-content: flex-start;
}

form button {
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    background: #000;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
}

/* KOLOR - NA DOLE STATAREA */
.color-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    color: #000;
}

.color-item img {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
}

/* OPIS PRODUKTU - NA DOLE */
.descArea {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    line-height: 1.6;
    color: #333;
    clear: both;
}

.descArea img {
    width: 100%;
    margin-top: 10px;
    border-radius: 6px;
}

/* RESPONSYWNE */
@media (max-width: 900px) {
    .product-main-grid {
        flex-direction: column;
    }

    .preview, .statArea {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    #mainImage {
        max-width: 100%;
    }

    .thumb {
        width: 60px;
        height: 60px;
    }

    .statArea li {
        font-size: 12px;
    }

    .color-item {
        font-size: 11px;
    }

    form button {
        width: 100%;
    }
}


/* ================================================================= */
/* INNE ELEMENTY                                                     */
/* ================================================================= */
.loading {
    color: #666;
    font-style: italic;
}