/* =====================================================================
   Skrzat B2B — system marki (spójny z wizytówką skrzatmeble.pl)
   ===================================================================== */

/* Albert Sans — wgraj woff2 do /assets/fonts/, inaczej fallback systemowy */
@font-face {
    font-family: 'Albert Sans';
    src: url('/assets/fonts/AlbertSans.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ink: #20261D;
    --muted: #66705C;
    --faint: #9AA491;
    --sage: #5E7A50;
    --sage-dark: #4C6140;
    --sage-light: #8FA97F;
    --sage-soft: #EFF3EC;
    --mist: #F4F6F1;
    --line: #D8DDD2;
    --white: #FFFFFF;
    --danger: #A6432F;
    --danger-soft: #F6E7E2;
    --ok: #4C6140;
    --ok-soft: #E6EFE1;
    --radius-lg: 28px;
    --radius-md: 22px;
    --radius-sm: 16px;
    --shadow: 0 8px 30px rgba(32, 38, 29, 0.08);
    --shadow-sm: 0 2px 10px rgba(32, 38, 29, 0.06);
    --font: 'Albert Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
.rules-box li, .prose li, .prose p { overflow-wrap: anywhere; }

.wrap { width: min(1120px, 92%); margin: 0 auto; }

a { color: var(--sage-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------------- Header ---------------- */
.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; }
.brand-mark { font-weight: 800; letter-spacing: 0.08em; font-size: 1.35rem; color: var(--ink); }
.brand-mark.small { font-size: 1.1rem; }
.brand-a { color: var(--sage); }
.brand-sub {
    font-weight: 700; font-size: 0.7rem; letter-spacing: 0.18em;
    color: var(--white); background: var(--sage); padding: 2px 8px; border-radius: 999px;
}
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--ink); font-weight: 500; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--sage-dark); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--sage); color: var(--white); border: 0;
    padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 1rem;
    cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--sage-dark); text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }
.btn-outline { background: transparent; color: var(--sage-dark); border: 1.5px solid var(--sage); }
.btn-outline:hover { background: var(--sage-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Sections ---------------- */
.site-main { flex: 1; }
.section { padding: 64px 0; }
.section.tint { background: var(--mist); }
.hero { padding: 72px 0 56px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 620px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

/* ---------------- Cards ---------------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-md); padding: 28px; box-shadow: var(--shadow-sm);
}
.card.feature { border-radius: var(--radius-lg); }
.card h3 { margin-top: 0; }
.card .icon {
    width: 48px; height: 48px; border-radius: 14px; background: var(--sage-soft);
    display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 16px;
}

/* ---------------- Forms ---------------- */
.form-card {
    max-width: 480px; margin: 48px auto; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 40px; box-shadow: var(--shadow);
}
.form-card.wide { max-width: 640px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field select, .field textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
    border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft);
}
.field .hint { font-size: 0.82rem; color: var(--faint); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); }
.check input { margin-top: 4px; }

/* ---------------- Flash ---------------- */
.flash-wrap { margin-top: 18px; display: grid; gap: 10px; }
.flash { padding: 12px 18px; border-radius: var(--radius-sm); font-size: 0.95rem; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-success { background: var(--ok-soft); color: var(--ok); }

/* ---------------- Status pills ---------------- */
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill-wait { background: #F3EEDF; color: #7A5B14; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-no { background: var(--danger-soft); color: var(--danger); }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--mist); padding: 36px 0; margin-top: 64px; }
.footer-inner { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- Cookie banner ---------------- */
.cookie-banner {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    width: min(760px, 94%); background: var(--ink); color: var(--white);
    padding: 14px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: space-between; gap: 16px; z-index: 60; font-size: 0.9rem;
}
.cookie-banner a { color: var(--sage-light); }

/* ---------------- Prose (legal) ---------------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose .updated { color: var(--faint); font-size: 0.9rem; }

/* ---------------- Sklep ---------------- */
.shop-head { background: var(--mist); border-bottom: 1px solid var(--line); padding: 32px 0; }
.shop-head h1 { margin: 8px 0 4px; }
.shop-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rules-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 20px; margin-top: 18px; font-size: 0.9rem; }
.rules-box ul { margin: 8px 0 0; padding-left: 18px; columns: 2; column-gap: 28px; }
.rules-box li { margin-bottom: 4px; break-inside: avoid; }

.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.cat-tabs a { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 0.9rem; }
.cat-tabs a.active, .cat-tabs a:hover { background: var(--sage); color: #fff; border-color: var(--sage); text-decoration: none; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.product-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; display: block; color: inherit; transition: box-shadow .15s, transform .15s; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.product-card.static:hover { transform: none; box-shadow: var(--shadow-sm); }
.product-thumb { position: relative; aspect-ratio: 4/3; background: var(--sage-soft); display: grid; place-items: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { font-size: 3rem; font-weight: 800; color: var(--sage-light); }
.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--sage); color: #fff; }
.badge-nowosc { background: #7A5B14; }
.product-body { padding: 14px 16px; }
.product-body h3 { margin: 4px 0 8px; font-size: 1.05rem; }
.product-meta { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; color: var(--sage-dark); }

.product-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; margin-top: 16px; }
.gallery { display: grid; gap: 12px; }
.gallery img { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--line); }
.gallery-ph { aspect-ratio: 1; background: var(--sage-soft); border-radius: var(--radius-lg); display: grid; place-items: center; }
.gallery-ph span { font-size: 6rem; font-weight: 800; color: var(--sage-light); }
.buy-box h1 { margin: 6px 0; }
.price-lg { font-size: 1.8rem; font-weight: 800; color: var(--sage-dark); margin: 14px 0; }
.add-form { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; margin: 8px 0 20px; }
.qty-field input { max-width: 120px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.spec-table td:first-child { color: var(--muted); }
.file-list { list-style: none; padding: 0; }
.file-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ---------------- Koszyk / checkout ---------------- */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line-main { display: flex; flex-direction: column; gap: 2px; }
.cart-qty { display: flex; align-items: center; gap: 8px; margin: 0; }
.cart-qty input { width: 72px; padding: 8px; border: 1.5px solid var(--line); border-radius: 10px; }
.cart-line-total { font-weight: 700; }
.cart-summary { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; position: sticky; top: 90px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row.grand { border-top: 2px solid var(--sage); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }
.checkout-main { display: grid; gap: 16px; }

/* ---------------- Panel admina ---------------- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 28px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.admin-nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 0.92rem; }
.admin-nav a:hover { background: var(--sage-soft); text-decoration: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; color: var(--ink); display: block; }
.stat-card:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.stat-num { display: block; font-size: 2rem; font-weight: 800; color: var(--sage-dark); }
.verify-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.company-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.company-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mini { font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.mini input, .mini select { padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 10px; }
.mini.check { flex-direction: row; align-items: center; gap: 6px; }
.file-manager { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.fm-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 120px; text-align: center; }
.fm-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.fm-doc { width: 120px; height: 90px; display: grid; place-items: center; font-size: 2rem; background: var(--sage-soft); border-radius: 10px; }
.upload-form { border-top: 1px solid var(--line); padding-top: 16px; }
.cur-switch { display: inline-flex; align-items: center; gap: 6px; }
.cur-switch a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.cur-switch a.active, .cur-switch a:hover { background: var(--sage); color: #fff; border-color: var(--sage); text-decoration: none; }
.lang-switch { display: inline-flex; gap: 2px; font-size: 0.8rem; margin-left: 4px; }
.lang-switch a { padding: 3px 7px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.lang-switch a.active { background: var(--sage-soft); color: var(--sage-dark); }

@media (max-width: 860px) {
    .product-detail { grid-template-columns: 1fr; }
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .rules-box ul { columns: 1; }
    .cart-summary { position: static; }
}
@media (max-width: 680px) {
    .header-inner { flex-wrap: wrap; gap: 10px; row-gap: 6px; }
    .main-nav { gap: 10px 14px; font-size: 0.92rem; flex-wrap: wrap; justify-content: flex-end; }
    .site-header { position: static; }
    .field-row { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 20px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-body h3 { font-size: 0.98rem; }
    .hero { padding: 44px 0 32px; }
    .section { padding: 44px 0; }
    .form-card { padding: 26px 20px; margin: 24px auto; }
    .cart-line { grid-template-columns: 1fr auto; row-gap: 8px; }
    .cart-line .cart-line-total { grid-column: 1; text-align: left; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .company-row { flex-direction: column; align-items: stretch; }
    .company-controls { justify-content: space-between; }
    .btn { padding: 12px 20px; }
}
@media (max-width: 380px) {
    .product-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    h1 { font-size: 1.7rem; }
}
