:root {
    --green: #2e7d32;
    --green-d: #1b5e20;
    --ink: #1f2328;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f7f8fa;
    --card: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; margin: .2em 0; }
h2 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* --- Header --- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 16px; }
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; color: var(--green-d);
    white-space: nowrap; flex-shrink: 0; }
.logo span { color: var(--muted); font-weight: 600; }
.search { display: flex; flex: 1; max-width: 560px; margin-left: auto; }
.search input { flex: 1; padding: 10px 14px; border: 1px solid var(--line); border-right: 0;
    border-radius: 8px 0 0 8px; font-size: 15px; outline: none; }
.search input:focus { border-color: var(--green); }
.search button { padding: 10px 18px; border: 0; background: var(--green); color: #fff;
    border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 600; }
.search button:hover { background: var(--green-d); }

/* --- Mobilna nawigacja kategorii (kafelki na gorze, tylko telefon) --- */
.cat-nav-mobile { display: none; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 0; }
.cat-tiles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; padding: 0 16px; }
.cat-green-tile { background: var(--green-d); color: #fff; border-radius: 8px; padding: 11px 8px;
    text-align: center; font-size: .78rem; font-weight: 500; line-height: 1.2;
    display: flex; align-items: center; justify-content: center; min-height: 44px; transition: background .12s; }
.cat-green-tile:hover { background: var(--green); }

/* --- Uklad: lewy sticky sidebar (PC) + tresc --- */
.layout { display: flex; gap: 22px; align-items: flex-start; max-width: 1180px; margin: 0 auto;
    padding: 22px 16px 48px; }
.sidebar { flex: 0 0 210px; position: sticky; top: 76px; }
.sidebar-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sidebar-head { background: var(--green-d); color: #fff; font-weight: 600; padding: 10px 14px; font-size: .92rem; }
.sidebar-cat { display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 9px 14px; border-top: 1px solid #f0f1f3; font-size: .85rem; color: var(--ink); }
.sidebar-cat:hover { background: #eaf3ea; color: var(--green-d); }
.sc-count { color: #9ca3af; font-size: .76rem; }
.content { flex: 1; min-width: 0; }

@media (max-width: 900px) {
    .layout { display: block; padding: 14px 16px 40px; }
    .sidebar { display: none; }
    .cat-nav-mobile { display: block; }
}

/* --- Layout --- */
.main { padding: 24px 16px 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 8px 0 16px; border-bottom: 2px solid var(--line); padding-bottom: 8px; }

/* --- Hero --- */
.hero { background: linear-gradient(120deg, var(--green-d), var(--green)); color: #fff;
    padding: 40px 28px; border-radius: var(--radius); margin-bottom: 24px; }
.hero h1 { color: #fff; font-size: 2rem; margin: 0 0 8px; }
.hero p { margin: 0; opacity: .92; }

/* --- Carousel (wyroznione produkty) --- */
.carousel { position: relative; margin: 4px 0 28px; }
.carousel-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -ms-overflow-style: none; padding: 2px; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 calc((100% - 28px) / 3); scroll-snap-align: start; }
.car-img { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3;
    background: #eef0f2; border: 1px solid var(--line); }
.car-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; }
.car-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c1c6cc; }
.car-name { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.72);
    color: var(--ink); padding: 5px 9px; font-size: .68rem; font-weight: 600; line-height: 1.2;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--green-d);
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3;
    box-shadow: var(--shadow); }
.car-arrow:hover { border-color: var(--green); }
.car-prev { left: -6px; } .car-next { right: -6px; }
.car-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.car-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px;
    background: #cfd4da; cursor: pointer; transition: width .2s, background .2s; }
.car-dots button.active { width: 20px; background: var(--green-d); }
@media (max-width: 800px) {
    .carousel-item { flex: 0 0 82%; }
    .car-prev { left: 2px; } .car-next { right: 2px; }
    .car-arrow { width: 32px; height: 32px; }
}

/* --- Category tiles --- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
    gap: 12px; margin-bottom: 28px; }
.cat-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 16px; text-align: center; font-weight: 600; box-shadow: var(--shadow);
    transition: transform .12s, border-color .12s; }
.cat-tile:hover { transform: translateY(-2px); border-color: var(--green); color: var(--green-d); }

/* --- Product grid --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.card-img { position: relative; height: 140px; background: #f0f1f3; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%;
    color: #aab; font-size: .85rem; }
.noimg-lg { min-height: 320px; }
.badge { position: absolute; top: 8px; left: 8px; font-size: .72rem; font-weight: 700;
    padding: 3px 8px; border-radius: 20px; color: #fff; }
.badge-in { background: var(--green); }
.badge-out { background: #b0752a; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card-cat { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.card-name { font-weight: 600; line-height: 1.25; font-size: .9rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.3em; }
.card-sku { font-size: .8rem; color: var(--muted); }
.card-price { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--green-d); }
.card-price small { font-weight: 400; color: var(--muted); }
.card-price.muted { color: var(--muted); font-weight: 600; }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0 0; }
.pagination a { padding: 8px 16px; background: #fff; border: 1px solid var(--line);
    border-radius: 8px; font-weight: 600; }
.pagination a:hover { border-color: var(--green); color: var(--green-d); }
.pg-info { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* --- Breadcrumb --- */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--green-d); }
.cat-desc { color: var(--muted); margin-bottom: 18px; }

/* --- Product detail --- */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gallery-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; }
.gallery-main img { width: 100%; height: 420px; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 68px; height: 68px; object-fit: contain; border: 1px solid var(--line);
    border-radius: 8px; padding: 4px; cursor: pointer; background: #fff; }
.gallery-thumbs img:hover { border-color: var(--green); }
.product-sku { color: var(--muted); margin: 6px 0 14px; }
.availability { display: inline-block; font-weight: 700; font-size: .85rem; padding: 5px 12px;
    border-radius: 20px; margin-bottom: 14px; }
.av-in { background: #e8f5e9; color: var(--green-d); }
.av-out { background: #fdf0dd; color: #91631d; }
.product-price { font-size: 1.8rem; font-weight: 800; color: var(--green-d); margin-bottom: 16px; }
.product-price small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.tiers { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: .92rem; }
.tiers caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.tiers th, .tiers td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.tiers thead th { background: #f0f1f3; }
.lead { font-size: 1.02rem; }
.btn-ask { display: inline-block; background: var(--green); color: #fff; padding: 14px 28px;
    border-radius: 8px; font-weight: 700; font-size: 1.05rem; margin-top: 8px; }
.btn-ask:hover { background: var(--green-d); }

.product-desc, .product-spec { margin-top: 36px; }
.product-desc h2, .product-spec h2 { border-bottom: 2px solid var(--line); padding-bottom: 8px; }
.spec { width: 100%; border-collapse: collapse; }
.spec th, .spec td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.spec th { background: #f0f1f3; width: 40%; font-weight: 600; }

/* --- Footer --- */
.site-footer { background: #1f2328; color: #cbd0d6; margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
    padding: 28px 16px; }
.footer-inner strong { color: #fff; }
.footer-inner p { margin: 4px 0 0; font-size: .9rem; }
.footer-cats { display: flex; flex-wrap: wrap; gap: 6px 16px; max-width: 520px; }
.footer-cats a { color: #cbd0d6; font-size: .9rem; }
.footer-cats a:hover { color: #fff; }
.footer-copy { width: 100%; border-top: 1px solid #333; padding-top: 14px; font-size: .82rem; color: #8b9199; }

/* --- Responsive --- */
@media (max-width: 800px) {
    .product { grid-template-columns: 1fr; gap: 20px; }
    .gallery-main img { height: 300px; }
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .search { max-width: none; order: 3; width: 100%; }
    .hero h1 { font-size: 1.5rem; }
}
