/* ===== GLOBAL ===== */

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:#ffffff;
}

/* ===== HEADER (STICKY) ===== */

.top-bar{
    position: sticky;
    top: 0;
    z-index: 999;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 20px;
    background:#1f3b5c;
    color:#fff;
    box-shadow:0 2px 8px rgba(0,0,0,0.15);
}

/* sekcje */
.top-bar .left,
.top-bar .center,
.top-bar .right{
    display:flex;
    align-items:center;
}

/* środek */
.top-bar .center{
    flex:1;
    justify-content:center;
}

/* logo */
.logo{
    height:34px;
}

/* flagi */
.flag{
    width:22px;
    margin:0 5px;
    cursor:pointer;
    transition:transform .15s;
}

.flag:hover{
    transform:scale(1.15);
}

/* koszyk */
.cart-summary{
    font-size:14px;
    font-weight:500;
}

/* logout */
.logout-btn{
    margin-left:12px;
    color:#fff;
    text-decoration:none;
    font-weight:bold;
}

.logout-btn:hover{
    opacity:0.8;
}

/* content */
.page-content{
    padding:20px;
}

/* ===== WYSZUKIWARKA ===== */

.search-wrapper{
    width:1200px;
    margin:30px auto;
    text-align:center;
    padding:20px;
    border:1px solid #e6e6e6;
    border-radius:8px;
    background:#fafafa;
}

.search-wrapper input{
    width:380px;
    padding:12px;
    font-size:14px;
    border:1px solid #ccc;
    border-radius:6px;
}

/* ===== TABELA ===== */

.order-container{
    width:1200px;
    margin:20px auto 100px auto;
}

#products-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    font-size:14px;
    border:1px solid #e5e5e5;
}

/* komórki */
#products-table th,
#products-table td{
    padding:10px 12px;
    vertical-align:middle;
    border-right:1px solid #ececec;
    border-bottom:1px solid #ececec;
}

/* ostatnia kolumna */
#products-table th:last-child,
#products-table td:last-child{
    border-right:none;
}

/* nagłówek */
#products-table thead th{
    background:#f7f7f7;
    font-weight:600;
    text-align:left;
    border-bottom:2px solid #dcdcdc;
}

/* zebra */
#products-table tbody tr:nth-child(even){
    background:#fafafa;
}

/* hover */
#products-table tbody tr:hover{
    background:#e9f2ff;
    transition:background .15s;
}

/* SKU */
#products-table td:nth-child(2),
#products-table th:nth-child(2){
    text-align:center;
    font-weight:600;
    letter-spacing:0.5px;
    font-family:monospace;
}

/* zdjęcia */
.product-img{
    width:60px;
    height:60px;
    object-fit:contain;
    border:1px solid #eee;
    background:#fff;
    padding:3px;
    cursor:pointer;
}

/* ===== INPUT ILOŚCI ===== */

.qty{
    width:70px;
    padding:6px;
    border-radius:4px;
    border:1px solid #ccc;
    text-align:center;
    background:#f9fbff;
}

.qty:focus{
    outline:none;
    border:1px solid #1e3b5c;
    box-shadow:0 0 4px rgba(30,59,92,0.3);
    background:#ffffff;
}

/* wartość */
.value{
    font-weight:600;
    color:#1e3b5c;
}

/* ===== BUTTONY ===== */

.order-btn{
    margin-top:15px;
    width:100%;
    padding:10px;
    background:#1e3b5c;
    color:white;
    border:none;
    border-radius:6px;
    font-weight:600;
    cursor:pointer;
}

.order-btn:hover{
    background:#142d49;
}

.search-btn{
    margin-top:10px;
    width:100%;
    padding:10px;
    background:#e9ecef;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:600;
}

.search-btn:hover{
    background:#dfe3e7;
}

/* ===== ZDJĘCIA ===== */

.more-photos{
    font-size:12px;
    text-decoration:none;
    color:#1e3b5c;
}

.more-photos:hover{
    text-decoration:underline;
}

.img-wrap{
    position:relative;
    display:inline-block;
}

/* preview */
.img-preview{
    display:none;
    position:absolute;
    left:70px;
    top:0;
    background:white;
    border:1px solid #ccc;
    padding:10px;
    box-shadow:0 4px 12px rgba(0,0,0,0.2);
    z-index:999;
}

.img-preview img{
    width:220px;
}

.img-wrap:hover .img-preview{
    display:block;
}

/* ===== GALERIA ===== */

#gallery-overlay{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.9);
    align-items:center;
    justify-content:center;
    z-index:9999;
}

#gallery-overlay img{
    max-width:85%;
    max-height:85%;
}

.gallery-nav{
    position:absolute;
    top:50%;
    font-size:60px;
    color:white;
    cursor:pointer;
    user-select:none;
}

.prev{ left:40px; }
.next{ right:40px; }

.gallery-close{
    position:absolute;
    top:20px;
    right:40px;
    font-size:40px;
    color:white;
    cursor:pointer;
}

/* ===== LOGIN ===== */

.login-wrapper{
    width:420px;
    margin:120px auto;
    background:white;
    border:1px solid #e5e5e5;
    border-radius:10px;
    padding:40px;
    box-shadow:0 8px 25px rgba(0,0,0,0.08);
    text-align:center;
}

.login-wrapper h1{
    margin-bottom:25px;
}

.login-wrapper input{
    width:100%;
    padding:12px;
    border:1px solid #ccc;
    border-radius:6px;
    margin-bottom:15px;
}

.login-wrapper button{
    width:100%;
    padding:12px;
    background:#1e3b5c;
    color:white;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-weight:600;
}

.login-wrapper button:hover{
    background:#142d49;
}

/* flagi login */
.login-flags{
    display:flex;
    justify-content:center;
    gap:8px;
    margin:10px 0 15px 0;
}

.login-flags img{
    width:22px;
    cursor:pointer;
    transition:transform .15s;
}

.login-flags img:hover{
    transform:scale(1.15);
}

/* ===== MOBILE ===== */

@media (max-width:768px){

    .top-bar{
        flex-wrap:wrap;
        gap:8px;
    }

    .top-bar .center{
        width:100%;
        order:3;
        justify-content:center;
    }

    .search-wrapper,
    .order-container{
        width:95%;
    }

    .search-wrapper input{
        width:100%;
    }

}