/**
 * Homepage styles – full CSS for index.php (replaces original inline <style> block).
 * Values match CR report / original inline block (e.g. --primary: #3d6b1e; --bg-body: #f6f8f4).
 */

/* ==================== Variables ==================== */
:root {
    --primary: #3d6b1e;
    --primary-dark: #2d5016;
    --dark: #1a2612;
    --bg-body: #f6f8f4;
    --bg-surface: #ffffff;
    --text: #1a2612;
    --text-muted: #5c6b54;
    --border: #dce3d6;
    --secondary: #6b21a8;
}

[data-theme="dark"] {
    --primary: #4a8c1f;
    --primary-dark: #3d7518;
    --dark: #0d0d0d;
    --bg-body: #0d0d0d;
    --bg-surface: #1a1a1a;
    --text: #ffffff;
    --text-muted: #b0b0b0;
    --border: #2a2a2a;
    --secondary: #8b5cf6;
}

/* ==================== Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-body);
}

[data-theme="dark"] body {
    background: #0d0d0d;
    color: #e0e0e0;
}

/* ==================== Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Navbar (header) ==================== */
.navbar,
.site-header.navbar {
    background: var(--bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand,
.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-brand:hover,
.site-logo:hover {
    color: var(--primary-dark);
}

.lang-switcher select,
.lang-dropdown-btn,
.header-search-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-body);
    color: var(--text);
    font-size: 0.9rem;
}

.lang-switcher select:focus,
.header-search-form:focus-within {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 107, 30, 0.15);
}

/* ==================== Benefits section ==================== */
.benefits {
    padding: 60px 0;
    background: var(--bg-body);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.benefit-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    overflow: hidden;
    text-align: center;
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.benefit-card:hover::before {
    opacity: 1;
}

.benefit-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
}

.benefit-icon-wrapper.affiliate {
    background: rgba(61, 107, 30, 0.12);
    color: var(--primary);
}

.benefit-icon-wrapper.automation {
    background: rgba(107, 33, 168, 0.12);
    color: var(--secondary);
}

.benefit-icon-wrapper.scale {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.benefit-icon-wrapper.analytics {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.benefit-icon-wrapper.security {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.benefit-icon-wrapper.network {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.benefit-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(61, 107, 30, 0.15);
    color: var(--primary);
    border-radius: 6px;
    margin-bottom: 12px;
}

.benefit-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.benefit-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

.benefits-cta {
    text-align: center;
    margin-top: 20px;
}

.btn-large {
    display: inline-block;
    padding: 16px 36px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

/* ==================== Site updates (rich text from TinyMCE) ==================== */
.site-update-card > h3 {
    margin-top: 0;
}

.site-update-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

.site-update-body p {
    margin: 0 0 0.75em 0;
}

.site-update-body p:last-child {
    margin-bottom: 0;
}

.site-update-body ul,
.site-update-body ol {
    margin: 0 0 0.75em 0;
    padding-left: 1.5em;
}

.site-update-body li {
    margin-bottom: 0.25em;
}

.site-update-body li:last-child {
    margin-bottom: 0;
}

.site-update-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.75em 0;
    border-radius: 8px;
}

.site-update-body a {
    color: var(--primary);
    text-decoration: underline;
}

.site-update-body a:hover {
    color: var(--primary-dark);
}

.site-update-body strong {
    font-weight: 700;
}

.site-update-body em {
    font-style: italic;
}

.site-update-body h1,
.site-update-body h2,
.site-update-body h3,
.site-update-body h4 {
    margin: 0.75em 0 0.35em 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.site-update-body h1:first-child,
.site-update-body h2:first-child,
.site-update-body h3:first-child,
.site-update-body h4:first-child {
    margin-top: 0;
}

.site-update-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 0.9rem;
}

.site-update-body table td,
.site-update-body table th {
    padding: 6px 10px;
    border: 1px solid var(--border);
}

.site-update-body blockquote {
    margin: 0.75em 0;
    padding-left: 1em;
    border-left: 4px solid var(--primary);
    color: var(--text-muted);
    font-style: italic;
}

[data-theme="dark"] .site-update-body a {
    color: var(--primary);
}

[data-theme="dark"] .site-update-body a:hover {
    color: var(--primary-dark);
}

[data-theme="dark"] .site-update-body table td,
[data-theme="dark"] .site-update-body table th {
    border-color: var(--border);
}

[data-theme="dark"] .site-update-body h1,
[data-theme="dark"] .site-update-body h2,
[data-theme="dark"] .site-update-body h3,
[data-theme="dark"] .site-update-body h4 {
    color: #ffffff;
}
[data-theme="dark"] .site-update-body blockquote {
    background: #253318;
    color: #e0e8dc;
    border-left-color: var(--primary);
}

/* ==================== Products section ==================== */
.products-section {
    padding: 60px 0;
    background: var(--bg-body);
}

.promoted-section {
    padding: 60px 0;
    background: var(--bg-body);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Półprzezroczysta zasłona na zdjęciu – znika przy najechaniu (wyraźniejszy widok) */
.product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.product-card:hover .product-image::after {
    opacity: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-type-icon {
    font-size: 4rem;
    color: var(--text-muted);
}

.product-body {
    padding: 20px;
}

.product-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-body .seller {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.product-body .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.promoted-section .product-card {
    position: relative;
}

.promo-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    border-radius: 6px;
    z-index: 1;
}

/* ==================== Affiliate box ==================== */
.affiliate-box {
    background: #f6f8f4;
    padding: 12px 15px;
    border-top: 1px solid var(--border);
}

.affiliate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.affiliate-header strong {
    color: var(--primary);
}

.affiliate-link-row {
    display: flex;
    gap: 6px;
}

.affiliate-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text);
}

.btn-copy {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: #fff;
}

.btn-copy.copied {
    background: #16a34a;
    border-color: transparent;
    color: #fff;
}

/* ==================== CTA section ==================== */
.cta-section {
    padding: 80px 0;
    margin-top: 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 1.15rem;
    opacity: 0.95;
    margin-bottom: 24px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .btn-white {
    background: #fff;
    color: var(--primary);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.cta-section .btn-white:hover {
    background: #f0fdf4;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* ==================== Footer ==================== */
.footer,
.site-footer {
    background: #1a2612;
    color: #8a9a7e;
    padding: 50px 20px 30px;
    margin-top: 60px;
}

.footer .container,
.footer .site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section p,
.footer p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    color: #8a9a7e;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a,
.footer a {
    color: #8a9a7e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-section a:hover,
.footer a:hover {
    color: #4a8c1f;
}

.footer-bottom {
    border-top: 1px solid #2d4a1a;
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0;
}

/* ==================== No products ==================== */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-body);
    border: 2px dashed var(--border);
    border-radius: 12px;
    margin: 20px 0;
}

.no-products p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.no-products .btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.no-products .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 107, 30, 0.4);
}

/* ==================== Dark theme overrides ==================== */
[data-theme="dark"] .benefits,
[data-theme="dark"] .benefits-section {
    background: #0d0d0d;
}

[data-theme="dark"] .section-subtitle {
    color: #b0b0b0;
}

[data-theme="dark"] .benefit-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

[data-theme="dark"] .benefit-tag {
    background: rgba(74, 140, 31, 0.2);
    color: #4a8c1f;
}

[data-theme="dark"] .benefit-card h3,
[data-theme="dark"] .benefit-title {
    color: #ffffff;
}

[data-theme="dark"] .benefit-card p,
[data-theme="dark"] .benefit-desc {
    color: #b0b0b0;
}

[data-theme="dark"] .benefits-cta {
    background: linear-gradient(135deg, #1a2612 0%, #1a1a2a 100%);
}

[data-theme="dark"] .btn-white {
    background: #ffffff;
    color: #3d6b1e;
}

[data-theme="dark"] .btn-white:hover {
    background: #f0fdf4;
    color: #2d5016;
}

[data-theme="dark"] .products-section {
    background: #0d0d0d;
}

[data-theme="dark"] .section-title {
    color: #ffffff;
}

[data-theme="dark"] .product-image::after {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .product-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

[data-theme="dark"] .product-card h3 {
    color: #ffffff;
}

[data-theme="dark"] .product-card p {
    color: #b0b0b0;
}

[data-theme="dark"] .product-body .price,
[data-theme="dark"] .product-price {
    color: #4a8c1f;
}

[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, #1a2612 0%, #1a1a2a 100%);
}

[data-theme="dark"] .footer,
[data-theme="dark"] .site-footer {
    background: #141414;
    border-top: 1px solid #2a2a2a;
}

[data-theme="dark"] .footer a,
[data-theme="dark"] .footer-section a {
    color: #4a8c1f;
}

[data-theme="dark"] .footer p,
[data-theme="dark"] .footer-section p {
    color: #707070;
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .site-header {
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .site-nav a {
    color: #b0b0b0;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .site-nav a:hover {
    color: #ffffff;
}

[data-theme="dark"] .logo,
[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .site-logo {
    color: #ffffff;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] .affiliate-input {
    background: #1a1a1a;
    border: 1px solid #333333;
    color: #ffffff;
}

[data-theme="dark"] input::placeholder {
    color: #606060;
}

[data-theme="dark"] .affiliate-box {
    background: #0d0d0d;
    border-top-color: #2a2a2a;
}

[data-theme="dark"] .affiliate-header {
    color: #b0b0b0;
}

[data-theme="dark"] .btn-copy {
    background: #1a1a1a;
    border-color: #333333;
    color: #b0b0b0;
}

[data-theme="dark"] .no-products {
    background: #0d0d0d;
    border-color: #2a2a2a;
}

[data-theme="dark"] .no-products p {
    color: #b0b0b0;
}

/* ==================== Media queries ==================== */
@media (max-width: 992px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .cta-section {
        padding: 60px 0;
    }

    .cta-section h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .benefits {
        padding: 40px 0;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .benefit-card {
        padding: 20px 18px;
    }

    .products-section,
    .promoted-section {
        padding: 40px 0;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-body {
        padding: 16px;
    }

    .cta-section {
        padding: 50px 20px;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .cta-section p {
        font-size: 1rem;
    }

    .footer-grid,
    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
