/* style.css - kafelki produktów, responsywne, detale rozwijane w dół */

/* ogólne */
body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* TOPBAR: wyszukiwarka na środku, wyloguj na prawej */
.topbar {
    background: #333;
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: center; /* wyszukiwarka na środku */
    align-items: center;
    position: relative;
}

.topbar input {
    padding: 8px 12px;
    width: 420px;
    border-radius: 6px;
    border: none;
    outline: none;
}

.topbar .logout {
    color: white;
    text-decoration: none;
    position: absolute;
    right: 18px;
    font-weight: 600;
}

/* PASEK SORTOWANIA */
.sortbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
}

.sort-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    font-weight: 600;
}

.sort-btn:hover { background:#f0f0f0; }
.sort-btn.active { background:#e8f0ff; border-color:#bcd2ff; }

/* KONTAINER KAFELKÓW */
.products {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

/* Pojedynczy kafelek */
.product-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border-radius: 8px;
    transition: background .12s ease, transform .06s ease;
    width: 1500px;           /* wymagany rozmiar */
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    position: relative;
    background: #fff; /* domyślne - nadpisywane przez zebra */
}

/* zebra (naprzemienne tło kafelków) */
.products .product-card:nth-child(odd)  { background: #ffffff; }
.products .product-card:nth-child(even) { background: #fbfbfb; }

.product-card:hover { transform: translateY(-3px); background:#f7f9ff; }

/* lewa kolumna - obrazek */
.product-left { flex: 0 0 150px; display:flex; justify-content:center; align-items:center; }
.produkt-img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    border: 1px solid #ddd;
    padding: 6px;
    border-radius: 6px;
    background: #fff;
}
.no-img {
    width: 140px; height: 140px;
    display:flex; align-items:center; justify-content:center;
    border: 1px dashed #ddd; color:#888; font-size:13px; border-radius:6px;
}

/* środek - nazwa + kod */
.product-center { flex: 1; min-width: 200px; }
.product-name { font-size: 18px; font-weight: 700; margin-bottom:6px; color:#222; }
.product-code { font-size: 14px; color:#666; margin-bottom:4px; }
.product-ean  { font-size: 12px; color:#999; }

/* prawa kolumna - stan */
.product-right { flex: 0 0 140px; text-align: right; font-size: 22px; font-weight:700; color:#0b6b3a; }

/* SZCZEGÓŁY - tabela wewnątrz kafelka (statyczna, nie absolute) */
.details {
    display: none;
    width: 100%;
    margin-top: 12px;
    box-sizing: border-box;
}

.details.open { display: block; }

/* tabela szczegółów */
.details-table {
    width: 100%;
    border-collapse: collapse;
    background:#fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.details-table th, .details-table td {
    padding: 8px 10px;
    border: 1px solid #e6e6e6;
    text-align: left;
    font-size: 14px;
}

.details-table th { background:#f0f0f0; font-weight:700; }

/* naprzemienne wiersze w tabeli (zebra) */
.details-table tbody tr:nth-child(odd)  { background:#ffffff; }
.details-table tbody tr:nth-child(even) { background:#fbfbfb; }

/* Responsywność */
@media (max-width: 1600px) {
    .product-card { width: 95%; flex-direction: column; align-items:flex-start; }
    .product-right { text-align: left; margin-top:10px; }
    .details { margin-top: 10px; }
}

@media (max-width: 520px) {
    .topbar input { width: 86%; }
    .product-name { font-size: 16px; }
    .product-right { font-size: 18px; }
}

/* Pasek filtrów marek */
.brandbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
}

.brand-btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fafafa;
    cursor: pointer;
    font-weight: 600;
}

.brand-btn:hover { background:#f0f0f0; }
.brand-btn.active { background:#e8f0ff; border-color:#bcd2ff; }
