/*
 * Katalog motywów - themes.<root>. Nakładka na public.css (tokeny :root stamtąd).
 * Prefiks .ts-, żeby nic tu nie wyciekało na stronę informacyjną ani do panelu.
 */

.ts-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.ts-muted { color: var(--muted); }
.ts-link { color: var(--brand); font-weight: 600; }

/* ---- identyfikacja (claude/identyfikacja.md): Kreda jako tło, logo, metki-etykiety ---- */
body.ts { background: var(--bg-soft); }
.ts a { text-decoration: none; }
.ts :where(.ts-head, .ts-foot) a:not(.ts-btn) { color: inherit; }
.ts .logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.ts .logo-mark { display: block; flex: none; }
.ts .logo-word { font: 800 24px/1 var(--font); letter-spacing: -.045em; }
.ts-foot .logo-word { font-size: 21px; }
.ts-tag { position: relative; display: inline-flex; align-items: center; height: 26px; padding: 0 11px 0 22px; background: var(--brand-soft); color: var(--brand-700); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 7px 7px 0; }
.ts-tag::before { content: ""; position: absolute; left: 10px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--bg-soft); }

/* ---- chrome ---- */
.ts-head { position: sticky; top: 0; z-index: 20; background: rgba(241, 242, 239, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ts-head-in { display: flex; align-items: center; gap: 32px; height: 72px; }
.ts-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.ts-nav { display: flex; gap: 24px; margin-right: auto; }
.ts-nav a { color: var(--text); font-weight: 600; font-size: 16px; }
.ts-nav a:hover { color: var(--brand); }
.ts-head-cta { display: flex; gap: 10px; }

.ts-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border: 1.5px solid transparent; border-radius: 999px; font: 600 16px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.ts-btn-primary { background: var(--brand); color: #fff; }
.ts-btn-primary:hover { background: var(--brand-600); color: #fff; }
.ts-btn-ghost { background: #fff; color: var(--ink); border-color: #c9ccd2; }
.ts-btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.ts-btn-lg { height: 52px; padding: 0 28px; font-size: 17px; }
.ts-btn-block { display: flex; width: 100%; margin-bottom: 10px; }

/* ---- hero ---- */
.ts-hero { position: relative; overflow: hidden; padding: 80px 0 64px; text-align: center; }
.ts-hero > .ts-wrap { position: relative; }
.ts-hero-tag { position: absolute; right: -140px; top: -60px; width: 520px; pointer-events: none; }
.ts-hero-tag svg { display: block; width: 100%; height: auto; }
.ts-eyebrow { margin: 0 0 18px; }
.ts-hero h1 { margin: 0 auto 18px; max-width: 16ch; font: 800 clamp(36px, 5.4vw, 64px)/1.04 var(--display); color: var(--ink); letter-spacing: -.045em; }
.ts-lead { margin: 0 auto; max-width: 62ch; color: var(--muted); font-size: 19px; }
.ts-hero-cta { display: flex; justify-content: center; gap: 12px; margin: 28px 0 0; flex-wrap: wrap; }
.ts-stats { display: inline-flex; justify-content: center; gap: 0; margin: 48px 0 0; padding: 18px 0 0; border-top: 2px dashed #c9ccd2; }
.ts-stats div + div { border-left: 2px dashed #c9ccd2; }
.ts-stats div { padding: 0 32px; }
.ts-stats dt { font: 800 34px/1 var(--display); letter-spacing: -.045em; color: var(--ink); }
.ts-stats dd { margin: 8px 0 0; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---- sekcje ---- */
.ts-section { padding: 56px 0; }
.ts-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.ts-section h2, .ts-section-head h2 { margin: 0; font: 800 30px/1.15 var(--display); letter-spacing: -.035em; color: var(--ink); }
.ts-page-head { margin-bottom: 28px; }
.ts-page-head .ts-lead { margin: 0; }
.ts-page-head h1 { margin: 0 0 10px; font: 800 clamp(30px, 4.4vw, 48px)/1.06 var(--display); letter-spacing: -.045em; color: var(--ink); }
.ts-count { margin: 24px 0 14px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ts-empty { padding: 48px; border: 2px dashed #c9ccd2; border-radius: var(--radius); background: #fff; text-align: center; color: var(--muted); }
.ts-crumbs { padding-top: 24px; color: var(--subtle); font-size: 14px; }
.ts-crumbs a { color: var(--muted); }

/* ---- filtry ---- */
.ts-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ts-filters select, .ts-search { height: 48px; padding: 0 16px; border: 1.5px solid #d4d7dc; border-radius: 12px; background-color: #fff; font: 500 16px/1 var(--font); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.ts-filters select { -webkit-appearance: none; appearance: none; padding-right: 44px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232A3BD4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.ts-filters select:hover, .ts-search:hover { border-color: #b4b8bf; }
.ts-filters select:focus, .ts-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.ts-search::placeholder { color: var(--subtle); }
.ts-filters .ts-btn { height: 48px; }
.ts-search { flex: 1 1 260px; }
.ts-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ts-chip { display: inline-flex; align-items: center; height: 34px; padding: 0 14px 0 24px; background: #fff; color: var(--muted); font-size: 14px; font-weight: 600; clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); border-radius: 0 8px 8px 0; position: relative; }
.ts-chip::before { content: ""; position: absolute; left: 11px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--bg-soft); }
.ts-chip:hover { color: var(--brand-700); background: var(--brand-soft); }
.ts-chip.is-on { background: var(--brand); color: #fff; }

/* ---- siatka i kafelki ---- */
.ts-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ts-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; transition: box-shadow .18s ease, transform .18s ease; }
.ts-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.ts-card-shot { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; }
.ts-card-body { padding: 16px 18px 18px; }
.ts-card-body h3 { margin: 0 0 6px; font: 700 19px/1.25 var(--display); letter-spacing: -.02em; }
.ts-card-body h3 a { color: var(--ink); }
.ts-card-body p { margin: 0; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ts-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); font-size: 14px; }
.ts-by { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.ts-price { display: inline-block; padding: 5px 10px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: 600 13px/1 var(--mono); letter-spacing: .04em; transform: rotate(-14deg); margin: -4px 0; }
.ts-price.is-free { background: var(--brand-soft); color: var(--brand-700); transform: none; }
.ts-price-lg { padding: 9px 14px; font-size: 20px; }
.ts-price-row { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; }

.ts-badge { position: absolute; top: 12px; left: 12px; padding: 6px 11px 6px 22px; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 7px 7px 0; }
.ts-badge-trial { background: var(--ink); color: #fff; }
.ts-badge-installed { background: var(--brand-soft); color: var(--brand-700); }

/* ---- makieta motywu z kolorów theme.json ---- */
.ts-shot { width: 100%; height: 100%; object-fit: cover; }
.ts-mock { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--m-bg); }
.ts-mock-bar { display: flex; gap: 6px; align-items: center; }
.ts-mock-bar i { width: 34px; height: 6px; border-radius: 3px; background: var(--m-ink); opacity: .28; }
.ts-mock-bar i:first-child { width: 18px; height: 18px; border-radius: 6px; background: var(--m-accent); opacity: 1; }
.ts-mock-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 0 6px; }
.ts-mock-title { width: 62%; height: 14px; border-radius: 4px; background: var(--m-ink); opacity: .8; }
.ts-mock-cta { width: 92px; height: 22px; border-radius: 999px; background: var(--m-accent); }
.ts-mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ts-mock-grid span { height: 42px; border-radius: 8px; background: var(--m-ink); opacity: .12; }

/* ---- podstrona motywu ---- */
.ts-detail { display: grid; gap: 36px; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); align-items: start; padding: 28px 0 8px; }
.ts-detail-shot { position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-soft); overflow: hidden; }
.ts-detail-buy h1 { margin: 0 0 8px; font: 800 clamp(30px, 3.6vw, 42px)/1.06 var(--display); letter-spacing: -.045em; color: var(--ink); }
.ts-detail-buy .ts-lead { font-size: 17px; }
.ts-note { margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-700); font-size: 14px; }
.ts-meta { margin: 24px 0 0; padding: 20px 0 0; border-top: 2px dashed var(--line); font-size: 14px; }
.ts-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.ts-meta dt { color: var(--muted); }
.ts-meta dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }

.ts-cols { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.ts-prose { color: var(--text); }
.ts-ticks { margin: 0; padding: 0; list-style: none; }
.ts-ticks li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); }
.ts-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }

/* ---- „jak to działa” ---- */
.ts-band { background: var(--dark); color: #c9ccd2; }
.ts-how { padding: 64px 24px; }
.ts-how h2 { margin: 0 0 32px; font: 800 32px/1.15 var(--display); letter-spacing: -.035em; color: #fff; }
.ts-steps { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0; padding: 0; counter-reset: step; list-style: none; }
.ts-steps li { position: relative; padding-top: 44px; }
.ts-steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; top: 0; display: inline-flex; align-items: center; height: 28px; padding: 0 12px 0 22px; background: var(--brand); color: #fff; font: 600 12px/1 var(--mono); letter-spacing: .08em; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 7px 7px 0; }
.ts-steps strong { display: block; margin-bottom: 6px; color: #fff; font-size: 17px; }
.ts-steps span { color: #9aa0a9; }
.ts-how-note { margin: 32px 0 0; color: #9aa0a9; }

/* ---- stopka ---- */
.ts-foot { border-top: 1px solid var(--line); padding: 44px 0; margin-top: 24px; background: #fff; }
.ts-foot-in { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.ts-foot-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); margin-bottom: 10px; }
.ts-foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.ts-foot-links a { color: var(--muted); font-weight: 500; }
.ts-foot-links a:hover { color: var(--brand); }

@media (max-width: 900px) {
    .ts-detail, .ts-cols { grid-template-columns: 1fr; }
    .ts-nav { display: none; }
    .ts-stats div { padding: 0 18px; }
    .ts-hero-tag { width: 320px; right: -120px; top: -40px; opacity: .7; }
    .ts-head-cta .ts-btn-ghost { display: none; }
}

/* ---- podgląd na żywo: pasek sterowania + ramka ze sklepem demo ---- */
.ts-preview { display: flex; flex-direction: column; min-height: calc(100vh - 68px); background: var(--bg-soft); }
.ts-preview-bar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.ts-preview-id { display: flex; align-items: center; gap: 14px; }
.ts-preview-controls { display: flex; align-items: center; gap: 16px; margin: 0 auto; flex-wrap: wrap; }
.ts-preview-cta { display: flex; gap: 10px; }

.ts-swatches { display: flex; gap: 6px; }
.ts-swatch { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.ts-swatch.is-on { border-color: var(--ink); }
.ts-swatch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.ts-devices { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ts-device { padding: 7px 14px; font-size: 14px; color: var(--muted); background: #fff; }
.ts-device + .ts-device { border-left: 1px solid var(--line); }
.ts-device.is-on { background: var(--ink); color: #fff; }

.ts-stage { flex: 1; display: flex; justify-content: center; padding: 24px; }
.ts-stage.is-desktop .ts-frame { width: 100%; }
.ts-stage.is-tablet .ts-frame { width: 834px; max-width: 100%; }
.ts-stage.is-phone .ts-frame { width: 414px; max-width: 100%; }
.ts-frame { flex: 1 1 auto; min-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.ts-stage.is-tablet .ts-frame, .ts-stage.is-phone .ts-frame { flex: 0 0 auto; }

@media (max-width: 900px) {
    .ts-preview-controls { order: 3; width: 100%; margin: 0; }
    .ts-stage { padding: 12px; }
}
