:root { --accent: #6b4f2a; --ink: #1f2430; --muted: #6b7280; --line: #e5e7eb; --bg: #fafafa; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5; }
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
a { color: var(--accent); }

header.site { display: flex; justify-content: space-between; align-items: center;
  max-width: 960px; margin: 0 auto; padding: 14px 16px; }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--ink); }
.cart-link { text-decoration: none; font-weight: 600; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }

h1 { font-size: 26px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.crumb { margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card h2 { font-size: 16px; margin: 10px 0 4px; }
.card h2 a { text-decoration: none; color: var(--ink); }
.card-media, .product-media { display: grid; place-items: center; background: #f3f4f6;
  border-radius: 10px; height: 140px; text-decoration: none; }
.ph { font-size: 44px; opacity: .7; }
.price { font-weight: 700; margin: 0 0 12px; }
.price.big { font-size: 22px; }

.product { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.product-media { height: 260px; }
.add-form { display: flex; gap: 12px; align-items: end; margin: 16px 0; }
.add-form label, .add-form input { display: block; }
.add-form input[type=number] { width: 72px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

.btn { -webkit-appearance: none; appearance: none; display: inline-block;
  background: #fff; border: 1.5px solid var(--accent); color: var(--accent);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn { transition: background .12s, box-shadow .12s, transform .06s; }
/* secondary-only hover/active — MUST exclude .btn-primary, else it clobbers the
   primary button's dark background on hover and leaves white-on-white (invisible). */
.btn:not(.btn-primary):hover { background: #f3e7d6; box-shadow: 0 2px 8px rgba(107,79,42,.15); }
.btn:not(.btn-primary):active { background: #ecdcc6; box-shadow: none; transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
/* filled button: a shadow "lift" + slight brighten reads clearly on any base colour */
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); box-shadow: 0 4px 12px rgba(107,79,42,.35); }
.btn-primary:active { background: var(--accent); filter: brightness(0.92); box-shadow: none; transform: translateY(1px); }
/* keyboard/mouse focus: always a visible ring, never a blended/invisible state */
.btn:focus-visible, .link-btn:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

table.cart { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
table.cart th, table.cart td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.cart th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.qty-form input { width: 60px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; text-decoration: none; }

/* header nav: cart + (admin only) Panel link */
.site-nav { display: flex; align-items: center; gap: 16px; }
.nav-admin { color: var(--accent); font-weight: 700; text-decoration: none; }
.nav-admin:hover { text-decoration: underline; }
.nav-logout { text-decoration: none; font-weight: 600; }   /* matches the other nav links (Koszyk) */
.nav-logout:hover { color: var(--accent); }
.nav-user { color: var(--muted); font-size: 13px; }
/* discreet footer login/logout — low-profile, like religo's */
.footer-login { color: var(--muted); text-decoration: none; }
.footer-login:hover { color: var(--accent); text-decoration: underline; }
.footer-ver { font-family: ui-monospace, monospace; font-size: 11px; opacity: .65; }

.summary { max-width: 380px; margin-left: auto; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 12px; }
.summary dt.total, .summary dd.total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }
.summary dd { text-align: right; margin: 0; }
.free { color: #2f7a3d; font-weight: 700; }
.freeship { background: #f0f7f1; border: 1px solid #cfe6d4; border-radius: 10px; padding: 10px 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
footer.site { max-width: 960px; margin: 0 auto; padding: 24px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* reduced checkout header */
header.site.minimal { border-bottom: 1px solid var(--line); }
.secure-note { color: var(--muted); font-size: 13px; }

/* checkout */
.checkout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.checkout-form section { margin-bottom: 24px; }
.checkout-form h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.checkout-form label { display: block; margin: 10px 0; font-size: 14px; }
.checkout-form input[type=text], .checkout-form input[type=email], .checkout-form input[type=tel] {
  display: block; width: 100%; padding: 9px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.checkout-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.radio { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin: 8px 0; cursor: pointer; }
label.radio input { width: auto; }
.method-panel { padding: 4px 12px 8px 34px; }
.pc-hint { font-size: 13px; } .pc-hint.ok { color: #2f7a3d; } .pc-hint.bad { color: #b23b3b; }
inpost-geowidget { display: block; height: 400px; margin: 8px 0; }

.errors { background: #fdecec; border: 1px solid #f3c2c2; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.errors ul { margin: 0; padding-left: 18px; }

.order-summary { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; position: sticky; top: 16px; }
.order-summary h2 { margin-top: 0; font-size: 15px; }
.mini-cart { list-style: none; margin: 0 0 12px; padding: 0; }
.mini-cart li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.order-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.order-summary dd { text-align: right; margin: 0; }
.order-summary dt.total, .order-summary dd.total { font-weight: 800; font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0 0 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* order status + dev-pay */
.order-status, .devpay { max-width: 560px; margin: 0 auto; }
.ok-banner { background: #f0f7f1; border: 1px solid #cfe6d4; border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.ok-banner h1 { color: #2f7a3d; margin: 0 0 6px; }
.pending-note { color: var(--amber, #8f6413); }
.order-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.order-id { font-family: ui-monospace, monospace; font-size: 18px; font-weight: 700; margin: 2px 0 14px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 0; }
.totals dd { text-align: right; margin: 0; } .totals dt.total, .totals dd.total { font-weight: 800; font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; }
td.r { text-align: right; }
.dev-badge { background: #fff4e5; border: 1px solid #f0d9ad; color: #8a5a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.devpay-amount { font-size: 30px; font-weight: 800; margin: 6px 0 14px; }
.devpay-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }

/* fulfillment panel */
.panel-login { max-width: 420px; margin: 0 auto; }
.panel-login input { display: block; width: 100%; padding: 9px 10px; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 28px; }
.panel-orders { width: 100%; border-collapse: collapse; }
.panel-orders th, .panel-orders td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.panel-orders th { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.oid { font-family: ui-monospace, monospace; font-weight: 600; }
a.oid { color: var(--accent); text-decoration: none; }         /* clickable order no in the panel */
a.oid:hover { text-decoration: underline; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline select { padding: 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-paid { background: #eef6ff; color: #1c5fb0; }
.pill-label_ready { background: #fff4e5; color: #8a5a00; }
.pill-shipped { background: #f0f7f1; color: #2f7a3d; }

/* account + order lookup */
.narrow { max-width: 460px; margin: 0 auto; }
.stacked label { display: block; margin: 10px 0; font-size: 14px; }
.stacked input { display: block; width: 100%; padding: 9px 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.account-offer { background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 18px 0; }
.account-offer .inline { margin-top: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* email typo suggestion + confirmation */
.email-suggest { min-height: 18px; font-size: 13px; color: var(--amber, #8f6413); margin: -6px 0 8px; }
.email-suggest a { color: var(--accent); }
.email-confirm { margin: 10px 0; }
.email-hl { font-size: 16px; font-weight: 700; margin: 2px 0 0; word-break: break-all; }
.change-link { font-size: 13px; font-weight: 500; margin-left: 8px; }
.confirm-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 12px 0; cursor: pointer; }
.confirm-check input { margin-top: 3px; }

/* --- mobile --- */
/* any table scrolls inside its own box → the page body never scrolls sideways */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

@media (max-width: 560px) {
  main { padding: 18px 12px 40px; }
  header.site { padding: 12px 12px; }
  h1 { font-size: 22px; }
  .btn { padding: 11px 16px; }             /* larger tap targets */
  .order-summary { position: static; }

  /* cart table → stacked cards (each item a block, no cramped columns) */
  table.cart-mobile thead { display: none; }
  table.cart-mobile, table.cart-mobile tbody, table.cart-mobile tr, table.cart-mobile td { display: block; width: 100%; }
  table.cart-mobile tr { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; padding: 10px 14px; }
  table.cart-mobile td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table.cart-mobile td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
  table.cart-mobile td[data-label=""]::before { content: none; }
  table.cart-mobile td[data-label=""] { justify-content: flex-end; }
  .qty-form input { width: 68px; }
}
@media (max-width: 640px) { .product { grid-template-columns: 1fr; } }
