/* ============================================================
   SoftShop – products.css
   Dołącz w <head> po app.css
   ============================================================ */

/* ---- Sekcje ---- */
.section       { padding: 64px 0; }
.section-alt   { background: var(--bg-subtle); padding: 64px 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
}
.section-head h2 { font-size: 1.5rem; font-weight: 700; }
.link-more { font-size: 0.9rem; color: var(--primary); }

/* ---- Hero ---- */
.hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
}
.hero-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
}
.hero-text { max-width: 560px; }
.hero-text h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 16px;
}
.hero-text p { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.hero-badge {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.badge-ring {
  width: 140px; height: 140px; border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary-light);
}
.badge-num  { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.badge-label { font-size: 0.875rem; color: var(--text-muted); }

/* ---- Kategorie chips ---- */
.section-cats { padding: 24px 0; border-bottom: 1px solid var(--border); }
.cats-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.875rem; color: var(--text);
  transition: all var(--transition);
}
.cat-chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.cat-chip img { border-radius: 50%; object-fit: cover; }

/* ---- Grid produktów ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.products-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ---- Karta produktu ---- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.product-card-thumb {
  display: block; position: relative;
  aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg-subtle);
}
.product-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .product-card-thumb img { transform: scale(1.04); }
.product-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
}

/* Odznaki */
.badge-featured {
  position: absolute; top: 10px; left: 10px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}
.badge-type {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .03em;
}
.product-card .badge-type {
  position: absolute; bottom: 8px; right: 8px;
}
.badge-type-free        { background: #dcfce7; color: #166534; }
.badge-type-one_time    { background: #eff6ff; color: #1e40af; }
.badge-type-one_time_sub{ background: #f5f3ff; color: #5b21b6; }
.badge-type-license     { background: #fff7ed; color: #9a3412; }
.badge-type-service     { background: #fef9c3; color: #713f12; }
.badge-type-training    { background: #f0fdf4; color: #065f46; }
.dark .badge-type-free        { background: #052e16; color: #86efac; }
.dark .badge-type-one_time    { background: #172554; color: #93c5fd; }
.dark .badge-type-one_time_sub{ background: #2e1065; color: #c4b5fd; }
.dark .badge-type-license     { background: #431407; color: #fdba74; }
.dark .badge-type-service     { background: #422006; color: #fde68a; }
.dark .badge-type-training    { background: #022c22; color: #6ee7b7; }

.product-card-body {
  padding: 16px; flex: 1; display: flex; flex-direction: column;
}
.product-card-cat {
  font-size: 0.75rem; color: var(--primary); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; display: block;
}
.product-card-title {
  font-size: 0.9375rem; font-weight: 600; margin-bottom: 12px; flex: 1; line-height: 1.4;
}
.product-card-title a { color: var(--text); }
.product-card-title a:hover { color: var(--primary); text-decoration: none; }
.product-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto;
}
.price-main  { font-size: 1.0625rem; font-weight: 700; color: var(--text); }
.price-free  { font-size: 1.0625rem; font-weight: 700; color: var(--success); }
.price-contact { font-size: 0.9rem; color: var(--text-muted); }
.price-tax   { font-size: 0.75rem; color: var(--text-muted); margin-left: 4px; }

/* ---- Newsletter ---- */
.section-newsletter { background: var(--primary); padding: 64px 0; }
.newsletter-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.newsletter-text h3 { font-size: 1.5rem; font-weight: 700; color: #fff; }
.newsletter-text p  { color: rgba(255,255,255,.8); margin-top: 8px; }
.newsletter-form {
  display: flex; gap: 8px; flex-wrap: wrap; flex: 1; max-width: 440px;
}
.newsletter-form input {
  flex: 1; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: var(--radius-sm); padding: 10px 14px;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.6); }
.newsletter-form input:focus { border-color: #fff; }
.newsletter-form .btn { background: #fff; color: var(--primary); font-weight: 700; }
.newsletter-form .btn:hover { background: #f0f0f0; }

/* ---- Strona produktów ---- */
.products-page { padding: 48px 0; }
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 2rem; font-weight: 800; }
.page-subtitle { color: var(--text-muted); margin-top: 6px; }

.products-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 40px;
  align-items: start;
}

/* Sidebar filtry */
.products-sidebar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; position: sticky; top: 80px;
}
.filter-group { margin-bottom: 20px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
  font-size: 0.8125rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; display: block;
}
.filter-options { display: flex; flex-direction: column; gap: 6px; }
.filter-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; }
.filter-radio input[type="radio"] { accent-color: var(--primary); }

.input-search { position: relative; }
.input-search input { padding-right: 40px; }
.input-search button {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
}

/* Toolbar */
.products-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.toolbar-count { font-size: 0.875rem; color: var(--text-muted); }
.select-sort {
  padding: 7px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text);
  cursor: pointer;
}

/* Paginacja */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 1.0625rem; margin-bottom: 20px; }

/* ---- Szczegół produktu ---- */
.product-detail { padding: 40px 0 80px; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 32px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

.product-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  align-items: start; margin-bottom: 56px;
}

/* Galeria */
.gallery-main {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3; background: var(--bg-subtle);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-placeholder {
  aspect-ratio: 4/3; background: var(--bg-subtle); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-light);
}
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumb {
  width: 72px; height: 52px; object-fit: cover;
  border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; transition: border-color var(--transition);
}
.gallery-thumb.active,
.gallery-thumb:hover { border-color: var(--primary); }

/* Info produktu */
.product-info { display: flex; flex-direction: column; gap: 16px; }
.product-title { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.version-badge {
  display: inline-block; font-size: 0.75rem; padding: 2px 8px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-muted); margin-left: 8px;
}
.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-block .price-main { font-size: 1.75rem; font-weight: 800; }
.price-netto { font-size: 0.875rem; color: var(--text-muted); }

/* Plany sub */
.subscription-plans h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; color: var(--text-muted); }
.plans-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.plan-card { cursor: pointer; }
.plan-card input[type="radio"] { display: none; }
.plan-card-inner {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px; border: 2px solid var(--border);
  border-radius: var(--radius); transition: all var(--transition);
}
.plan-card input:checked + .plan-card-inner {
  border-color: var(--primary); background: var(--primary-light);
}
.plan-period { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.plan-price  { font-size: 1rem; font-weight: 700; }

/* Kalkulator usługi */
.service-calc {
  background: var(--bg-subtle); border-radius: var(--radius); padding: 16px;
}
.service-calc h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.calc-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.calc-row label { font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; }
.input-hours { width: 100px; text-align: center; }
.discount-info { font-size: 0.8125rem; color: var(--warning); margin-bottom: 10px; }
.calc-result {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9375rem; padding-top: 10px; border-top: 1px solid var(--border);
}
.calc-result strong { font-size: 1.125rem; color: var(--primary); }

/* Cechy produktu */
.product-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.product-features li {
  display: flex; align-items: center; gap: 8px; font-size: 0.9375rem;
}

/* Zakładki */
.product-tabs { margin-bottom: 48px; }
.tabs-nav {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 12px 20px; background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-size: 0.9375rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.prose { line-height: 1.8; color: var(--text); }
.prose p + p { margin-top: 1em; }
.prose h2, .prose h3 { margin: 1.5em 0 .5em; font-weight: 700; }
.prose ul { padding-left: 1.5em; margin: .75em 0; }
.prose li { margin-bottom: .375em; }
.prose code { background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; font-size: .9em; }

/* Related */
.related-section h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; }

/* ---- CMS page ---- */
.cms-page { max-width: 760px; margin: 48px auto; padding: 0 24px 80px; }
.cms-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 32px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .product-detail-grid { grid-template-columns: 1fr; gap: 32px; }
  .products-layout     { grid-template-columns: 1fr; }
  .products-sidebar    { position: static; }
}

@media (max-width: 600px) {
  .hero-inner    { flex-direction: column; text-align: center; }
  .hero-actions  { justify-content: center; }
  .hero-badge    { display: none; }
  .newsletter-box{ flex-direction: column; }
  .plans-grid    { grid-template-columns: 1fr 1fr; }
}

/* ---- Strona kategorii ---- */
.category-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
}
.category-thumb {
  width: 64px; height: 64px; border-radius: var(--radius);
  object-fit: cover; flex-shrink: 0;
}
.category-header h1 { font-size: 2rem; font-weight: 800; margin: 0; }
.category-desc { color: var(--text-muted); margin-top: 4px; }

/* ---- Sekcja sort + count ---- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.section-head-count { color: var(--text-muted); font-size: .9rem; }
.select-sort {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card);
  color: var(--text); font-size: .875rem; cursor: pointer;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
}
.empty-state p { font-size: 1.0625rem; margin-bottom: 16px; }

/* ---- Products layout (sidebar + grid) ---- */
.products-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px; align-items: start;
}
.products-sidebar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; position: sticky; top: 80px;
}
.sidebar-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px;
}
.sidebar-filter-list { display: flex; flex-direction: column; gap: 4px; }
.sidebar-filter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .875rem; text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-filter-item:hover,
.sidebar-filter-item.active {
  background: var(--primary-light); color: var(--primary); text-decoration: none;
}
.sidebar-filter-count {
  margin-left: auto; font-size: .75rem;
  background: var(--bg-subtle); padding: 1px 6px; border-radius: 10px;
}

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .875rem; text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .products-layout { grid-template-columns: 1fr; }
  .products-sidebar { position: static; }
}
@media (max-width: 640px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .category-header h1 { font-size: 1.5rem; }
  .hero-inner { flex-direction: column; }
  .hero-stats { justify-content: flex-start; }
}
