/* Storefront — wspólny styl stron katalogu/produktu/koszyka.
   Akcent i fonty wstrzykiwane per brand przez zmienne CSS na <body>. */

:root {
    --accent: #ff5252;
    --accent-contrast: #ffffff;
    --heading-font: system-ui, sans-serif;
    --body-font: system-ui, sans-serif;
    --ink: #1a1a1a;
    --muted: #6b7280;
    --line: #e6e6e6;
    --bg: #faf9f7;
    --card: #ffffff;
    --radius: 14px;
    --btn-radius: 999px;
    --price-color: var(--ink);
    --header-bg: rgba(255, 255, 255, 0.92);
    --heading-transform: none;
    --heading-spacing: normal;
    --btn-bg: var(--accent);
    --btn-shadow: none;
    --cover-bg: #efeae3;
}

* { box-sizing: border-box; }

body.sf {
    margin: 0;
    font-family: var(--body-font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

.sf h1, .sf h2, .sf h3, .sf .brand-name {
    font-family: var(--heading-font);
    text-transform: var(--heading-transform);
    letter-spacing: var(--heading-spacing);
}

.sf a { color: inherit; text-decoration: none; }
.sf-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header */
.sf-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.sf-header .row { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.brand-name small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; font-family: var(--body-font); }
.sf-nav { display: flex; align-items: center; gap: 18px; }
.sf-nav a { font-size: 15px; color: var(--muted); }
.sf-nav a:hover { color: var(--ink); }
.cart-link { font-weight: 600; color: var(--ink) !important; }
.cart-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
    font-size: 12px; font-weight: 700; color: #fff; background: var(--accent);
    border-radius: 999px; font-family: var(--body-font);
}
.locale-switch { display: flex; gap: 6px; }
.locale-switch a { font-size: 13px; text-transform: uppercase; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line); }
.locale-switch a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font: inherit; font-weight: 600;
    padding: 11px 20px; border-radius: var(--btn-radius); border: 0;
    background: var(--btn-bg); color: var(--accent-contrast);
    box-shadow: var(--btn-shadow);
    transition: filter .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover { filter: brightness(0.93); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Layout helpers */
.sf-main { padding: 36px 0 64px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 34px; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 26px; }
.filters .chip {
    font-size: 14px; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.filters .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters form { margin-left: auto; display: flex; gap: 8px; }
.filters input[type=search] {
    font: inherit; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); min-width: 220px;
}

/* Book grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.book-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.book-cover { aspect-ratio: 3/4; background: var(--cover-bg); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c9bfb2; font-size: 38px; }
.book-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.book-meta { font-size: 13px; color: var(--muted); }
.book-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 19px; font-weight: 700; color: var(--price-color); }
.tag { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

/* Product page */
.product { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 44px; align-items: start; }
.product .cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3/4; background: var(--cover-bg); }
.product .cover img { width: 100%; height: 100%; object-fit: cover; }
.product .cover .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c9bfb2; font-size: 64px; }
.product h1 { font-size: 32px; margin: 0 0 10px; }
.product .desc { color: #333; margin: 16px 0 24px; }
.product .buybar { display: flex; align-items: center; gap: 16px; margin: 20px 0; }
.product .buybar .price { font-size: 28px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--accent); }
.previews { margin-top: 30px; }
.previews .strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.previews img { height: 200px; border-radius: 8px; border: 1px solid var(--line); }

/* Cart */
.cart-item { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item .thumb { width: 60px; height: 80px; border-radius: 8px; object-fit: cover; background: var(--cover-bg); flex: none; }
.cart-item .grow { flex: 1; }
.cart-summary { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.cart-summary .total { font-size: 22px; font-weight: 700; }

/* Flash + empty */
.flash { background: #effaf0; border: 1px solid #bfe6c4; color: #1f6f33; padding: 12px 16px; border-radius: 10px; margin-bottom: 22px; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* Checkout */
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h2 { margin: 0 0 18px; font-size: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field select {
    width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.field .err { color: #c0392b; font-size: 13px; 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: 14px; }
.check input { margin-top: 3px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 15px; }
.summary-line.big { font-size: 20px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.pay-option { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.errors-box { background: #fdecea; border: 1px solid #f5c2bd; color: #a4271b; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; }

/* Status / simulate */
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.sim-box { max-width: 520px; margin: 0 auto; text-align: center; }
.sim-box .amount { font-size: 40px; font-weight: 800; margin: 14px 0; }
.sim-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

@media (max-width: 820px) {
    .checkout { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
}

/* Footer */
.sf-footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: 14px; }

/* Pagination (Laravel default tweaks) */
.sf nav[role=navigation] { margin-top: 32px; }

@media (max-width: 720px) {
    .product { grid-template-columns: 1fr; }
    .product .cover { max-width: 280px; }
}
