:root {
    --primary-color: #1a9a56;
    --primary-hover: #168249;
    --secondary-color: #007bff;
    --secondary-hover: #0069d9;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --background-color: #f8f9fa;
    /* Lighter gray background */
    --surface-color: #ffffff;
    /* White for cards and surfaces */
    --text-color: #4a4a4a;
    --heading-color: #1d2d35;
    --border-color: #e1e5ea;
    --icon-color: #34495e;
    /* Default color for product icons */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.08);
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for sticky nav */
    background-color: var(--background-color);
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 70px;
    /* Space for sticky nav */
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex-grow: 1;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    line-height: 1.3;
}

h4 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus:not(:disabled) {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 154, 86, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover:not(:disabled),
.btn-secondary:focus:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
}

.btn-icon {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    color: var(--heading-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2rem;
    font-family: serif;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.btn-icon:hover {
    background-color: #ced4da;
    transform: scale(1.1);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}


/* --- Top Nav Bar --- */
.top-nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--heading-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link-admin {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link-admin:hover {
    color: var(--primary-color);
}


/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 450px;
    max-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.slides-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.05);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.5s ease-in-out, transform 8s ease-out;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

.slide-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background-color: white;
}

/* --- Product Grid Section --- */
.product-grid-section {
    padding: 5rem 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background-color: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--heading-color);
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow);
    cursor: pointer;
    width: 100%;
    font-family: var(--font-body);
}

.product-card:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #c1c9d1;
}

.product-card.selected {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.product-card:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    position: relative;
}

.product-card:disabled::after {
    content: 'Wkrótce';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6c757d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-card:disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.product-icon {
    margin-bottom: 1rem;
    line-height: 1;
    color: var(--icon-color);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-icon svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
    transition: transform 0.2s ease-in-out;
}

.product-card:hover:not(:disabled) .product-icon svg {
    transform: scale(1.1);
}

.product-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-card p {
    font-size: 0.9rem;
    color: var(--text-color);
}


/* --- How It Works Section --- */
.how-it-works-section {
    padding: 5rem 1rem;
    background-color: var(--surface-color);
}

.steps-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    max-width: 320px;
}

.step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 4px 10px rgba(26, 154, 86, 0.4);
}

.step-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* --- Company List Section --- */
.company-list-section {
    padding: 5rem 1rem;
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.company-card-wrapper {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow);
}

.company-card-wrapper:hover {
    border-color: #c1c9d1;
    box-shadow: var(--shadow-lg);
}

.company-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.company-info {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.company-logo {
    height: 40px;
    max-width: 120px;
    object-fit: contain;
}

.company-name {
    font-size: 1.2rem;
    font-weight: 500;
}

.company-price {
    flex: 1.5;
    text-align: right;
    display: flex;
    flex-direction: column;
    padding-right: 1rem;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--heading-color);
}

.price-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.company-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 1.5rem;
    position: relative;
}

.company-details.expanded {
    max-height: 1000px;
    /* Large enough value */
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.content-display {
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: justify;
    font-size: 1.05rem;
}

/* --- Reviews Section --- */
.reviews-section {
    padding: 5rem 1rem;
}

.reviews-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    transition: opacity 0.5s ease-in-out;
}

.reviews-container.fade-out {
    opacity: 0;
}

.review-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.review-stars {
    margin-bottom: 1rem;
    color: #f39c12;
}

.review-stars svg {
    width: 20px;
    height: 20px;
}

.review-stars .star-filled {
    fill: currentColor;
}

.review-stars .star-empty {
    fill: #e0e0e0;
}

.review-text {
    font-style: italic;
    color: #555;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    quotes: "“""”""‘""’";
}

.review-text::before {
    content: open-quote;
    font-size: 1.5em;
    line-height: 0;
    position: relative;
    top: 0.2em;
    left: -0.1em;
    color: #e0e0e0;
}

.review-author {
    font-weight: 600;
    text-align: right;
    color: var(--heading-color);
}

/* --- SEO Text Section --- */
.seo-text-section {
    padding: 5rem 1rem 9rem;
    background-color: var(--surface-color);
}

.seo-content {
    max-width: 800px;
    margin: 0 auto;
}

.seo-content h2,
.seo-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.seo-content h2:first-child,
.seo-content h3:first-child {
    margin-top: 0;
}

.seo-content p,
.seo-content li {
    margin-bottom: 1rem;
    text-align: justify;
    font-size: 1.05rem;
    line-height: 1.7;
}


/* --- Page Wrappers (Product, Admin) --- */
.page-wrapper {
    padding: 2rem 2rem 6rem;
    background: var(--surface-color);
    max-width: 900px;
    margin: 2rem auto;
    width: calc(100% - 2rem);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-color);
}

/* --- Generic Comparison / Product Page --- */
.product-page-content {
    max-width: 800px;
    margin: 0 auto;
}

.product-page-content h2,
.product-page-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.product-page-content p,
.product-page-content li {
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: justify;
}

.product-page-content ul,
.product-page-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.partner-list-section {
    margin-top: 3rem;
    padding-top: 2rem;
}

.partner-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.partner-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    gap: 1rem;
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-grow: 1;
}

.partner-logo {
    height: 35px;
    max-width: 110px;
    object-fit: contain;
}

.partner-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.partner-actions {
    flex-shrink: 0;
}


.cta-button {
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    width: 100%;
}


/* --- App Footer --- */
.app-footer {
    background-color: var(--heading-color);
    color: #e1e5ea;
    padding: 4rem 1rem 2rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.footer-column h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
    text-decoration: underline;
}

.footer-text-content {
    color: #bdc3c7;
    margin: 0;
}

.footer-brand p {
    color: #bdc3c7;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    font-size: 0.9rem;
    color: #95a5a6;
}

/* --- Spinner --- */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 10;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
        /* Adjust for smaller nav */
    }

    .top-nav-bar {
        height: 60px;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-actions .btn {
        display: none;
        /* Hide button on small screens */
    }

    .nav-link-admin {
        background: var(--primary-color);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }

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

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
    }

    .footer-container {
        text-align: center;
        grid-template-columns: 1fr;
    }

    .footer-column h4 {
        justify-content: center;
    }

    .company-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .company-price {
        text-align: left;
        padding-right: 0;
    }

    .company-actions {
        width: 100%;
        justify-content: space-between;
    }

    .partner-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .partner-actions {
        width: 100%;
    }

    .partner-actions .btn {
        width: 100%;
    }

    .reviews-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .company-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .company-name {
        font-size: 1.1rem;
    }

    .company-logo {
        height: 30px;
    }
}