/* Mazur Meble — design system
   Kierunek: szkic techniczny na jasnym drewnie (z grafiki w tle FB),
   bursztyn + czarny kontur (z logo). */

:root {
  --ink: #2a2420;          /* grafit ołówka, kontury */
  --ink-soft: #4a423b;
  --muted: #6b6158;        /* tekst pomocniczy, 5:1 na papierze */
  --line: #d8ccb8;         /* delikatne linie, ramki */
  --paper: #fbf7f0;        /* kartka */
  --birch: #ecdcc0;        /* jasne drewno */
  --birch-deep: #d8c097;
  --amber: #f2a93b;        /* kolor logo */
  --amber-soft: #fbe3b8;
  --amber-deep: #a8650a;   /* tekst w odcieniu bursztynu, czytelny na papierze */
  --leaf: #4e6b3a;         /* listek z logo: sukces, dostępność */
  --leaf-soft: #e1e9d4;
  --danger: #a33a22;

  --f-head: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;
  --f-hand: "Caveat", "Segoe Print", cursive;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --pop: 3px 3px 0 var(--ink);
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  font-variation-settings: "opsz" 72;
}
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 3.6vw, 46px); }
h3 { font-size: 22px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.hand { font-family: var(--f-hand); font-weight: 600; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Drewniana powierzchnia: tekstura generowana w assets/js/wood.js (kilka wariantów) */
.wood {
  background-color: var(--birch);
  background-image: var(--wood-img, none);
  background-size: var(--wood-size, 1400px 900px);
  background-position: center;
}
:root[data-wood="kartka"] .p-img.wood, :root[data-wood="kartka"] .item-img.wood { box-shadow: inset 0 0 0 1.5px var(--line); }

/* Przełącznik wariantów tła (tylko podgląd projektu) */
.wood-switch {
  position: fixed; left: 16px; bottom: 16px; z-index: 90; display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 6px; box-shadow: 3px 3px 0 var(--amber);
  font-size: 13px; max-width: calc(100vw - 32px);
}
.wood-switch span { padding: 0 6px 0 4px; color: #b5aa9a; }
.wood-switch button { border: 0; background: transparent; color: var(--paper); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 600; }
.wood-switch button:hover { background: rgba(255,255,255,.1); }
.wood-switch button[aria-pressed="true"] { background: var(--amber); color: var(--ink); }
@media (max-width: 600px) { .wood-switch { left: 8px; bottom: 8px; font-size: 11px; padding: 4px; } .wood-switch button { padding: 4px 6px; } .wood-switch span { display: none; } }

/* Kartka z kratką kreślarską */
.grid-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(42,36,32,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,36,32,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- Przyciski ---------- */
.btn {
  --bg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: var(--bg); color: var(--ink);
  font: 600 16px/1 var(--f-body);
  text-decoration: none; cursor: pointer;
  box-shadow: var(--pop);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .2s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { --bg: var(--amber); }
.btn-dark { --bg: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--amber); }
.btn-dark:hover { box-shadow: 4px 4px 0 var(--amber); }
.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; padding: 0 12px; text-decoration: underline; text-underline-offset: 4px; }
.btn-ghost:hover { box-shadow: none; transform: none; background: rgba(42,36,32,.06); }
.btn-ghost:active { transform: none; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 17px; padding: 0 30px; }
.btn svg { width: 20px; height: 20px; flex: none; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Nagłówek ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,247,240,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 50px; height: 50px; flex: none; }
.brand-name { font: 800 21px/1 var(--f-head); letter-spacing: -0.02em; }
.brand-name small { display: block; font: 600 17px/1.1 var(--f-hand); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 500;
  color: var(--ink-soft);
}
.nav a:hover { background: rgba(42,36,32,.06); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--amber-soft); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.cart-link { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--amber); border: 2px solid var(--ink);
  font: 700 12px/18px var(--f-body); text-align: center;
}
.cart-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .head-actions { margin-left: auto; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: 76px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px;
  }
  .brand-name small { display: none; }
}

/* ---------- Stopka ---------- */
.site-foot { background: var(--ink); color: #e9e1d4; margin-top: 120px; padding: 72px 0 32px; }
.site-foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; }
.foot-grid h4 { font-size: 16px; color: var(--amber); margin-bottom: 14px; letter-spacing: 0; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid ul a { text-decoration: none; color: #e9e1d4; }
.foot-grid ul a:hover { color: #fff; text-decoration: underline; }
.foot-logo { width: 150px; margin-bottom: 18px; }
.foot-bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #b5aa9a; }
.pay-marks { display: flex; gap: 8px; }
.pay-marks span { border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 4px 10px; font-weight: 600; font-size: 13px; color: #fff; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Szkice SVG ---------- */
.sk { width: 100%; height: auto; overflow: visible; }
.sk .l { stroke: var(--ink); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sk .lb { stroke: var(--ink); stroke-width: 1.1; fill: none; opacity: .45; stroke-linecap: round; }
.sk .c { stroke: var(--ink); stroke-width: .8; opacity: .28; fill: none; }
.sk .f { stroke: none; }
.sk .dim { stroke: var(--amber-deep); stroke-width: 1.1; fill: none; }
.sk .dimt { fill: var(--amber-deep); font: 600 19px var(--f-hand); }
.sk .leaf { fill: var(--leaf); opacity: .85; stroke: var(--ink); stroke-width: 1.2; }
.sk.drawn .l, .sk.drawn .lb { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }
.sk.drawn .c { opacity: 0; animation: fadein .6s ease forwards 1s; }
.sk.drawn .dim, .sk.drawn .dimt { opacity: 0; animation: fadein .5s ease forwards 1.3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

/* ---------- Karty produktów ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 28px 24px; }
.p-card { position: relative; text-decoration: none; display: flex; flex-direction: column; }
.p-card .p-img {
  aspect-ratio: 4 / 3.3; border-radius: var(--r-m); padding: 22px 26px 12px;
  display: grid; place-items: center; position: relative; overflow: hidden;
  border: 1.5px solid transparent; transition: border-color .2s;
}
.p-card:hover .p-img { border-color: var(--ink); }
.p-card .p-img .sk { max-height: 100%; }
.p-tag {
  position: absolute; left: 12px; top: 12px; z-index: 1;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 3px 10px; font-size: 13px; font-weight: 600;
}
.p-tag.leaf { background: var(--leaf-soft); }
.p-swatches { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; }
.p-swatches i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--paper); box-shadow: 0 0 0 1px rgba(42,36,32,.25); }
.p-meta { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px 0; align-items: baseline; }
.p-name { font: 700 19px/1.2 var(--f-head); letter-spacing: -0.01em; }
.p-sub { font-size: 14px; color: var(--muted); margin-top: 3px; }
.p-price { font: 700 19px/1.2 var(--f-head); white-space: nowrap; }
.p-price small { display: block; text-align: right; font: 500 13px var(--f-body); color: var(--muted); }

/* ---------- Pola formularzy ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.input:hover, .select:hover { border-color: var(--birch-deep); }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--amber-soft); }

.choice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.choice:hover { border-color: var(--birch-deep); }
.choice input { accent-color: var(--ink); width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: var(--pop); }
.choice .c-body { flex: 1; }
.choice .c-title { font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.choice .c-desc { font-size: 14px; color: var(--muted); margin-top: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
  font-size: 15px; font-weight: 500; transition: all .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input { display: none; }

.swatch {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .15s, transform .15s;
  background-size: cover;
}
.swatch:hover { transform: scale(1.06); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.qty button { width: 38px; height: 40px; border: 0; background: none; cursor: pointer; font-size: 20px; }
.qty button:hover { background: rgba(42,36,32,.06); }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }

/* ---------- Drobne ---------- */
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding: 22px 0 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }

.note {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--amber-soft); font-size: 15px;
}
.note svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.note.leaf { background: var(--leaf-soft); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  transform: translate(-50%, 140%); transition: transform .4s var(--ease);
  background: var(--ink); color: var(--paper); border-radius: 14px; padding: 14px 18px;
  display: flex; gap: 12px; align-items: center; box-shadow: 4px 4px 0 var(--amber);
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast a { color: var(--amber); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

@media (max-width: 1100px) { .head-phone { display: none; } }
