/* Sklep online — uzupełnienie style.css */

/* Nagłówek: koszyk */
.header-right { display: flex; align-items: center; gap: .5rem; }
.cart-link {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--ink); text-decoration: none; flex: none;
}
.cart-link:hover, .cart-link[aria-current="page"] { background: var(--petal); color: var(--blue); }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--blue); color: #fff; font: 600 .75rem/20px var(--body); text-align: center; display: none;
}
.cart-count.has-items { display: block; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem; display: none;
    box-shadow: 0 24px 32px -24px rgb(21 21 58 / .3);
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { font-size: 1.5rem; padding: .9rem 1rem; border-radius: 10px; }
}

/* Pola formularzy */
.field { display: grid; gap: .35rem; font-size: .95rem; font-weight: 600; }
.field > span { color: var(--muted); }
.field input, .field select, .field textarea {
  font: 400 1rem/1.4 var(--body); color: var(--ink); background: #fff;
  border: 1px solid #cfc8c1; border-radius: 10px; padding: .7rem .85rem; width: 100%; min-height: 46px;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.btn--small { font-size: 1rem; padding: .7rem 1.1rem; }
.btn:disabled { background: #c9c9d6; border-color: #c9c9d6; color: #fff; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: .3rem; color: var(--muted); font: inherit; font-size: .95rem; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: #b42318; }
.notice { background: var(--petal); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0; grid-column: 1 / -1; }
.notice--error { background: #fde8e6; color: #8a1c12; }
.fine { font-size: .92rem; color: var(--muted); }

/* Lista książek */
.shop-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.shop-bar .field { min-width: 11rem; }
.field--grow { flex: 1 1 16rem; }
.shop-count { color: var(--muted); font-size: .95rem; margin-bottom: 1.25rem; min-height: 1.5em; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-media { position: relative; display: block; background: var(--paper); aspect-ratio: 4 / 5; }
.product-media img, .book-media > img { width: 100%; height: 100%; object-fit: contain; }
.product-noimg { width: 100%; height: 100%; display: grid; place-items: center; background: var(--petal); }
.product-noimg img { width: 42%; height: auto; opacity: .55; border-radius: 50%; }
.badges { position: absolute; top: .75rem; left: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.badge { font: 600 .95rem/1 var(--display); letter-spacing: .05em; text-transform: uppercase; padding: .4rem .65rem; border-radius: 999px; }
.badge--sale { background: #c8102e; color: #fff; }
.badge--used { background: var(--ink); color: #fff; }
.product-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.product-cat { margin: 0; font: 600 .85rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.product h2 { font-size: 1.4rem; line-height: 1.15; margin: 0; }
.product h2 a { color: inherit; text-decoration: none; }
.product h2 a:hover { color: var(--blue); text-decoration: underline; }
.product-author { margin: 0; color: var(--muted); font-size: .98rem; }
.price { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.price strong { font: 600 1.7rem/1 var(--display); color: var(--ink); }
.price s { color: var(--muted); font-size: 1rem; }
.omni { margin: 0; font-size: .82rem; line-height: 1.35; color: var(--muted); }
.product-foot { margin-top: auto; padding-top: .9rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.stock { font-size: .88rem; font-weight: 600; color: #1a7f47; }
.stock--out { color: #b42318; }

/* Strona książki */
.book { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.book-media { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; }
.book-info h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .2em; }
.book-info h2 { font-size: 1.5rem; margin-top: 2rem; }
.book-info .price strong { font-size: 2.6rem; }
.book-info .omni { font-size: .92rem; margin-top: .4rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.5rem; margin: 1.5rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.buy { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; }
.buy .field { width: 6.5rem; }
.ship { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.ship li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.ship li:last-child { border-bottom: 0; }
@media (max-width: 760px) { .book { grid-template-columns: 1fr; } .book-media { max-width: 340px; } }

/* Koszyk */
.cart-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.cart-layout h2 { font-size: 1.6rem; margin: 0 0 1rem; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.cart-item {
  display: grid; grid-template-columns: 72px 1fr auto auto; gap: .6rem 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem;
}
.cart-thumb { width: 72px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--paper); display: block; grid-row: span 2; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-main { display: grid; gap: .1rem; min-width: 0; grid-column: 2 / -1; }
.cart-title { font: 600 1.3rem/1.15 var(--display); color: var(--ink); text-decoration: none; }
.cart-title:hover { color: var(--blue); text-decoration: underline; }
.cart-unit { font-size: .9rem; color: var(--muted); }
.cart-line { font: 600 1.3rem var(--display); justify-self: end; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #cfc8c1; border-radius: 999px; overflow: hidden; justify-self: start; }
.stepper button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--petal); }
.stepper button:disabled { color: #c0c0cc; cursor: not-allowed; }
.stepper span { min-width: 2.2rem; text-align: center; font-weight: 600; }
.checkout { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); display: grid; gap: 1rem; }
.checkout h2:not(:first-child) { margin-top: .75rem; }
.checkout .btn { justify-content: center; }
.choices { display: grid; gap: .6rem; }
.choice { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid #cfc8c1; border-radius: 10px; padding: .8rem 1rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--blue); }
.choice span { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .field:first-child { grid-column: 1 / -1; }
.summary { border-top: 1px solid var(--line); padding-top: 1rem; }
.summary p { display: flex; justify-content: space-between; margin: 0 0 .4rem; }
.summary-total { font-size: 1.15rem; margin-top: .6rem !important; }
.summary-total strong { font: 600 1.9rem/1 var(--display); }
.thanks { background: var(--petal); border-radius: var(--radius); padding: clamp(1.5rem, 5vw, 3.5rem); }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

/* Powiadomienie */
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: #fff; padding: .85rem 1.25rem; border-radius: 999px;
  display: flex; gap: 1rem; align-items: center; max-width: calc(100vw - 2rem); font-size: .98rem;
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / .4);
}
.toast a { color: var(--petal-strong); white-space: nowrap; }

/* Dokumenty prawne */
.legal h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin-top: 2.2em; scroll-margin-top: 100px; }
.legal ol, .legal ul { padding-left: 1.4rem; display: grid; gap: .6rem; margin: 0 0 1.2em; }
.legal .lead { color: var(--ink); }
.table-scroll { overflow-x: auto; margin-bottom: 1.2em; }
.legal-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .95rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: .7rem .8rem; border: 1px solid var(--line); }
.legal-table th { background: var(--paper); font-weight: 600; }
.form-template { border: 2px dashed #cfc8c1; border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.75rem); background: var(--paper); margin-bottom: 1.5rem; }
.form-template p { margin-bottom: .9em; }
.form-template .blank { color: var(--muted); letter-spacing: .05em; overflow-wrap: anywhere; }
.legal-links { list-style: none; display: flex !important; flex-wrap: wrap; gap: .5rem 1.5rem !important; margin: 2.5rem 0 0 !important; padding: 0; }
.site-footer .legal-links + .legal { margin-top: 1.25rem; }
.check-line { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; line-height: 1.45; }
.check-line input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; flex: none; accent-color: var(--blue); }
@media print {
  .funding, .site-footer, .crumbs, .cart-link, .toast { display: none !important; }
  .legal { font-size: 11pt; }
}
