/* ============================================================
   sklep.css  –  Main shop (sklep) stylesheet
   Dark theme  ·  Mobile-first  ·  CSS-Grid product grids
   Tokens defined in tokens.css – referenced via var(--*)
   ============================================================ */

/* ----------------------------------------------------------
   NAV: Shop mega-menu, cart badge
   ---------------------------------------------------------- */
.nav-shop-dropdown{position:relative;display:inline-flex;align-items:center}
.nav-shop-trigger{display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.nav-shop-mega{display:none;position:absolute;top:100%;left:50%;transform:translateX(-50%);min-width:320px;background:var(--surface,#fff);border:1px solid var(--border,#e2e5e9);border-radius:12px;padding:12px;box-shadow:0 12px 32px rgba(0,0,0,.1);z-index:300;margin-top:8px}
.nav-shop-dropdown:hover .nav-shop-mega{display:grid;grid-template-columns:1fr;gap:4px}
.shop-niche-link{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:8px;color:inherit;text-decoration:none;transition:background .15s}
.shop-niche-link:hover{background:rgba(0,0,0,.04)}
.shop-niche-link i{font-size:1.3rem;flex-shrink:0}
.shop-niche-link span{display:flex;flex-direction:column;gap:1px}
.shop-niche-link strong{font-size:.88rem;font-weight:600}
.shop-niche-link small{font-size:.75rem;color:var(--muted,#6b7280);font-weight:400}
.btn-cart{position:relative;display:inline-flex;align-items:center;justify-content:center;font-size:1.2rem;padding:6px 10px;color:var(--muted,#6b7280);transition:.2s}
.btn-cart:hover{color:var(--text,#1a1a2e)}
.cart-badge{position:absolute;top:-2px;right:-4px;background:var(--primary,#f59e0b);color:#fff;font-size:.65rem;font-weight:700;min-width:18px;height:18px;line-height:18px;text-align:center;border-radius:9px;padding:0 4px}

@media(max-width:768px){
  .nav-shop-mega{position:static;transform:none;min-width:auto;box-shadow:none;border:none;margin-top:0;padding:0 8px}
  .nav-shop-dropdown:hover .nav-shop-mega,.nav-links.open .nav-shop-mega{display:grid}
}

/* ----------------------------------------------------------
   0.  BASE / RESET HELPERS
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   1.  SHOP HOME  (sklep_glowna.tpl)
   ---------------------------------------------------------- */
.shop-home {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Hero ------------------------------------------------- */
.shop-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: linear-gradient(135deg,
      var(--color-panel) 0%,
      var(--color-bg) 50%,
      var(--color-panel) 100%);
  border-bottom: 1px solid var(--color-border);
}

.shop-hero h1,
.shop-hero h2 {
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

/* --- Search ----------------------------------------------- */
.shop-search {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.shop-search-input {
  flex: 1 1 0%;
  padding: 0.85rem 1.15rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: var(--color-panel);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shop-search-input::placeholder {
  color: var(--color-muted);
}

.shop-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.shop-search-btn {
  flex-shrink: 0;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0 12px 12px 0;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.shop-search-btn:hover,
.shop-search-btn:focus-visible {
  background: var(--color-primary-hover);
}

/* --- Niche grid ------------------------------------------- */
.shop-niches-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.25rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .shop-niches-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .shop-niches-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.shop-niche-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.shop-niche-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.shop-niche-card i,
.shop-niche-card .bi {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.shop-niche-card h3,
.shop-niche-card strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.shop-niche-card p,
.shop-niche-card span {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.45;
}

/* --- Section (bestsellers etc.) --------------------------- */
.shop-section {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem 20px;
}

.shop-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.shop-section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.shop-see-all {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.shop-see-all:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* --- Products grid (shared) ------------------------------- */
.shop-products-grid {
  --cardW: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--cardW), 100%), 1fr));
  gap: 1.25rem;
}

/* ----------------------------------------------------------
   2.  PRODUCT CARD  (sklep_product_card.tpl)
   ---------------------------------------------------------- */
.shop-product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.shop-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--color-primary);
}

/* Image container – fixed aspect ratio */
.shop-product-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-panel-2);
}

.shop-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.shop-product-card:hover .shop-product-img img {
  transform: scale(1.05);
}

.shop-product-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-panel-2);
  color: var(--color-muted);
  font-size: 2.5rem;
}

/* Text area */
.shop-product-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem 1rem;
}

.shop-product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.shop-product-brand {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.shop-product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 0.25rem;
}

/* Badges */
.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  line-height: 1.5;
  white-space: nowrap;
}

.shop-badge-stock {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.shop-badge-nostock {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.shop-badge-source {
  background: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
}

.shop-source-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  font-size: 13px;
  color: #0ea5e9;
}

.shop-source-tab {
  margin-top: 12px;
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: #f0f9ff;
}
.shop-source-tab-header {
  padding: 10px 14px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.shop-source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.shop-source-table td {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}
.shop-source-table tr:last-child td {
  border-bottom: none;
}
.shop-source-table td:first-child {
  color: #64748b;
  white-space: nowrap;
  width: 45%;
}
.shop-source-table td:last-child {
  color: #0f172a;
}
.shop-source-code {
  color: #94a3b8;
  font-size: 12px;
}

/* ----------------------------------------------------------
   3.  PRODUCT LISTING  (sklep_lista.tpl)
   ---------------------------------------------------------- */
.shop-listing {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

/* Breadcrumbs */
.shop-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  padding: 0;
  list-style: none;
}

.shop-breadcrumbs a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

.shop-breadcrumbs a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.shop-breadcrumbs li+li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--color-muted);
}

/* 2-column layout */
.shop-listing-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .shop-listing-layout {
    flex-direction: row;
  }
}

/* Sidebar */
.shop-sidebar {
  flex-shrink: 0;
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .shop-sidebar {
    width: 250px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
  }
}

.shop-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shop-cat-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.shop-cat-list li a:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.shop-cat-list li a.active {
  background: rgba(249, 115, 22, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

.shop-cat-count {
  font-size: 0.78rem;
  color: var(--color-muted);
  background: var(--color-panel-2);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  min-width: 1.6rem;
  text-align: center;
}

/* Main content */
.shop-main {
  flex: 1 1 0%;
  min-width: 0;
}

.shop-listing-header {
  margin-bottom: 1.25rem;
}

.shop-listing-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}

.shop-count {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Pagination */
.shop-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
}

.shop-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-soft);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.shop-page-link:hover {
  background: var(--color-hover);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.shop-page-link.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
  pointer-events: none;
}

/* Empty state */
.shop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-muted);
  gap: 1rem;
}

.shop-empty i,
.shop-empty .bi {
  font-size: 3rem;
  opacity: 0.5;
}

.shop-empty p {
  font-size: 1rem;
  max-width: 360px;
}

/* ----------------------------------------------------------
   4.  PRODUCT DETAIL  (sklep_produkt.tpl)
   ---------------------------------------------------------- */
.shop-product-detail {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

.shop-product-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .shop-product-main {
    flex-direction: row;
  }
}

/* Gallery */
.shop-product-gallery {
  flex: 1 1 55%;
  min-width: 0;
}

.shop-product-main-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
}

.shop-product-main-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-product-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.shop-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--color-border);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.shop-thumb:hover,
.shop-thumb.active {
  border-color: var(--color-primary);
}

.shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info column */
.shop-product-info-col {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shop-product-brand-detail {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.shop-product-sku {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.shop-product-price-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0.25rem 0;
}

.shop-stock-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-success);
}

.shop-stock-no {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-danger);
}

/* Add-to-cart controls */
.shop-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.shop-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-panel);
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.15rem;
  background: transparent;
  border: none;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.qty-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.qty-minus {
  border-right: 1px solid var(--color-border-soft);
}

.qty-plus {
  border-left: 1px solid var(--color-border-soft);
}

.qty-input {
  width: 3.2rem;
  height: 2.5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text);
  outline: none;
  -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-add-cart:hover {
  background: var(--color-primary-hover);
}

.btn-add-cart:active {
  transform: scale(0.97);
}

/* Features row */
.shop-product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-soft);
}

.shop-product-features>* {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.shop-product-features i,
.shop-product-features .bi {
  font-size: 1.1rem;
  color: var(--color-primary);
}

/* Description */
.shop-product-description {
  margin-top: 2rem;
}

.shop-product-description h2,
.shop-product-description h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.shop-desc-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-soft);
}

.shop-desc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
}

.shop-desc-content a {
  color: var(--color-link);
  text-decoration: underline;
}

.shop-desc-content a:hover {
  color: var(--color-link-hover);
}

/* Related products */
.shop-related {
  margin-top: 3rem;
}

.shop-related h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* ----------------------------------------------------------
   5.  CART  (sklep_koszyk.tpl)
   ---------------------------------------------------------- */
.shop-cart-page {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

.shop-cart-page h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.shop-cart-table {
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
}

.shop-cart-header {
  display: none;
}

@media (min-width: 768px) {
  .shop-cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--color-panel-2);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
  }
}

.shop-cart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-soft);
  transition: background 0.15s ease;
}

.shop-cart-row:last-child {
  border-bottom: none;
}

.shop-cart-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

@media (min-width: 768px) {
  .shop-cart-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    flex-wrap: nowrap;
  }
}

.shop-cart-product {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 100%;
}

@media (min-width: 768px) {
  .shop-cart-product {
    flex: unset;
  }
}

.shop-cart-img {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-panel-2);
}

.shop-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-cart-price {
  font-size: 0.95rem;
  color: var(--color-text-soft);
  white-space: nowrap;
}

.shop-cart-qty {
  display: flex;
  align-items: center;
}

.shop-cart-line-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.shop-cart-remove {
  display: flex;
  align-items: center;
}

.btn-remove-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-remove-item:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* Cart summary */
.shop-cart-summary {
  margin-top: 1.5rem;
  margin-left: auto;
  max-width: 380px;
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shop-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-soft);
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
  margin-top: 0.5rem;
}

.btn-checkout:hover {
  background: var(--color-primary-hover);
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-continue:hover {
  background: var(--color-hover);
  border-color: var(--color-primary);
  color: var(--color-text);
}

/* Empty cart */
.shop-empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1rem;
  color: var(--color-muted);
  gap: 1.25rem;
}

.shop-empty-cart i,
.shop-empty-cart .bi {
  font-size: 3.5rem;
  opacity: 0.45;
}

.shop-empty-cart p {
  font-size: 1.05rem;
}

.shop-empty-cart a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.shop-empty-cart a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   6.  CHECKOUT  (sklep_checkout.tpl)
   ---------------------------------------------------------- */
.shop-checkout {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

.shop-checkout h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.shop-checkout-form {
  width: 100%;
}

.shop-checkout-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .shop-checkout-layout {
    flex-direction: row;
  }
}

/* Form fields */
.shop-checkout-fields {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
  }
}

.form-group {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-soft);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-panel);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* Payment methods */
.shop-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.shop-payment-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.15s ease;
}

.shop-payment-option:hover {
  border-color: var(--color-primary);
  background: rgba(249, 115, 22, 0.04);
}

.shop-payment-option input[type="radio"] {
  accent-color: var(--color-primary);
  width: 1.1rem;
  height: 1.1rem;
}

.shop-payment-option label {
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* Order summary sidebar */
.shop-checkout-summary {
  flex: 0 0 auto;
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.5rem;
  align-self: flex-start;
}

@media (min-width: 768px) {
  .shop-checkout-summary {
    width: 340px;
    position: sticky;
    top: 1rem;
  }
}

.shop-checkout-summary h2,
.shop-checkout-summary h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.shop-checkout-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.shop-checkout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border-soft);
}

.shop-checkout-item:last-child {
  border-bottom: none;
}

.shop-checkout-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  padding: 0.4rem 0;
}

.shop-checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  padding-top: 0.85rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--color-border-soft);
}

.btn-pay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1rem;
  margin-top: 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-pay:hover {
  background: var(--color-primary-hover);
}

.shop-checkout-info {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--color-muted);
}

.shop-checkout-info a {
  color: var(--color-link);
  text-decoration: underline;
}

/* ----------------------------------------------------------
   7.  ORDER HISTORY  (sklep_moje_zamowienia.tpl)
   ---------------------------------------------------------- */
.shop-orders-page {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

.shop-orders-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.shop-orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shop-order-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shop-order-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Order status badges */
.shop-order-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}

.status-new {
  background: rgba(96, 165, 250, 0.15);
  color: var(--color-link);
}

.status-paid {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.status-processing {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-warning);
}

.status-shipped {
  background: rgba(96, 165, 250, 0.15);
  color: var(--color-link);
}

.status-delivered {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.status-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.status-refunded {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-muted);
}

/* Empty orders */
.shop-orders-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1rem;
  color: var(--color-muted);
  gap: 1rem;
}

.shop-orders-empty i,
.shop-orders-empty .bi {
  font-size: 3rem;
  opacity: 0.45;
}

/* ----------------------------------------------------------
   8.  ORDER CONFIRMATION  (sklep_zamowienie_ok.tpl)
   ---------------------------------------------------------- */
.shop-order-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 560px;
  margin: 4rem auto;
  padding: 3rem 2rem;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  gap: 1rem;
  color: var(--color-text);
}

.shop-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.shop-order-confirm h1,
.shop-order-confirm h2 {
  color: var(--color-text);
  margin: 0;
}

.shop-order-confirm p {
  color: var(--color-text-soft);
  line-height: 1.6;
  font-size: 0.95rem;
}

.shop-order-confirm a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.shop-order-confirm a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   9.  ORDER DETAIL  (sklep_moje_zamowienie.tpl)
   ---------------------------------------------------------- */
.shop-order-detail {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 1rem 20px;
  max-width: 100%;
  margin: 0 auto;
}

.shop-order-detail h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.shop-order-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .shop-order-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .shop-order-info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shop-order-info-block {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1.25rem;
}

.shop-order-info-block h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.shop-order-info-block p {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--color-text-soft);
  margin: 0;
}

.shop-order-items-table {
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.shop-order-items-table table {
  width: 100%;
  border-collapse: collapse;
}

.shop-order-items-table thead {
  background: var(--color-panel-2);
}

.shop-order-items-table th {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.shop-order-items-table td {
  padding: 0.75rem 1rem;
  font-size: 0.93rem;
  color: var(--color-text-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.shop-order-items-table tr:last-child td {
  border-bottom: none;
}

.shop-order-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem 0;
}

.shop-order-totals>div,
.shop-order-totals>p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 320px;
  font-size: 0.95rem;
  color: var(--color-text-soft);
}

/* ── KSZ MOBILE RESPONSIVE ── */
@media (max-width: 768px) {
  .shop-layout {
    grid-template-columns: 1fr !important;
  }
  .shop-layout > div:first-child {
    order: 2;
  }
  .shop-listing,
  .shop-product-detail,
  .shop-cart-page { padding: 1rem 12px }
  .shop-section { padding: 1.5rem 12px }
  .shop-niches-grid { padding: 1.5rem 12px }
}
@media (max-width: 480px) {
  #shop-main form[action*="szukaj"] { min-width: 100% !important }
  #shop-main form[action*="szukaj"] input { min-width: 0 !important }
}

.shop-order-totals>div:last-child,
.shop-order-totals>p:last-child {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border-soft);
}

/* ----------------------------------------------------------
   10. MEGA MENU  (header)
   ---------------------------------------------------------- */
.shop-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-panel);
  border-top: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.shop-mega-menu.open,
*:hover>.shop-mega-menu,
.shop-mega-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shop-mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem 20px;
}

@media (min-width: 768px) {
  .shop-mega-menu-inner {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .shop-mega-menu-inner {
    grid-template-columns: repeat(5, 1fr);
  }
}

.shop-mega-menu-inner a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--color-text-soft);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.shop-mega-menu-inner a:hover {
  background: var(--color-hover);
  color: var(--color-primary);
}

/* Cart badge */
.shop-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--color-primary);
  border-radius: 10px;
  position: absolute;
  top: -4px;
  right: -6px;
}

/* ----------------------------------------------------------
   11. TOAST NOTIFICATION
   ---------------------------------------------------------- */
.shop-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.35rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-success);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.shop-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ----------------------------------------------------------
   12. RESPONSIVE REFINEMENTS
   ---------------------------------------------------------- */

/* Small screens  (< 768px) */
@media (max-width: 767.98px) {
  .shop-hero {
    padding: 2rem 1rem 1.75rem;
  }

  .shop-hero h1 {
    font-size: 1.35rem;
  }

  .shop-search {
    max-width: 100%;
  }

  .shop-product-main {
    gap: 1.25rem;
  }

  .shop-product-price-big {
    font-size: 1.65rem;
  }

  .shop-cart-summary {
    max-width: 100%;
  }

  .shop-order-confirm {
    margin: 2rem auto;
    padding: 2rem 1.25rem;
  }

  .shop-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* Medium screens  (768px – 1023px) */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .shop-products-grid {
    --cardW: 240px;
  }
}

/* Large screens  (>= 1024px) */
@media (min-width: 1024px) {
  .shop-hero {
    padding: 2.5rem 1.5rem 2rem;
  }

  .shop-hero h1 {
    font-size: 1.6rem;
  }

  .shop-listing {
    padding: 1.25rem 1.5rem;
  }

  .shop-sidebar {
    width: 240px;
  }

  .shop-product-detail {
    padding: 1.25rem 1.5rem;
  }
}

/* ----------------------------------------------------------
   13. PRINT
   ---------------------------------------------------------- */
@media print {

  .shop-toast,
  .shop-mega-menu,
  .shop-cart-badge,
  .shop-search-btn,
  .btn-add-cart,
  .btn-checkout,
  .btn-pay,
  .btn-remove-item,
  .btn-continue {
    display: none !important;
  }

  body,
  .shop-home,
  .shop-listing,
  .shop-product-detail,
  .shop-cart-page,
  .shop-checkout,
  .shop-orders-page,
  .shop-order-detail {
    background: #fff !important;
    color: #000 !important;
  }
}