/* ============================================================
   KT Ebook LP — main stylesheet
   Wszystkie style w jednym pliku → LiteSpeed Cache zrobi
   minify + critical CSS + unused CSS removal w prod.
   ============================================================ */

:root {
    --bg: #f7f2eb;
    --card: #fffdf9;
    --ink: #1a1825;
    --muted: #5c5870;
    --navy: #19324c;
    --navy-mid: #224568;
    --navy-soft: #2d5883;
    --amber: #c97b2a;
    --amber-bright: #e08d30;
    --amber-soft: #faebd8;
    --amber-glow: rgba(224, 141, 48, 0.18);
    --line: #e4d8c8;
    --green: #2c7a50;
    --green-soft: #e5f4ec;
    --radius: 16px;
    --shadow-lg: 0 24px 48px rgba(22, 36, 62, 0.18);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family:
        "Outfit",
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Sticky footer: body jako flex column → footer auto na dół */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Wszystko poza headerem/footerem rośnie i wypycha footer w dół */
.site-main,
main,
.wp-site-blocks,
.entry-content,
article.page {
    flex: 1 0 auto;
}
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

h1,
h2,
h3 {
    font-family: "Lora", Georgia, "Times New Roman", serif;
    line-height: 1.2;
    color: var(--navy);
    margin: 0;
}

p {
    margin: 0 0 1em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    /* Brak wewnętrznego paddingu - parent section/footer już go ma (24px lub 22px) */
}

section {
    padding: 72px 24px;
}

/* ── SITE HEADER (non-LP pages: regulamin, kontakt, cart/checkout itp.) ── */
.kt-site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
}
.kt-site-header .container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.kt-site-header__brand {
    font-family: "Lora", Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    transition: color 0.18s;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.kt-site-header__brand:hover {
    color: var(--amber);
}
.kt-site-header__brand img {
    max-height: 48px;
    width: auto;
    display: block;
}

@media (max-width: 860px) {
    .kt-site-header {
        padding: 12px 0;
    }
    .kt-site-header__brand {
        font-size: 1.15rem;
    }
    .kt-site-header__brand img {
        max-height: 40px;
    }
}

/* ── TOP BAR ────────────────────────────────────────────── */
.top-bar {
    background: linear-gradient(120deg, #f8e9d5, #f2ddc2);
    color: #223650;
    padding: 8px 16px 9px;
    font-size: 0.84rem;
    border: 0;
    border-bottom: 1px solid rgba(25, 50, 76, 0.2);
    width: 100%;
    margin: 0;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 40;
    backdrop-filter: blur(6px);
}
.top-bar-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.top-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 14px;
    font-weight: 500;
    margin: 0;
}
.top-pack {
    font-weight: 700;
    color: var(--navy);
}
.top-price {
    font-weight: 700;
    color: #9b5c18;
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
    background: linear-gradient(
        145deg,
        #12283f 0%,
        var(--navy) 55%,
        var(--navy-soft) 100%
    );
    position: relative;
    overflow: hidden;
    padding: 86px 24px 90px;
}
.hero::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(200, 120, 40, 0.14) 0%,
        transparent 70%
    );
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -60px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(42, 66, 117, 0.5) 0%,
        transparent 70%
    );
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
}
.hero h1 {
    font-size: clamp(2.1rem, 4.5vw, 3.1rem);
    color: #fff;
    font-weight: 700;
    margin-bottom: 6px;
}
.hero h2 {
    font-size: 1.1rem;
    color: #d4af37;
    margin: 14px 0 8px;
    font-weight: 500;
    font-family: "Outfit", sans-serif;
}
.hero-tagline {
    font-size: 1.05rem;
    color: #c6d2ec;
    margin: 18px 0 22px;
    max-width: 540px;
    font-weight: 400;
}
.hero-cta-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    margin-top: 8px;
}
.hero-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-trust-row span {
    color: #9aaac8;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 38px;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--amber), var(--amber-bright));
    color: #fff;
    font-weight: 700;
    font-size: 1.08rem;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(201, 123, 42, 0.4);
    transition:
        transform 0.18s,
        box-shadow 0.18s;
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.01em;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(201, 123, 42, 0.48);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    background: transparent;
    color: #d4dff5;
    font-weight: 600;
    font-size: 0.93rem;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition:
        background 0.18s,
        border-color 0.18s;
    font-family: "Outfit", sans-serif;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.38);
}
.btn-buy {
    display: inline-block;
    background: #d4822a;
    color: #fff;
    padding: 20px 52px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 10px 28px rgba(212, 130, 42, 0.4);
    border: 0;
    cursor: pointer;
    transition:
        transform 0.18s,
        box-shadow 0.18s;
}
.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(212, 130, 42, 0.48);
}

/* ── BOOK FAN (hero visual) ─────────────────────────────── */
.book-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    transform: translateY(14px);
}
.book-fan {
    position: relative;
    width: 380px;
    height: 520px;
}
.fan-card {
    position: absolute;
    width: 275px;
    height: 390px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    object-fit: cover;
    object-position: top center;
    transition:
        transform 0.38s ease,
        box-shadow 0.38s ease;
}
.fan-cover {
    transform: translateX(0) rotate(-7deg) translateY(10px);
    z-index: 3;
    background: #fff;
}
.fan-page-1 {
    transform: translateX(142px) rotate(3deg) translateY(0);
    z-index: 2;
    background: #fff;
}
.fan-page-2 {
    transform: translateX(286px) rotate(11deg) translateY(14px);
    z-index: 1;
    background: #fff;
}
.book-fan:hover .fan-cover {
    transform: translateX(-14px) rotate(-10deg) translateY(0);
    box-shadow: 0 28px 52px rgba(0, 0, 0, 0.45);
}
.book-fan:hover .fan-page-1 {
    transform: translateX(176px) rotate(5deg) translateY(-8px);
}
.book-fan:hover .fan-page-2 {
    transform: translateX(352px) rotate(15deg) translateY(10px);
}

.book-price-badge {
    position: absolute;
    left: 520px;
    top: 330px;
    background: linear-gradient(135deg, var(--amber), var(--amber-bright));
    color: #fff;
    border-radius: 50%;
    width: 92px;
    height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 20px rgba(201, 123, 42, 0.45);
    z-index: 10;
    font-weight: 700;
    line-height: 1.1;
    transition: transform 0.38s ease;
}
.book-fan:hover .book-price-badge {
    transform: translate(44px, -6px);
}
.book-price-badge .price-old {
    font-size: 0.6rem;
    text-decoration: line-through;
    opacity: 0.75;
}
.book-price-badge .price-now {
    font-size: 1.34rem;
}
.book-price-badge .price-label {
    font-size: 0.56rem;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* ── SECTION STYLES ─────────────────────────────────────── */
.section-alt {
    background: #fffdf9;
}
.section-dark {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #e8edf8;
}
.section-dark h2,
.section-dark p {
    color: #e8edf8;
}
.section-label {
    display: block;
    font-size: 0.87rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber);
    margin: 0 0 12px;
}
/* Gdy section-label jest w <span> (nadal w wp:html patternach) - inline */
span.section-label {
    display: inline-block;
}
h2.section-title {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    margin-bottom: 14px;
}
.subtitle-text {
    font-size: 1.05rem;
    color: var(--muted);
    margin-bottom: 24px;
}

/* ── LISTS ──────────────────────────────────────────────── */
.check-list,
.x-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1em;
}
.check-list li,
.x-list li {
    padding: 9px 0 9px 32px;
    position: relative;
    border-bottom: 1px solid var(--line);
}
.check-list li:last-child,
.x-list li:last-child {
    border: 0;
}
.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
    font-size: 1rem;
}
.x-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #b03a28;
    font-weight: 700;
}

/* ── TWO-COL / FLOW-BLOCK ───────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.flow-block {
    background: var(--amber-soft);
    border-left: 4px solid var(--amber);
    border-radius: 10px;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--navy);
    margin: 20px 0;
    font-size: 0.97rem;
    letter-spacing: 0.01em;
}

/* ── TOC GRID ───────────────────────────────────────────── */
.toc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 24px 0 28px;
}
.toc-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    transition:
        box-shadow 0.18s,
        transform 0.18s;
}
.toc-item:hover {
    box-shadow: 0 8px 20px rgba(22, 36, 62, 0.1);
    transform: translateY(-2px);
}
.toc-item h3 {
    font-size: 0.97rem;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    margin-bottom: 4px;
}
.toc-item span {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ── AUTHOR ─────────────────────────────────────────────── */
.author-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    align-items: start;
}
.author-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ── TESTIMONIALS ───────────────────────────────────────── */
.testi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    margin: 24px 0 28px;
}
.testi-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    position: relative;
}
.testi-card::before {
    content: '"';
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: "Lora", serif;
    font-size: 3.5rem;
    color: var(--amber-soft);
    line-height: 1;
}
.stars {
    color: var(--amber);
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.testi-card p {
    font-size: 0.92rem;
    color: #3e3c4e;
    margin-bottom: 14px;
    line-height: 1.6;
}
.testi-author {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}
.testi-author strong {
    font-size: 0.9rem;
    color: var(--navy);
}
.testi-author span {
    font-size: 0.82rem;
    color: var(--muted);
    display: block;
}

.mini-testi-heading {
    font-size: 1.15rem;
    text-align: center;
    margin: 40px 0 16px;
    color: var(--navy-mid);
    font-family: "Outfit", sans-serif;
}

/* ── MINI-TESTIMONIALS CAROUSEL ─────────────────────────── */
.mini-testi-wrapper {
    position: relative;
    margin: 20px 0 30px;
    padding: 0 48px;
}
.mini-testi-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding-bottom: 10px;
}
.mini-testi-track::-webkit-scrollbar {
    display: none;
}
.mini-testi-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 16px;
    border: 1px dashed var(--line);
    font-size: 0.88rem;
    color: #4a4855;
    display: flex;
    flex-direction: column;
}
.mini-testi-quote {
    font-style: italic;
    margin-bottom: 10px;
    line-height: 1.5;
}
.mini-testi-name {
    font-weight: 600;
    color: var(--navy-mid);
    font-size: 0.82rem;
    margin-top: auto;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    color: var(--navy);
    font-weight: bold;
    transition:
        background 0.2s,
        box-shadow 0.2s;
    font-size: 1.1rem;
}
.carousel-btn:hover {
    background: var(--bg);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.09);
}
.carousel-btn.prev {
    left: 0;
}
.carousel-btn.next {
    right: 0;
}

/* ── OFFER CARDS ────────────────────────────────────────── */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    margin-top: 24px;
}
.offer-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}
.offer-card.main {
    background: var(--navy);
    border-color: transparent;
    color: #e8edf8;
}
.offer-card.main h3 {
    color: #fff;
}
.offer-card.main p {
    color: #c4cee6;
}
.chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--amber-soft);
    color: #7a4a18;
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}
.offer-card.main .chip {
    background: rgba(255, 255, 255, 0.14);
    color: #ffd599;
}
.offer-card h3 {
    font-size: 1rem;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    margin-bottom: 8px;
}
.offer-card p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 6px;
}
.offer-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--amber);
    margin-top: 8px;
}

/* ── PRICING BOX ────────────────────────────────────────── */
.pricing-box {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid var(--navy);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.pricing-header {
    background: var(--navy);
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pricing-header h3 {
    color: #fff;
    font-size: 1.1rem;
}
.guarantee-badge {
    background: var(--green);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
}
.pricing-body {
    padding: 28px;
}
.pricing-checks {
    margin-bottom: 20px;
}
.pricing-checks p {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.pricing-checks p::before {
    content: "✓";
    color: var(--green);
    font-weight: 700;
}
.price-block {
    background: var(--amber-soft);
    border-radius: 14px;
    padding: 20px 22px;
    margin: 18px 0;
}
.price-old {
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: line-through;
}
.price-now {
    font-family: "Lora", serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin: 4px 0 8px;
}
.lp-product-box {
    text-align: center;
    padding: 24px 0;
}
.lp-product-box img {
    margin-left: auto;
    margin-right: auto;
    display: block;
}
.guarantee-note {
    margin-top: 14px;
    background: var(--green-soft);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #1e5c37;
}

/* ── CTA SHARED ─────────────────────────────────────────── */
.cta-area {
    margin-top: 24px;
}
.cta-note {
    margin-top: 10px;
    font-size: 0.86rem;
    color: var(--muted);
}

/* ── FAQ ────────────────────────────────────────────────── */
.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.faq-item:last-child {
    border: 0;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 24px;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.4rem;
    color: var(--amber);
    font-weight: 400;
    transition: transform 0.18s;
}
.faq-item[open] summary::after {
    content: "−";
}
.faq-item h3 {
    font-size: 1.05rem;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    margin: 0 0 8px;
    display: inline;
}
.faq-item p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 10px 0 6px;
}

/* ── SUMMARY ────────────────────────────────────────────── */
.summary-dark {
    background: linear-gradient(140deg, #12283f, var(--navy));
    padding: 72px 24px;
    text-align: center;
}
.summary-dark h2 {
    color: #fff;
    margin-bottom: 14px;
}
.summary-dark p {
    color: #b0bedc;
    max-width: 580px;
    margin: 0 auto 10px;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    background: #112233;
    color: #8891a8;
    text-align: center;
    padding: 28px 22px 36px;
    font-size: 0.88rem;
}
.site-footer__copy {
    opacity: 0.55;
    margin: 0 0 10px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.site-footer__nav {
    margin-top: 10px;
}
.site-footer .footer-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-footer a {
    color: #8891a8;
    text-decoration: none;
}
.site-footer a:hover {
    color: #c4cde0;
}

/* ── BACK TO LP (cart/checkout) ─────────────────────────── */
.kt-back-to-lp {
    max-width: 1200px;
    margin: 24px auto 8px;
    padding: 0 24px;
}
.kt-back-to-lp a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition:
        color 0.18s,
        transform 0.18s;
}
.kt-back-to-lp a:hover {
    color: var(--amber);
    transform: translateX(-3px);
}
.kt-back-to-lp a::before {
    content: "←";
    font-size: 1.1rem;
    line-height: 1;
}

/* ── DISCLAIMER ─────────────────────────────────────────── */
.disclaimer-section {
    background: #f0eae0;
    padding: 40px 24px;
}
.disclaimer-section p {
    font-size: 0.82rem;
    color: var(--muted);
    max-width: 760px;
    line-height: 1.7;
}

/* ── PAGE WRAPPER (domyślny page.php) ───────────────────── */

.kt-site-main {
    padding: 0;
}
.kt-page {
    margin: 0;
    padding: 0;
}
.kt-page-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 64px 24px;
}

/* Strony WC potrzebują dużo miejsca - rozszerzamy wrapper do 1240px */
body.woocommerce-cart .kt-page-inner,
body.woocommerce-checkout .kt-page-inner,
body.woocommerce-account .kt-page-inner,
body.single-product .kt-page-inner,
body.woocommerce .kt-page-inner {
    max-width: 1240px;
    padding: 56px 24px 80px;
}

/* ── WOOCOMMERCE - SINGLE PRODUCT (karta produktu) ──────── */

/* Wycentruj + ogranicz szerokość, beżowe tło z motywu */
body.single-product .site-main,
body.single-product main {
    background: var(--bg);
}
body.single-product .kt-page-inner {
    max-width: 1100px;
    padding: 40px 24px 80px;
}

/* Ukryj wszelkie sidebary i widgety na karcie produktu */
body.single-product .widget-area,
body.single-product .sidebar,
body.single-product aside.widget-area,
body.single-product #secondary,
body.single-product .wp-block-search,
body.single-product .wp-block-page-list,
body.single-product .wp-block-categories,
body.single-product .wp-block-archives,
body.single-product .wp-block-latest-posts,
body.single-product .widget_search,
body.single-product .widget_pages,
body.single-product .widget_categories,
body.single-product .widget_meta,
body.single-product .widget_recent_entries {
    display: none !important;
}

/* Breadcrumbs - subtelnie */
body.single-product .woocommerce-breadcrumb {
    color: var(--muted) !important;
    font-size: 0.85rem !important;
    margin-bottom: 24px !important;
    margin-top: 24px;
    text-align: center;
}
body.single-product .woocommerce-breadcrumb a {
    color: var(--amber);
    text-decoration: none;
}

/* Tytuł produktu */
body.single-product .product_title.entry-title {
    font-family: "Lora", Georgia, serif !important;
    font-size: clamp(1.8rem, 3vw, 2.4rem) !important;
    color: var(--navy) !important;
    font-weight: 700 !important;
    margin: 0 0 16px !important;
    line-height: 1.2 !important;
}

/* Cena */
body.single-product .price,
body.single-product .price .amount,
body.single-product .summary .price {
    color: var(--amber-bright) !important;
    font-family: "Lora", serif !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
}
body.single-product .summary .price del {
    color: var(--muted) !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    margin-right: 12px;
}

/* Krótki opis */
body.single-product .woocommerce-product-details__short-description {
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.7;
    margin: 16px 0 24px;
}
body.single-product .woocommerce-product-details__short-description p {
    margin: 0 0 0.8em;
}

/* Przycisk "Dodaj do koszyka" - amber gradient z LP */
body.single-product .single_add_to_cart_button,
body.single-product .button.alt,
body.woocommerce .button.alt,
body.woocommerce-page button.button.alt {
    background: linear-gradient(
        120deg,
        var(--amber),
        var(--amber-bright)
    ) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 18px 38px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 1.08rem !important;
    box-shadow: 0 10px 28px rgba(212, 130, 42, 0.4) !important;
    font-family: "Outfit", sans-serif !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    transition:
        transform 0.18s,
        box-shadow 0.18s !important;
    cursor: pointer;
}
body.single-product .single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(212, 130, 42, 0.48) !important;
}

/* Pole quantity - obok przycisku */
body.single-product .quantity input.qty {
    padding: 16px 12px !important;
    border: 1.5px solid var(--line) !important;
    border-radius: 8px !important;
    font-family: "Outfit", sans-serif !important;
    font-size: 1rem !important;
    width: 80px !important;
    text-align: center;
}

/* Meta - kategoria, tagi */
body.single-product .product_meta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.92rem;
}
body.single-product .product_meta a {
    color: var(--amber);
    text-decoration: none;
}
body.single-product .product_meta > span {
    display: block;
    margin-bottom: 6px;
}

/* Karta wokół całego produktu (galeria + summary) - CSS Grid */
body.single-product div.product {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 36px !important;
    box-shadow: 0 12px 30px rgba(22, 36, 62, 0.08) !important;
    margin: 0 auto 40px !important;
    max-width: 1100px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 40px !important;
    align-items: start !important;
    box-sizing: border-box;
}
body.single-product div.product > .woocommerce-product-gallery {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    min-width: 0;
}
body.single-product div.product > .summary {
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    min-width: 0;
}
body.single-product div.product > .woocommerce-tabs,
body.single-product
    div.product
    > .woocommerce-product-details__short-description,
body.single-product div.product > .product_meta {
    grid-column: 1 / -1;
}

/* GALERIA jako natywny grid 1+N (działa bez FlexSlider) */
body.single-product .woocommerce-product-gallery {
    width: 100% !important;
    margin: 0 !important;
}
body.single-product .woocommerce-product-gallery__wrapper {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    margin: 0 !important;
}
body.single-product .woocommerce-product-gallery__image {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    padding: 0 !important;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Pierwszy obrazek (główny) zajmuje całą szerokość */
body.single-product .woocommerce-product-gallery__image:first-child,
body.single-product .woocommerce-product-gallery .flex-viewport {
    grid-column: 1 / -1 !important;
    aspect-ratio: 1 !important;
    max-width: 100% !important;
}
body.single-product .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px;
    background: var(--bg);
    cursor: zoom-in;
}
body.single-product .woocommerce-product-gallery__image:not(:first-child) img {
    object-fit: cover !important;
}

/* Lupka zoom (PhotoSwipe trigger) */
body.single-product .woocommerce-product-gallery__trigger {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 12px !important;
    right: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    text-indent: 0 !important;
    font-size: 1.1rem !important;
    z-index: 9 !important;
}

/* JEŚLI FlexSlider jednak się obudzi - flex-control-thumbs (nadpisanie defaultu) */
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 10px !important;
    margin: 16px 0 0 !important;
    padding: 4px 2px 8px !important;
    list-style: none;
    grid-column: 1 / -1 !important;
}
body.single-product
    .woocommerce-product-gallery
    .flex-control-thumbs::-webkit-scrollbar {
    display: none;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    flex: 0 0 72px !important;
    width: 72px !important;
    margin: 0 !important;
    list-style: none;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    opacity: 0.65;
    transition:
        opacity 0.18s,
        border-color 0.18s;
    cursor: pointer;
}
body.single-product
    .woocommerce-product-gallery
    .flex-control-thumbs
    img.flex-active,
body.single-product
    .woocommerce-product-gallery
    .flex-control-thumbs
    img:hover {
    opacity: 1;
    border-color: var(--amber);
}

/* Responsive - mobile single column */
@media (max-width: 860px) {
    body.single-product div.product {
        grid-template-columns: 1fr !important;
        padding: 20px !important;
        gap: 24px !important;
    }
    body.single-product .woocommerce-product-gallery__wrapper {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Zakładki "Opis" / "Opinie" */
body.single-product .woocommerce-tabs ul.tabs {
    border-bottom: 1px solid var(--line) !important;
    padding: 0 !important;
    margin: 40px 0 0 !important;
}
body.single-product .woocommerce-tabs ul.tabs::before,
body.single-product .woocommerce-tabs ul.tabs li::before,
body.single-product .woocommerce-tabs ul.tabs li::after {
    display: none !important;
}
body.single-product .woocommerce-tabs ul.tabs li {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 24px 0 0 !important;
}
body.single-product .woocommerce-tabs ul.tabs li a {
    padding: 14px 4px !important;
    color: var(--muted) !important;
    font-family: "Outfit", sans-serif !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    display: inline-block;
    border-bottom: 2px solid transparent;
    transition:
        color 0.18s,
        border-color 0.18s;
}
body.single-product .woocommerce-tabs ul.tabs li.active a {
    color: var(--navy) !important;
    border-bottom-color: var(--amber) !important;
}
body.single-product .woocommerce-Tabs-panel {
    padding: 28px 0 !important;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.7;
}
body.single-product .woocommerce-Tabs-panel h2 {
    display: none; /* Ukryj duplikat "Opis" w treści panelu */
}
body.single-product .woocommerce-Tabs-panel h3 {
    font-family: "Lora", serif;
    color: var(--navy);
    margin: 24px 0 12px;
}

/* Komunikat "dodano do koszyka" */
body.woocommerce-page .woocommerce-message,
body.woocommerce-page .woocommerce-info,
body.woocommerce-page .woocommerce-error {
    background: var(--green-soft) !important;
    border-top-color: var(--green) !important;
    color: #1e5c37 !important;
    padding: 14px 20px !important;
    border-radius: 8px !important;
    font-family: "Outfit", sans-serif !important;
}
body.woocommerce-page .woocommerce-message::before {
    color: var(--green) !important;
}
body.woocommerce-page .woocommerce-message .button {
    background: #fff !important;
    color: var(--navy) !important;
    border: 1px solid var(--line) !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-family: "Outfit", sans-serif !important;
    text-transform: none !important;
    box-shadow: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    body.single-product .kt-page-inner {
        padding: 24px 16px 56px;
    }
    body.single-product .woocommerce-product-gallery {
        padding: 16px;
    }
    body.single-product .price {
        font-size: 1.6rem !important;
    }
}

/* ── WOOCOMMERCE CART / CHECKOUT ────────────────────────── */

/* WooCommerce Cart/Checkout — wymuszamy układ 2-kolumnowy.
   Targetujemy oficjalną klasę WC `.wc-block-components-sidebar-layout` która
   jest na wrapperze BEZ względu na wariant cart/checkout. */

/* Zewnętrzne wrappery bloków */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Główny sidebar-layout (działa dla cart i checkout) */
.wc-block-components-sidebar-layout {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 40px !important;
    width: 100% !important;
}

/* Główna kolumna (items / fields) */
.wc-block-components-sidebar-layout > .wc-block-components-main,
.wc-block-components-sidebar-layout > .wp-block-woocommerce-cart-items-block,
.wc-block-components-sidebar-layout
    > .wp-block-woocommerce-checkout-fields-block {
    flex: 999 1 0% !important;
    min-width: 55% !important;
    max-width: none !important;
    width: auto !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* Sidebar (totals) */
.wc-block-components-sidebar-layout > .wc-block-components-sidebar,
.wc-block-components-sidebar-layout > .wp-block-woocommerce-cart-totals-block,
.wc-block-components-sidebar-layout
    > .wp-block-woocommerce-checkout-totals-block {
    flex: 1 1 320px !important;
    max-width: 380px !important;
    width: auto !important;
    margin: 0 !important;
}

/* Universal first-child/last-child fallback - na wypadek innej struktury */
.wc-block-components-sidebar-layout
    > *:first-child:not(.wc-block-components-sidebar):not(
        .wp-block-woocommerce-cart-totals-block
    ):not(.wp-block-woocommerce-checkout-totals-block) {
    flex: 999 1 0% !important;
    min-width: 55% !important;
    max-width: none !important;
    width: auto !important;
}
.wc-block-components-sidebar-layout
    > *:last-child:not(.wc-block-components-main):not(
        .wp-block-woocommerce-cart-items-block
    ):not(.wp-block-woocommerce-checkout-fields-block):not(:only-child) {
    flex: 1 1 320px !important;
    max-width: 380px !important;
    width: auto !important;
}

/* Override constrained layout WP - rozszerzamy WSZYSTKIE kontenery dla WC */
body.woocommerce-cart .entry-content,
body.woocommerce-checkout .entry-content,
body.woocommerce-cart article,
body.woocommerce-checkout article,
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-cart .wp-block-post-content,
body.woocommerce-checkout .wp-block-post-content,
body.woocommerce-cart .container,
body.woocommerce-checkout .container {
    max-width: 1240px !important;
    width: 100% !important;
}

/* WP "constrained layout" generuje .wp-container-XXX > * { max-width: 720px }.
   Override dla wszystkich bezpośrednich dzieci na stronach WC. */
body.woocommerce-cart .entry-content > *,
body.woocommerce-checkout .entry-content > *,
body.woocommerce-cart article > *,
body.woocommerce-checkout article > *,
body.woocommerce-cart .kt-page-inner > *,
body.woocommerce-checkout .kt-page-inner > * {
    max-width: 1200px !important;
}

/* Ebook = brak wysyłki. Ukrywamy pola adresowe w block-checkoucie. */
.wc-block-checkout .wc-block-components-address-form #billing-company,
.wc-block-checkout .wc-block-components-address-form #billing-company-field,
.wc-block-checkout .wc-block-components-address-form #billing-address_1,
.wc-block-checkout .wc-block-components-address-form #billing-address_1-field,
.wc-block-checkout .wc-block-components-address-form #billing-address_2,
.wc-block-checkout .wc-block-components-address-form #billing-address_2-field,
.wc-block-checkout .wc-block-components-address-form #billing-city,
.wc-block-checkout .wc-block-components-address-form #billing-city-field,
.wc-block-checkout .wc-block-components-address-form #billing-postcode,
.wc-block-checkout .wc-block-components-address-form #billing-postcode-field,
.wc-block-checkout .wc-block-components-address-form #billing-country,
.wc-block-checkout .wc-block-components-address-form #billing-country-field,
.wc-block-checkout .wc-block-components-address-form #billing-state,
.wc-block-checkout .wc-block-components-address-form #billing-state-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-address_1-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-address_2-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-city-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-postcode-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-state-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-country-input,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__company,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__address_1,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__address_2,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__city,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__postcode,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__country,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__state,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__phone,
.wc-block-checkout
    .wc-block-components-checkout-step--with-state
    .wc-block-components-text-input[id*="address"],
.wc-block-checkout
    .wc-block-components-checkout-step--with-state
    .wc-block-components-text-input[id*="city"],
.wc-block-checkout
    .wc-block-components-checkout-step--with-state
    .wc-block-components-text-input[id*="postcode"],
.kt-hidden-checkout-field {
    display: none !important;
}

/* Classic checkout (shortcode) - to samo ukrywanie po classach WC */
.woocommerce-checkout #billing_first_name_field,
.woocommerce-checkout #billing_last_name_field,
.woocommerce-checkout #billing_company_field,
.woocommerce-checkout #billing_country_field,
.woocommerce-checkout #billing_address_1_field,
.woocommerce-checkout #billing_address_2_field,
.woocommerce-checkout #billing_city_field,
.woocommerce-checkout #billing_postcode_field,
.woocommerce-checkout #billing_state_field,
.woocommerce-checkout #billing_phone_field {
    display: none !important;
}

/* Block checkout - first_name + last_name też ukrywamy (ebook = email only).
   Selektory używają autocomplete= jako najpewniejszego markeru pól (WC zawsze je ustawia). */
.wc-block-checkout
    .wc-block-components-text-input:has(input[autocomplete="given-name"]),
.wc-block-checkout
    .wc-block-components-text-input:has(input[autocomplete="family-name"]),
.wc-block-components-address-form > div:has(input[autocomplete="given-name"]),
.wc-block-components-address-form > div:has(input[autocomplete="family-name"]),
.wc-block-checkout .wc-block-components-address-form #billing-first_name,
.wc-block-checkout .wc-block-components-address-form #billing-first_name-field,
.wc-block-checkout .wc-block-components-address-form #billing-last_name,
.wc-block-checkout .wc-block-components-address-form #billing-last_name-field,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__first_name,
.wc-block-checkout
    .wc-block-components-address-form
    .wc-block-components-address-form__last_name {
    display: none !important;
}

/* Cart virtual (ebook only) - ukrywamy całą sekcję "Adres rozliczeniowy" w block checkoutcie.
   Sekcja ma nagłówek, "+ Dodaj nr mieszkania" toggle i pola - nic z tego nie jest potrzebne. */
body.kt-cart-virtual .wp-block-woocommerce-checkout-billing-address-block,
body.kt-cart-virtual .wc-block-checkout__billing-fields-wrapper,
body.kt-cart-virtual .wc-block-checkout__billing-fields,
body.kt-cart-virtual .wc-block-components-checkout-step[id*="billing"],
body.kt-cart-virtual
    .wc-block-components-checkout-step[data-block-name*="billing"],
body.kt-cart-virtual
    [data-block-name="woocommerce/checkout-billing-address-block"],
body.kt-cart-virtual
    [data-block-name="woocommerce/checkout-shipping-address-block"] {
    display: none !important;
}

/* Wzmocnione centrowanie checkoutu/koszyka - bity selektor z body przed klasą */
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-account .site-main {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Pola dodatkowe: NIP + nazwa firmy - chowamy domyślnie, JS pokazuje gdy
   checkbox "Chcę fakturę" zaznaczony. Selektory są szerokie bo WC generuje
   różne wrappery zależnie od wersji. */
.wc-block-components-text-input:has(input[id="kt-nip"]),
.wc-block-components-text-input:has(input[id="kt-company-name"]),
.wc-block-components-text-input:has(input[id*="kt-nip"]),
.wc-block-components-text-input:has(input[id*="kt-company"]),
.wc-block-components-additional-field-wrapper:has(input[id*="kt-nip"]),
.wc-block-components-additional-field-wrapper:has(input[id*="kt-company"]) {
    display: none;
}

/* Gdy body.kt-invoice-on (JS dodaje) - pokazujemy z powrotem.
   JS też ustawia inline display, ale CSS to safety net. */
body.kt-invoice-on .wc-block-components-text-input:has(input[id="kt-nip"]),
body.kt-invoice-on
    .wc-block-components-text-input:has(input[id="kt-company-name"]),
body.kt-invoice-on .wc-block-components-text-input:has(input[id*="kt-nip"]),
body.kt-invoice-on .wc-block-components-text-input:has(input[id*="kt-company"]),
body.kt-invoice-on
    .wc-block-components-additional-field-wrapper:has(input[id*="kt-nip"]),
body.kt-invoice-on
    .wc-block-components-additional-field-wrapper:has(input[id*="kt-company"]) {
    display: block;
}

/* Stylowanie przycisków WC żeby pasowały do motywu */
.woocommerce .button,
.wc-block-components-button,
.wp-element-button {
    border-radius: 8px !important;
    font-family: "Outfit", sans-serif !important;
    font-weight: 600 !important;
}
.wc-block-components-checkout-place-order-button {
    background: linear-gradient(
        120deg,
        var(--amber),
        var(--amber-bright)
    ) !important;
    border: 0 !important;
    box-shadow: 0 10px 28px rgba(212, 130, 42, 0.4) !important;
}

@media (max-width: 860px) {
    .wp-block-woocommerce-filled-cart-block,
    .wp-block-woocommerce-checkout {
        flex-direction: column !important;
    }
    .wp-block-woocommerce-filled-cart-block
        > .wp-block-woocommerce-cart-totals-block,
    .wp-block-woocommerce-filled-cart-block > .wc-block-components-sidebar,
    .wp-block-woocommerce-checkout
        > .wp-block-woocommerce-checkout-totals-block,
    .wp-block-woocommerce-checkout > .wc-block-components-sidebar {
        max-width: 100% !important;
    }
    .woocommerce-cart .entry-content,
    .woocommerce-checkout .entry-content,
    .woocommerce-cart article.page,
    .woocommerce-checkout article.page {
        padding: 32px 16px 56px;
    }
}

/* ── PRINT (hide widgets/consent) ───────────────────────── */
@media print {
    .top-bar,
    .carousel-btn,
    .cta-area,
    .site-footer,
    [id*="cookie"],
    [class*="cookie"],
    [id*="consent"],
    [class*="consent"] {
        display: none !important;
    }
}

/* ── NATIVE GUTENBERG BLOCKS - dostosowanie do motywu ───── */

/* wp:group jako section - upewniamy się że tagName=section dostaje padding */
section.wp-block-group {
    padding: 72px 24px;
}
section.wp-block-group.top-bar,
section.wp-block-group.disclaimer-section,
header.wp-block-group.top-bar {
    padding: 8px 16px 9px;
}
section.wp-block-group.disclaimer-section {
    padding: 40px 24px;
}

/* wp:button z klasą btn-primary - link wewnątrz przejmuje styl btn-primary */
.wp-block-buttons .wp-block-button.btn-primary > .wp-block-button__link,
.wp-block-buttons
    .wp-block-button.is-style-btn-primary
    > .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 38px;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--amber), var(--amber-bright));
    color: #fff;
    font-weight: 700;
    font-size: 1.08rem;
    text-decoration: none;
    border: 0;
    box-shadow: 0 12px 28px rgba(201, 123, 42, 0.4);
    transition:
        transform 0.18s,
        box-shadow 0.18s;
    font-family: "Outfit", sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.3;
    white-space: normal;
}
.wp-block-buttons .wp-block-button.btn-primary > .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(201, 123, 42, 0.48);
    color: #fff;
}

/* wp:columns z klasą two-col - grid 2-kol z gapem 32px (zamiast flex) */
.wp-block-columns.two-col {
    gap: 32px;
}
.wp-block-columns.two-col > .wp-block-column {
    min-width: 0;
}

/* wp:columns dla author-layout - kolumna 200px + reszta */
.wp-block-columns.author-layout {
    gap: 36px;
    align-items: flex-start;
}

/* wp:image z klasą author-photo - styl koła z bordeerem (na figure i img) */
figure.wp-block-image.author-photo,
figure.wp-block-image.author-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
}
figure.wp-block-image.author-photo {
    margin: 0;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
figure.wp-block-image.author-photo img {
    object-fit: cover;
    object-position: center top;
    display: block;
    border: 0;
}

/* wp:details (FAQ) - przejmuje styl .faq-item gdy ma tę klasę */
.wp-block-details.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.wp-block-details.faq-item > summary {
    font-size: 1.05rem;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    color: var(--navy);
}
.wp-block-details.faq-item > *:not(summary) {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 10px 0 6px;
}

/* wp:group toc-item - karta w toc grid */
.wp-block-group.toc-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 20px;
    transition:
        box-shadow 0.18s,
        transform 0.18s;
}
.wp-block-group.toc-item:hover {
    box-shadow: 0 8px 20px rgba(22, 36, 62, 0.1);
    transform: translateY(-2px);
}
.wp-block-group.toc-item h3 {
    font-size: 0.97rem;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    margin: 0 0 4px;
}
.wp-block-group.toc-item p {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

/* wp:group offer-card */
.wp-block-group.offer-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}
.wp-block-group.offer-card.main {
    background: var(--navy);
    border-color: transparent;
    color: #e8edf8;
}
.wp-block-group.offer-card.main h3,
.wp-block-group.offer-card.main * {
    color: #e8edf8;
}
.wp-block-group.offer-card.main h3 {
    color: #fff;
}

/* wp:group flow-block */
.wp-block-group.flow-block {
    background: var(--amber-soft);
    border-left: 4px solid var(--amber);
    border-radius: 10px;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--navy);
    margin: 20px 0;
}
.wp-block-group.flow-block p {
    margin: 0;
}

/* ── KT GALLERY (ACF block - grid + carousel) ───────────── */
.kt-gallery {
    margin: 0;
}
.kt-gallery img.kt-gallery-img,
.kt-gallery .wp-block-image img {
    display: block;
}

/* GRID - jednolite kafelki (cover), 3:4 dla spójności */
.kt-gallery.kt-gallery-grid .kt-gallery-grid,
.kt-gallery.kt-gallery-grid > .container > .kt-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 24px auto;
}
.kt-gallery.kt-gallery-grid .kt-gallery-item {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(22, 36, 62, 0.08);
    transition:
        transform 0.18s,
        box-shadow 0.18s;
    background: #fff;
}
.kt-gallery.kt-gallery-grid .kt-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(22, 36, 62, 0.15);
}
.kt-gallery.kt-gallery-grid .kt-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CAROUSEL - cały obraz widoczny (contain), karty dopasowane do dostępnej szerokości */
.kt-gallery.kt-gallery-carousel .kt-gallery-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 40px;
}
.kt-gallery.kt-gallery-carousel .kt-gallery-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
    padding: 8px 4px 16px;
    align-items: stretch;
}
.kt-gallery.kt-gallery-carousel .kt-gallery-track::-webkit-scrollbar {
    display: none;
}
.kt-gallery.kt-gallery-carousel .kt-gallery-item {
    flex: 0 0 280px;
    scroll-snap-align: start;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(22, 36, 62, 0.15);
    background: #fff;
    display: flex;
    align-items: stretch;
}
.kt-gallery.kt-gallery-carousel .kt-gallery-item img {
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: contain;
    background: #fff;
}
.kt-gallery .carousel-btn.prev {
    left: 0;
}
.kt-gallery .carousel-btn.next {
    right: 0;
}

.kt-gallery.has-lightbox .kt-gallery-item {
    cursor: zoom-in;
}

@media (max-width: 600px) {
    .kt-gallery.kt-gallery-grid .kt-gallery-grid,
    .kt-gallery.kt-gallery-grid > .container > .kt-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    .kt-gallery.kt-gallery-carousel .kt-gallery-wrapper {
        padding: 0 36px;
    }
    .kt-gallery.kt-gallery-carousel .kt-gallery-item {
        flex: 0 0 calc(100vw - 96px);
        max-width: 280px;
    }
    .kt-gallery.kt-gallery-carousel .kt-gallery-item img {
        max-height: 380px;
    }
}

/* ── KT LIGHTBOX (modal nakładkowy) ─────────────────────── */
.kt-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}
.kt-lightbox-overlay.is-open {
    display: flex;
}
.kt-lightbox-figure {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: default;
}
.kt-lightbox-figure img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: #fff;
}
.kt-lightbox-figure figcaption {
    color: #c4cde0;
    font-size: 0.9rem;
    text-align: center;
    max-width: 600px;
}
.kt-lightbox-overlay button {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition:
        background 0.18s,
        transform 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kt-lightbox-overlay button:hover {
    background: rgba(255, 255, 255, 0.2);
}
.kt-lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    line-height: 1;
}
.kt-lightbox-prev,
.kt-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    display: none;
}
.kt-lightbox-overlay.has-nav .kt-lightbox-prev,
.kt-lightbox-overlay.has-nav .kt-lightbox-next {
    display: flex;
}
.kt-lightbox-prev {
    left: 20px;
}
.kt-lightbox-next {
    right: 20px;
}
@media (max-width: 600px) {
    .kt-lightbox-overlay {
        padding: 20px;
    }
    .kt-lightbox-close {
        top: 12px;
        right: 12px;
    }
    .kt-lightbox-prev {
        left: 8px;
    }
    .kt-lightbox-next {
        right: 8px;
    }
}

/* ── THUMB GALLERY (siatka miniatur z lightboxem) ───────── */
.wp-block-gallery.kt-thumb-gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin: 24px auto;
}
.wp-block-gallery.kt-thumb-gallery > .wp-block-image {
    margin: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(22, 36, 62, 0.08);
    transition:
        transform 0.18s,
        box-shadow 0.18s;
    background: #fff;
}
.wp-block-gallery.kt-thumb-gallery > .wp-block-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(22, 36, 62, 0.15);
}
.wp-block-gallery.kt-thumb-gallery > .wp-block-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}
@media (max-width: 600px) {
    .wp-block-gallery.kt-thumb-gallery {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
        gap: 8px;
    }
}

/* ── IMAGE CAROUSEL (galeria zrzutów stron / okładek) ──── */

/* Wrapper z przyciskami strzałek wokół wp:gallery */
.kt-image-carousel-wrapper {
    position: relative;
    margin: 32px auto;
    max-width: 1000px;
    padding: 0 48px;
}

/* Gallery jako horizontal scroll z snap (działa też BEZ wrappera/strzałek) */
.wp-block-gallery.kt-image-carousel {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 8px 4px 16px;
    margin: 0;
}
.wp-block-gallery.kt-image-carousel::-webkit-scrollbar {
    display: none;
}

.wp-block-gallery.kt-image-carousel > .wp-block-image {
    flex: 0 0 auto;
    scroll-snap-align: center;
    margin: 0;
    width: 280px;
    max-width: 280px;
}
.wp-block-gallery.kt-image-carousel > .wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(22, 36, 62, 0.15);
    background: #fff;
}
.wp-block-gallery.kt-image-carousel > .wp-block-image figcaption {
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 8px;
}

@media (max-width: 860px) {
    .kt-image-carousel-wrapper {
        padding: 0 32px;
    }
    .wp-block-gallery.kt-image-carousel > .wp-block-image {
        width: calc(100vw - 96px);
        max-width: 240px;
    }
}

/* ── VIDEO FRAME (dla YouTube/Vimeo embedów) ────────────── */
.kt-video-frame {
    display: block !important;
    width: 100%;
    max-width: 720px;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 32px;
    margin-bottom: 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(22, 36, 62, 0.18);
    background: #000;
    aspect-ratio: 16 / 9;
    /* Bezpiecznik: jak rodzic jest flex/grid */
    align-self: center !important;
    place-self: center !important;
    float: none !important;
    clear: both;
}
/* Wariant pionowy (YT Shorts, TikTok, Reels - 9:16) */
.kt-video-frame.is-vertical {
    /*max-width: 360px;
	aspect-ratio: 9 / 16;*/

    max-width: 520px;
    aspect-ratio: 9 / 9;
}
/* WP renderuje aspect-ratio przez padding-top hack + iframe position:absolute.
   Wyłączamy ten mechanizm i robimy własny przez aspect-ratio na figure. */
.kt-video-frame .wp-block-embed__wrapper {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    position: relative;
}
.kt-video-frame.wp-embed-aspect-16-9 .wp-block-embed__wrapper::before,
.kt-video-frame.wp-embed-aspect-9-16 .wp-block-embed__wrapper::before,
.kt-video-frame.wp-has-aspect-ratio .wp-block-embed__wrapper::before {
    display: none !important;
    padding-top: 0 !important;
}
.kt-video-frame iframe,
.kt-video-frame .wp-block-embed__wrapper iframe {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    inset: auto !important;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 860px) {
    .hero-inner,
    .two-col,
    .toc-grid,
    .author-layout,
    .testi-grid,
    .offer-grid {
        grid-template-columns: 1fr;
    }
    .book-stage {
        padding: 0 0 36px;
        transform: translateY(8px);
        position: relative;
    }
    .book-fan {
        width: 300px;
        height: 420px;
        margin: 0 auto;
        position: relative;
    }
    .fan-card {
        width: 210px;
        height: 300px;
    }
    .fan-page-1 {
        transform: translateX(108px) rotate(3deg) translateY(0);
    }
    .fan-page-2 {
        transform: translateX(216px) rotate(11deg) translateY(12px);
    }
    .book-fan:hover .fan-page-1 {
        transform: translateX(126px) rotate(5deg) translateY(-6px);
    }
    .book-fan:hover .fan-page-2 {
        transform: translateX(258px) rotate(15deg) translateY(8px);
    }

    /* Fix: cena była pozycjonowana absolute na 392px (poza viewportem na mobile).
	   Przesuwamy do prawego górnego rogu wachlarza. */
    .book-price-badge {
        left: auto !important;
        right: -12px !important;
        top: -12px !important;
        width: 78px;
        height: 78px;
    }
    .book-fan:hover .book-price-badge {
        transform: translate(0, -4px);
    }
    .book-price-badge .price-now {
        font-size: 1.08rem;
    }

    .pricing-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .hero {
        padding: 56px 20px 64px;
    }
    .top-bar {
        padding: 6px 10px 7px;
        font-size: 0.76rem;
    }
    .top-main {
        gap: 6px 8px;
    }

    /* Fix: borderki w listach na ciemnym tle wyglądały jak partial table outline.
	   Subtelniej + brak ostatniej linii. */
    .section-dark .check-list li,
    .section-dark .x-list li {
        border-color: rgba(255, 255, 255, 0.06) !important;
        padding: 8px 0 8px 28px;
    }
    .section-dark .check-list li:last-child,
    .section-dark .x-list li:last-child {
        border: 0 !important;
    }

    /* Fix: karuzela opinii - 1 card na widok = swipe do kolejnego.
	   Bazujemy na 100% szerokości wrappera (nie viewportu - ma swój container/padding). */
    .mini-testi-wrapper {
        padding: 0 32px;
    }
    .mini-testi-track {
        gap: 8px;
    }
    .mini-testi-card {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: 0;
        min-height: auto;
        box-sizing: border-box;
    }
    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
    .carousel-btn.prev {
        left: 0;
    }
    .carousel-btn.next {
        right: 0;
    }

    /* Fix: przycisk "Dodaj do koszyka" wrappował na 2 linie i wyglądał krzywo. */
    .btn-buy {
        padding: 16px 24px;
        font-size: 1.05rem;
        width: 100%;
        max-width: 320px;
        box-sizing: border-box;
        display: block;
        margin: 0 auto;
        white-space: normal;
    }
    .lp-product-box img {
        max-width: 200px !important;
        height: auto;
    }
    .lp-product-box h3 {
        font-size: 1.2rem !important;
    }
    .price-now {
        font-size: 2.2rem;
    }

    /* Pricing box: mniejszy padding na mobile */
    .pricing-body {
        padding: 20px 16px;
    }
    .price-block {
        padding: 16px 14px;
    }

    /* Video frames na mobile - margines */
    .kt-video-frame {
        margin: 24px 16px;
    }
    .kt-video-frame.is-vertical {
        max-width: min(280px, calc(100vw - 48px));
    }
}
