/* =========================================================
   La Mariposa — sklep (koszyk, produkt, zamówienie, dokumenty)
   ========================================================= */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- podstrony ---------- */
body.page { background: var(--paper); }
.page__main { padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); min-height: 70vh; }
.nav--page { position: sticky; }
body.page .nav { position: fixed; }
.crumbs { padding: 28px var(--gutter) 0; margin: 0; font-size: 13px; letter-spacing: .08em; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* ---------- przycisk koszyka ---------- */
.cart-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.cart-btn__count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10px; line-height: 18px; text-align: center; font-weight: 500;
  font-variant-numeric: tabular-nums; transition: background .8s;
}
.cart-btn__count[hidden] { display: none; }

/* ---------- przyciski dodatkowe ---------- */
.btn--block { width: 100%; }
.btn--outline { color: var(--ink); border-color: var(--line); background: transparent; }
.btn--outline::before { background: var(--ink); }
.btn--outline:hover { color: var(--paper); border-color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.is-busy span { opacity: .4; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- szuflada koszyka ---------- */
.drawer { position: fixed; inset: 0; z-index: 130; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(20, 15, 11, .5); opacity: 0; transition: opacity .5s; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--paper);
  display: grid; grid-template-rows: auto 1fr auto; transform: translateX(100%); transition: transform .6s var(--ease-out);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 30px; }
.drawer__close { font-size: 32px; line-height: 1; width: 40px; height: 40px; font-weight: 200; }
.drawer__body { overflow: auto; padding: 8px 24px; }
.drawer__empty { display: grid; gap: 20px; justify-items: start; padding: 30px 0; color: var(--muted); }
.drawer__foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.drawer__foot:empty { display: none; }
.drawer__note { margin: 0; font-size: 13px; color: var(--muted); }
.free-bar { margin: 0; font-size: 13px; display: grid; gap: 8px; }
.free-bar i { display: block; height: 3px; background: var(--sand); position: relative; overflow: hidden; }
.free-bar i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--p)); transition: transform .6s var(--ease-out); }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.sum b { font-family: var(--serif); font-size: 28px; font-weight: 400; font-variant-numeric: tabular-nums; }

.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line:last-child { border-bottom: 0; }
.line__img img { width: 76px; aspect-ratio: 3 / 4; object-fit: cover; background: var(--sand); }
.line__info { min-width: 0; }
.line__name { font-family: var(--serif); font-size: 19px; line-height: 1.2; display: block; }
.line__meta { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.line__price { text-align: right; font-variant-numeric: tabular-nums; display: grid; gap: 8px; justify-items: end; }
.line__remove { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid currentColor; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.qty button { width: 32px; height: 32px; font-size: 16px; }
.qty button:disabled { opacity: .3; }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 140; transform: translate(-50%, 140%);
  background: var(--ink); color: var(--paper); padding: 14px 22px; font-size: 14px; max-width: calc(100% - 32px);
  transition: transform .5s var(--ease-out), visibility .5s; box-shadow: 0 10px 30px rgba(0,0,0,.2); visibility: hidden;
}
.toast.is-on { transform: translate(-50%, 0); visibility: visible; }
.toast a { color: var(--gold-1); border-bottom: 1px solid currentColor; margin-left: 8px; }

/* ---------- sklep ---------- */
.shop, .checkout { padding: clamp(40px, 6vw, 80px) 0 clamp(80px, 10vw, 140px); }
.shop__head { padding: 0 var(--gutter); margin-bottom: clamp(30px, 4vw, 50px); max-width: 900px; }
.shop__title { font-size: clamp(52px, 8vw, 110px); text-wrap: balance; }
.shop__lead { color: var(--muted); max-width: 52ch; margin: 18px 0 0; }
.shop__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 30px; padding: 0 var(--gutter); margin-bottom: 34px; }
.shop__bar .filters { padding: 0; margin: 0; }
.shop__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.shop__count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.shop__msg { padding: 40px var(--gutter); color: var(--muted); display: grid; gap: 20px; justify-items: start; grid-column: 1 / -1; }
.select select {
  appearance: none; height: 40px; padding: 0 36px 0 16px; border: 1px solid var(--line); border-radius: 40px; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.products--shop .product { text-decoration: none; }
a.product { display: block; color: inherit; }
.product__soldout { position: absolute; inset: auto 0 0 0; z-index: 2; background: rgba(28,22,18,.75); color: var(--paper); text-align: center; padding: 8px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; }
.price s { color: var(--muted); margin-right: 4px; }
.price b { font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.product__meta .price { flex: none; }
.news__more { text-align: center; margin: 50px 0 0; padding: 0 var(--gutter); }

/* ---------- produkt ---------- */
.pdp { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(30px, 5vw, 80px); padding: 28px var(--gutter) clamp(80px, 10vw, 140px); align-items: start; }
.pdp > .shop__msg { grid-column: 1 / -1; padding-inline: 0; }
.pdp__gallery { display: grid; gap: 12px; position: sticky; top: calc(var(--nav-h) + 20px); }
.pdp__main { aspect-ratio: 4 / 5; background: var(--sand); overflow: hidden; }
.pdp__main img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.pdp__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.pdp__thumbs button { aspect-ratio: 3 / 4; overflow: hidden; opacity: .55; outline-offset: 2px; transition: opacity .3s; }
.pdp__thumbs button.is-active, .pdp__thumbs button:hover { opacity: 1; }
.pdp__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp__info { display: grid; gap: 18px; align-content: start; min-width: 0; }
.pdp__info .eyebrow { margin: 0; }
.pdp__title { font-size: clamp(40px, 5vw, 64px); text-wrap: balance; }
.pdp__price { margin: 0; display: flex; gap: 14px; align-items: baseline; font-family: var(--serif); }
.pdp__price b { font-size: 34px; font-weight: 400; font-variant-numeric: tabular-nums; }
.pdp__price s { font-size: 22px; color: var(--muted); }
.pdp__omnibus, .pdp__color { margin: 0; font-size: 13px; color: var(--muted); }
.pdp__color b { color: var(--ink); font-weight: 400; }
.sizes { border: 0; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sizes legend { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; margin-bottom: 12px; padding: 0; }
.size input { position: absolute; opacity: 0; pointer-events: none; }
.size span { display: grid; place-items: center; min-width: 52px; height: 46px; padding: 0 14px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; transition: background .3s, color .3s, border-color .3s; }
.size:hover span { border-color: var(--ink); }
.size input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.size input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.size.is-out span { color: var(--muted); text-decoration: line-through; cursor: not-allowed; opacity: .5; }
.pdp__stock { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--accent); }
.pdp__stock.is-error { color: #b23a2a; font-size: 15px; }
.sizes.is-shake .size span { border-color: #b23a2a; }
.sizes.is-shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pdp__desc { border-top: 1px solid var(--line); padding-top: 20px; }
.pdp__desc h2 { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; font-family: var(--sans); font-weight: 400; margin-bottom: 10px; }
.pdp__desc p { margin: 0; color: var(--muted); max-width: 60ch; }
.pdp__perks { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.pdp__perks li::before { content: "— "; color: var(--accent); }

/* ---------- zamówienie ---------- */
.checkout__grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(30px, 5vw, 80px); padding: 0 var(--gutter); align-items: start; }
.cform { display: grid; gap: 34px; min-width: 0; }
.cform fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.cform legend { font-family: var(--serif); font-size: 28px; margin-bottom: 8px; padding: 0; }
.opt-label { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.field { display: grid; gap: 6px; min-width: 0; }
.field[hidden], [data-for][hidden] { display: none; }
.field label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 12px 14px; width: 100%; border-radius: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--ink); }
.field input:user-invalid { border-color: #b23a2a; }
.field small { color: var(--muted); font-size: 13px; }
.field small a, .check a, .cform__info a { border-bottom: 1px solid currentColor; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .field--short { max-width: 180px; }
[data-for] { display: grid; gap: 14px; }
.opt { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); cursor: pointer; transition: border-color .3s, background .3s; }
.opt:has(input:checked) { border-color: var(--ink); background: var(--cream); }
.opt:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.opt input { accent-color: var(--ink); margin-top: 5px; }
.opt span { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; flex: 1; min-width: 0; }
.opt b { font-weight: 400; }
.opt em { font-style: normal; color: var(--muted); font-size: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ink); flex: none; }
.cform__info { margin: -20px 0 0; font-size: 13px; color: var(--muted); }
.cform__error { margin: 0; color: #b23a2a; min-height: 1em; }
.cform__error:empty { display: none; }
.summary { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--cream); padding: clamp(24px, 3vw, 36px); display: grid; gap: 12px; transition: background .8s; }
.summary h2 { font-size: 28px; margin-bottom: 6px; }
.sline { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sline img { width: 54px; aspect-ratio: 3 / 4; object-fit: cover; }
.sline p { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.sline span { font-size: 12px; color: var(--muted); }
.sline b, .srow span:last-child { font-weight: 400; font-variant-numeric: tabular-nums; }
.srow { display: flex; justify-content: space-between; font-size: 15px; padding-top: 6px; }
.srow--total { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; align-items: baseline; }
.srow--total b { font-family: var(--serif); font-size: 30px; font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- dziękujemy ---------- */
.thanks { max-width: 720px; margin: 0 auto; padding: clamp(60px, 8vw, 120px) var(--gutter); display: grid; gap: 20px; justify-items: start; }
.thanks > p { margin: 0; }
.thanks__title { font-size: clamp(56px, 9vw, 120px); font-style: italic; }
.thanks__num { font-size: 18px; }
.bank { width: 100%; background: var(--cream); padding: clamp(24px, 3vw, 36px); display: grid; gap: 14px; }
.bank h2 { font-size: 28px; }
.bank dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 0; }
.bank dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.bank dd { margin: 0; overflow-wrap: anywhere; }
.bank p { margin: 0; color: var(--muted); font-size: 14px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; user-select: all; }
.bank .copy { color: var(--ink); border-bottom-color: var(--line); margin-left: 8px; }

/* ---------- dokumenty ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: clamp(50px, 7vw, 100px) var(--gutter) clamp(80px, 10vw, 140px); }
.doc__title { font-size: clamp(44px, 6vw, 80px); margin-bottom: 30px; text-wrap: balance; }
.doc__seller { background: var(--cream); padding: 22px 26px; font-size: 15px; line-height: 1.8; margin: 0 0 30px; }
.doc__seller a, .doc a { border-bottom: 1px solid currentColor; }
.doc__toc ol { margin: 0 0 40px; padding-left: 22px; columns: 2; column-gap: 40px; font-size: 15px; }
.doc__toc li { margin-bottom: 6px; break-inside: avoid; }
.doc section { padding-top: 28px; border-top: 1px solid var(--line); margin-top: 28px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.doc h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 14px; }
.doc ol, .doc ul { padding-left: 22px; display: grid; gap: 10px; }
.doc p, .doc li { max-width: 68ch; }
.doc__table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 14px; }
.doc__table th, .doc__table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc__table th { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 400; }
.form-template { border: 1px dashed var(--line); padding: 26px; }
.form-template p { margin: 0 0 14px; }

/* ---------- stopka: dokumenty i dane firmy ---------- */
.footer__legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; margin: 0 0 18px; }
.footer__legal a { font-size: 12px; color: rgba(250,247,242,.75); border-bottom: 1px solid rgba(250,247,242,.25); }
.footer__legal a:hover { color: var(--gold-1); }
.footer__company { font-size: 12px; margin: 0 auto 26px; max-width: 70ch; line-height: 1.8; }

/* ---------- RWD ---------- */
@media (max-width: 1100px) {
  .nav--page { grid-template-columns: 1fr auto; }
}
@media (max-width: 820px) {
  .pdp, .checkout__grid { grid-template-columns: 1fr; }
  .pdp__gallery, .summary { position: static; }
  .summary { order: -1; }
  .shop__bar { flex-direction: column; align-items: stretch; }
  .doc__toc ol { columns: 1; }
  .field-row { grid-template-columns: 1fr; }
  .field-row .field--short { max-width: none; }
  .bank dl { grid-template-columns: 1fr; gap: 4px; }
  .bank dd { margin-bottom: 10px; }
}
