/* Sklep – wygląd (ładowany tylko, gdy moduł „sklep” jest włączony). Kolory z zmiennych motywu --c-* */
.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; }

/* Koszyk w nagłówku */
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #fff; font-size: 1.25rem; text-decoration: none; border-radius: 12px; margin-left: auto; }
.cart-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--c-accent); color: var(--c-on-accent); font: 700 .72rem/20px var(--f-body); text-align: center; }
.cart-count[hidden] { display: none; }
@media (min-width: 821px) { .cart-link { margin-left: 0; } }

/* Układ sklepu */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
.shop-side { position: sticky; top: 96px; }
.shop-search { display: flex; gap: 8px; margin-bottom: 22px; }
.shop-search input { flex: 1; min-width: 0; font: inherit; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 10px; }
.shop-side-title { font-size: 1.05rem; margin-bottom: .5em; }
.shop-cats { list-style: none; margin: 0 0 20px; padding: 0; }
.shop-cats a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--c-text); }
.shop-cats a:hover { background: var(--c-bg-alt); }
.shop-cats a.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.shop-cats span { color: var(--c-muted); font-size: .85rem; }
.shop-help { font-size: .88rem; }

/* Karty produktów */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.product-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; background: var(--c-bg-alt); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; }
.product-noimg { color: #cbd5e1; font-size: 3rem; }
.product-noimg.big { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; width: 100%; background: var(--c-bg-alt); border-radius: var(--radius); font-size: 6rem; }
.product-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.product-body h3 { font-size: 1rem; margin: 0; line-height: 1.35; }
.product-body h3 a { color: var(--c-dark); text-decoration: none; }
.product-body h3 a:hover { color: var(--c-primary); }
.product-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); text-decoration: none; }
.product-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.product-price { font: 700 1.15rem var(--f-heading); color: var(--c-dark); }
.product-price.big { font-size: 2rem; margin: .2em 0; }
.product-out { color: #b91c1c; font-size: .85rem; font-weight: 600; }
.shop-pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.shop-pager a, .shop-pager .current { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--c-line); text-decoration: none; color: var(--c-dark); }
.shop-pager .current { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); font-weight: 700; }

/* Strona produktu */
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.product-gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--c-line); background: #fff; object-fit: contain; max-height: 560px; }
.gallery-main { display: block; cursor: zoom-in; }
.gallery-thumbs { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb { padding: 0; border: 2px solid var(--c-line); border-radius: 10px; background: #fff; cursor: pointer; width: 72px; height: 72px; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; max-height: none; object-fit: contain; border: 0; border-radius: 0; }
.gallery-thumb.active, .gallery-thumb:hover, .gallery-thumb:focus-visible { border-color: var(--c-primary); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .88); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 8px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .92); color: #0f172a; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 1.4rem; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.product-stock.ok { color: #047857; font-weight: 600; }
.product-stock.out { color: #b91c1c; font-weight: 600; }
.buy-box { display: flex; gap: 12px; align-items: center; margin: 20px 0; flex-wrap: wrap; }
.qty-input { width: 80px; font: inherit; padding: 11px 10px; border: 1px solid #cbd5e1; border-radius: 10px; text-align: center; }
.product-meta { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 6px; font-size: .92rem; }
.product-meta span { display: inline-block; min-width: 70px; color: var(--c-muted); }
.product-desc { margin-top: 40px; }

/* Koszyk i kasa */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: .8rem; text-transform: uppercase; color: var(--c-muted); padding: 8px; border-bottom: 2px solid var(--c-line); }
.cart-table td { padding: 12px 8px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.cart-table .num, .cart-table th.num { text-align: right; white-space: nowrap; }
.cart-table tr.total td { font-weight: 700; font-size: 1.1rem; border-bottom: 0; }
.cart-name { display: flex; align-items: center; gap: 12px; }
.cart-name img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; }
.cart-remove { background: none; border: 0; color: #b91c1c; cursor: pointer; font-size: 1rem; padding: 8px; }
.cart-total { text-align: right; font-size: 1.2rem; margin: 18px 0 4px; }
.cart-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.shop-box { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; }
.shop-box h2 { font-size: 1.2rem; margin-bottom: .8em; }
.checkout label { margin-bottom: 14px; }
.checkout .choice { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 10px; margin-bottom: 10px; cursor: pointer; font-weight: 500; }
.checkout .choice[hidden] { display: none; }
.checkout .choice input { width: auto; margin: 0; }
.checkout .choice span { flex: 1; }
.checkout .choice:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); }
.checkout-total { text-align: right; display: grid; gap: 6px; }
.checkout-total .grand { font-size: 1.4rem; margin: 6px 0 10px; }
.order-number { font-size: 1.3rem; color: #047857; }

.shop-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--c-dark); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; z-index: 300; }
.shop-toast.show { opacity: 1; transform: translate(-50%, 0); }
.shop-toast a { color: var(--c-accent); margin-left: 8px; font-weight: 600; }

@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-side { position: static; }
  .product-page { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-row .btn { width: 100%; }
  .cart-table thead { display: none; }
  .cart-table td { padding: 8px 4px; }
}
