/* 1. Global Styles & Variables */
:root {
    --primary-color: #0052cc;
    --accent-color: #ffc107;
    --dark-color: #1c1d21;
    --text-color: #343a40;
    --light-gray: #e9ecef;
    --white-color: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease-in-out;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px; /* Offset for fixed header */
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

ul {
    list-style: none;
}

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

/* 2. Header & Navigation */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
    padding: 15px 0;
}

#header.scrolled {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--light-gray);
}

#header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    z-index: 1001; /* Ensure logo is above mobile nav */
}

.logo img {
    height: 100px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-links a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 99px; /* Pill shape */
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.btn-nav-cta {
    background-color: var(--primary-color);
    color: var(--white-color) !important;
}

.btn-nav-cta:hover {
    background-color: #0041a3;
    color: var(--white-color) !important;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-nav-toggle .material-symbols-outlined {
    font-size: 36px;
    color: var(--dark-color);
}

/* 3. Sections & Animation */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
    color: #6c757d;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Hero Section */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

#hero {
    display: flex;
    align-items: center;
    height: 100vh;
    min-height: 700px;
    background: linear-gradient(135deg, #e6f0ff 25%, #ffffff 100%);
    padding-top: 140px; /* Offset for header */
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

#hero h1 {
    color: var(--dark-color);
    margin-bottom: 20px;
}

#hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 0 20px 0;
}

.rating {
    color: var(--accent-color);
    margin-bottom: 40px;
}

.rating .material-symbols-outlined {
    font-size: 28px;
    vertical-align: middle;
}

.hero-image {
    flex: 1;
    max-width: 500px;
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: contain; /* Use contain to ensure the whole object is visible */
    animation: float 5s ease-in-out infinite;
    /* A subtle drop-shadow works better for transparent images */
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

/* 5. Button Styles */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--dark-color);
    border-color: var(--accent-color);
    font-weight: 700;
}

.btn-primary:hover {
    background-color: #ffca2c;
    border-color: #ffca2c;
    color: var(--dark-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

/* 6. About Section */
#about {
    background-color: var(--light-gray);
    padding: 120px 0;
}
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: center;
}

.feature-item {
    background: var(--white-color);
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-item svg {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h3 {
    margin-bottom: 10px;
}

/* 7. Categories Section */
#categories {
    background-color: var(--white-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.category-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.category-card p {
    flex-grow: 1;
    margin-bottom: 20px;
}

.category-card .btn {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
    align-self: flex-start;
    padding: 10px 20px;
}

.category-card .btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* 7b. Bestsellers (Product) Section */
#bestsellers {
    background-color: var(--light-gray);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
    text-align: left;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image-container {
    position: relative;
    overflow: hidden;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain; /* 'contain' is better for showing full products */
    padding: 10px;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.bestseller-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: var(--dark-color);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
}

.product-content {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: 15px;
}

.product-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.product-rating {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.product-rating .material-symbols-outlined {
    font-size: 20px;
    vertical-align: middle;
    /* This makes the star half-filled */
    font-variation-settings: 'FILL' 1;
}

.product-card p {
    flex-grow: 1;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
}

.product-footer {
    padding: 0 20px 20px;
    margin-top: auto; /* Pushes footer to the bottom */
}

.product-card .btn-buy {
    display: block;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.product-card .btn-buy:hover {
    background-color: #0041a3; /* A slightly darker primary color */
    border-color: #0041a3;
    color: var(--white-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 82, 204, 0.3);
}


/* 8. Test Videos Section */
#tests {
    background-color: var(--white-color);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.video-card {
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.video-card a {
    display: block;
    position: relative;
}

.video-card img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon svg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.section-cta {
    text-align: center;
    margin-top: 50px;
}


/* 9. AI Helper Section */
#ai-helper {
    background-color: var(--light-gray);
}

#moj-czat-n8n {
    width: 100%;
    max-width: 900px;
    height: 70vh;
    min-height: 500px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* 10. Contact Section */
#contact {
    text-align: center;
    background: var(--dark-color);
    color: var(--white-color);
}
#contact .section-title, #contact .section-subtitle {
    color: var(--white-color);
}
#contact .section-subtitle {
    color: rgba(255, 255, 255, 0.7);
}


/* 11. Footer */
footer {
    background-color: var(--dark-color);
    color: #adb5bd;
    padding: 60px 0 20px;
}

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

.footer-col .logo {
    color: var(--white-color);
    margin-bottom: 15px;
    display: inline-block;
}

.footer-col h4 {
    color: var(--white-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-col p, .footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #adb5bd;
}

.footer-col a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    font-size: 0.9rem;
}

/* 12. Responsive Design */
@media (max-width: 992px) {
    .category-grid, .video-grid, .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .hero-container {
        gap: 30px;
    }
}


@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        inset: 0 0 0 30%; /* top, right, bottom, left */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        transform: translateX(100%);
        transition: transform 350ms ease-out;
        padding: 20px;
    }

    .nav-links[data-visible="true"] {
        transform: translateX(0%);
    }

    .nav-links a {
        font-size: 1.25rem;
        display: block; /* Make links take full width for easier tapping */
        width: 100%;
        text-align: center;
    }

    #hero {
        height: auto;
        padding: 120px 0 60px 0;
        min-height: unset;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-image {
        margin-bottom: 40px;
    }

    #hero p {
        margin: 0 auto 20px auto;
    }

    section {
        padding: 60px 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}