/* ================================
   CSS Variables & Base Styles
   ================================ */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

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

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

a:hover {
    color: var(--primary-dark);
}

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

/* ================================
   Header & Navigation
   ================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text .accent {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

/* ================================
   Buttons
   ================================ */
.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

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

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

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #0d9668;
    color: white;
}

/* ================================
   Hero Section
   ================================ */
.hero {
    padding: 10rem 0 6rem;
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%23334155" opacity="0.3"/></svg>');
    background-size: 50px 50px;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ================================
   Features Section
   ================================ */
.features {
    padding: 5rem 0;
    background: var(--card-bg);
}

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

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--dark-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ================================
   Products Section
   ================================ */
.products {
    padding: 6rem 0;
}

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

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

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

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-badge.new {
    background: var(--secondary-color);
}

.product-content {
    padding: 1.5rem;
}

.product-content h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.product-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.product-features li {
    color: var(--text-secondary);
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* ================================
   Contact Section
   ================================ */
.contact {
    padding: 6rem 0;
    background: var(--card-bg);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-card {
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--dark-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.contact-card a {
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-hours {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   Footer
   ================================ */
.footer {
    background: var(--dark-bg);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   Product Detail Page Styles
   ================================ */
.page-header {
    padding: 8rem 0 4rem;
    background: var(--gradient-dark);
}

.breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb span {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header .lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
}

.product-detail {
    padding: 4rem 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.product-gallery {
    position: sticky;
    top: 100px;
}

.gallery-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--card-bg);
}

.gallery-main img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.gallery-thumbs {
    display: flex;
    gap: 0.75rem;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--primary-color);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.product-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.price-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.price-box .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.price-box .price-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.features-list {
    list-style: none;
    margin: 2rem 0;
}

.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list .icon {
    color: var(--secondary-color);
    font-weight: bold;
}

.content-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.content-section h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

.content-section p,
.content-section li {
    color: var(--text-secondary);
    line-height: 1.8;
}

.content-section ul,
.content-section ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.step-list {
    list-style: none;
    padding: 0;
    counter-reset: step;
}

.step-list li {
    counter-increment: step;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.code-block {
    background: #0d1117;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.code-block code {
    color: #e6edf3;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.info-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.info-box h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box.warning h4 {
    color: var(--accent-color);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.specs-table th,
.specs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.specs-table th {
    color: var(--text-muted);
    font-weight: 500;
    width: 40%;
}

.specs-table td {
    color: var(--text-primary);
}

.order-box {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.order-box h2 {
    margin-bottom: 1rem;
}

.order-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.order-contacts {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.order-contact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-contact .icon {
    font-size: 1.5rem;
}

.order-contact a {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 968px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-gallery {
        position: relative;
        top: 0;
    }

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

    .footer-brand p {
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--dark-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

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

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

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

    .order-contacts {
        flex-direction: column;
        align-items: center;
    }

    .gallery-main img {
        height: 280px;
    }
}

/* ============================================
   TRESC Z PLIKOW MARKDOWN (.rich-text)
   Odwzorowuje wyglad recznie pisanych sekcji:
   listy numerowane = kroki instrukcji, ``` = blok kodu
   ============================================ */

.rich-text > h2:first-child {
    margin-top: 0;
}

.rich-text ol {
    list-style: none;
    padding: 0;
    counter-reset: step;
    margin: 1.5rem 0;
}

.rich-text ol li {
    counter-increment: step;
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 1.5rem;
}

.rich-text ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.rich-text ol ul,
.rich-text ol ol {
    margin-top: 0.5rem;
}

.rich-text pre {
    background: #0d1117;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.rich-text pre code {
    color: #e6edf3;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
}

.rich-text :not(pre) > code {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 4px;
    padding: 0.15em 0.4em;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.rich-text .info-box h4 {
    margin-top: 0;
}

.rich-text .info-box > *:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .rich-text ol li {
        padding-left: 2.75rem;
    }

    .rich-text pre {
        padding: 1rem;
    }
}

/* ============================================
   INSTRUKCJE MONTAZU
   ============================================ */

/* Odnosnik do instrukcji na stronie produktu */
.instruction-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 1.75rem;
}

.instruction-cta-text {
    flex: 1 1 320px;
}

.instruction-cta h3 {
    margin-bottom: 0.5rem;
}

.instruction-cta p {
    margin-bottom: 0;
}

.instruction-cta .btn {
    white-space: nowrap;
}

/* Czas montazu i poziom trudnosci */
.instruction-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.instruction-meta .meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
}

.instruction-meta .meta-icon {
    font-size: 1.25rem;
}

.instruction-meta .meta-label {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Kolejne kroki: naglowki h2 numeruja sie same */
.instruction-body {
    counter-reset: instruction-step;
}

.instruction-body h2 {
    counter-increment: instruction-step;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 2.5rem;
}

.instruction-body h2::before {
    content: counter(instruction-step);
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.instruction-body > h2:first-child {
    margin-top: 0;
}

/* Zdjecia w instrukcjach: podpis brany z tekstu alternatywnego */
.rich-text figure {
    margin: 1.5rem 0;
}

.rich-text figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.rich-text figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    opacity: 0.75;
    text-align: center;
}

@media (max-width: 768px) {
    .instruction-cta {
        padding: 1.25rem;
    }

    .instruction-meta .meta-item {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Wydruk instrukcji: bez nawigacji, stopki i ramek */
@media print {
    .header,
    .footer,
    .order-box,
    .instruction-cta {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .rich-text figure img {
        max-height: 9cm;
        width: auto;
    }
}
