/* =========================================
   1. VARIABLES & GLOBAL SETTINGS
   ========================================= */
:root {
    --color-primary: #072136;
    --color-secondary: #0c3c60;
    --color-accent: #8cbcdb;
    --color-background: #FFFFFF;
    --color-light-gray: #f7f7f7;
    --color-text: #333333;
    --color-text-light: #FFFFFF;
    --color-price: #3a86ff;
    --color-old-price: #8d99ae;
    
    --font-primary: 'Helvetica Neue', Arial, sans-serif;
    --font-headings: 'Georgia', serif;
    
    --container-width: 1100px;
    --spacing: 1rem;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { 
    list-style: none; 
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover { 
    color: var(--color-accent); 
}

/* =========================================
   2. TYPOGRAPHY & LAYOUT UTILS
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing) * 1.5);
}

main { 
    flex-grow: 1; 
}

h1, h2, h3, h4 {
    font-family: var(--font-headings);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
    border: 2px solid var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-text-light);
    cursor: pointer;
}

.btn:hover {
    background-color: var(--color-background);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
.site-header {
    background-color: var(--color-background);
    color: var(--color-primary);
    padding: var(--spacing) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid #eee;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
}

.site-logo img {
    height: 40px;
    width: auto;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: var(--color-primary); 
    font-size: 16px;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--color-accent);
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.main-nav a:hover::after, .main-nav a.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Search Bar */
.header-actions {
    display: flex;
    align-items: center;
}

.search-form { display: flex; }

.search-input {
    border: 1px solid #ccc;
    padding: 0.5rem 1rem;
    border-radius: 20px 0 0 20px;
    border-right: none;
    min-width: 250px;
}

.search-button {
    border: 1px solid #ccc;
    padding: 0.5rem 1rem;
    border-radius: 0 20px 20px 0;
    background-color: var(--color-light-gray);
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #e0e0e0;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    width: 30px;
    height: 21px;
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
    order: 2;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--color-primary); 
    border-radius: 3px;
    left: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.nav-toggle span:nth-child(1) { top: 0px; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

.nav-toggle.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* =========================================
   4. HOME & CATEGORY TILES
   ========================================= */
.category-nav-section {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.category-header-text {
    text-align: center;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 25px;
    font-family: var(--font-primary);
}

.category-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    justify-content: center;
}

.cat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, #0b3552 0%, #041421 100%);
    color: white !important;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    padding: 30px 10px;
    border-radius: 10px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.2);
    border: 1px solid #000;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.cat-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.5);
    filter: brightness(1.2);
    text-decoration: none;
}

/* =========================================
   5. PRODUCT GRID & FILTERS
   ========================================= */
.products-section, .bundles-section {
    padding: calc(var(--spacing) * 3) 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: calc(var(--spacing) * 2);
}

/* Product Card */
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-image {
    /* Zmiana z 4 / 3 na 1 / 1, aby pasowało do kwadratowych obrazków 400x400 */
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    /* Opcjonalnie: tło, jeśli masz przezroczyste PNG, żeby ładnie wyglądały */
    background-color: #ffffff; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card img {
    width: 100%;
    height: 100%;
    /* 'contain' upewnia się, że cały obrazek jest widoczny i nieprzycięty */
    object-fit: contain; 
    transition: transform 0.4s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
    flex-grow: 1;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.omni-price {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Filters (Collapsible) */
.collapsible-section {
    background-color: var(--color-light-gray);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.collapsible-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.collapsible-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.collapsible-header::-webkit-details-marker { display: none; }

.collapsible-header::after {
    content: '+';
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--color-price);
    background-color: var(--color-background);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.collapsible-section[open] > .collapsible-header::after {
    content: '−';
    transform: rotate(180deg);
    background-color: var(--color-price);
    color: var(--color-text-light);
    border-color: var(--color-price);
}

.collapsible-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.collapsible-content ul {
    list-style: none;
    padding: 1rem 0 0 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.collapsible-content li a {
    display: block;
    padding: 0.75rem 1rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
    text-align: center;
}

.collapsible-content li a:hover, .collapsible-content li a.active {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    border-color: var(--color-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: calc(var(--spacing) * 3);
    flex-wrap: wrap;
}

.page-btn {
    border: 1px solid #ddd;
    background-color: #fff;
    color: var(--color-secondary);
    min-width: 40px;
    height: 40px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    padding: 0 10px;
}

.page-btn:hover { background-color: var(--color-light-gray); }

.page-btn.active {
    background-color: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}

.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#no-results {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #888;
    grid-column: 1/-1;
}

/* =========================================
   6. PRODUCT DETAILS PAGE
   ========================================= */
.product-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-top: 2rem;
}

/* --- Left Column: Gallery --- */
.product-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-main-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    cursor: zoom-in;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.zoom-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.gallery-main-stage:hover .zoom-hint {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    background-color: #f0f0f0;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Right Column: Info --- */
.product-info-container h1 {
    margin-top: 0;
    font-size: 2rem;
    line-height: 1.2;
    color: #333;
}

.product-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.product-info-container .price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--color-price);
    margin: 1rem 0 0.5rem 0;
}

.product-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 2rem;
}

.product-tags {
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
    color: #555;
    border: 1px solid #ddd;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.tag:hover {
    background-color: var(--color-secondary);
    color: #fff;
    border-color: var(--color-secondary);
}

/* =========================================
   7. LIGHTBOX (ZOOM & FULLSCREEN)
   ========================================= */
.lightbox-modal {
    display: none; /* Domyślnie ukryty */
    position: fixed;
    z-index: 99999;
    padding: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    overflow: hidden; 
}

.lightbox-modal.active {
    display: flex; /* Pokazany przez JS */
}

/* Wrapper obrazka w lightboxie */
.lightbox-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto; /* Paski przewijania przy zoomie */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-in;
}

/* Obrazek w lightboxie - stan domyślny */
.lightbox-content {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    margin: auto;
}

/* Obrazek w lightboxie - stan POWIĘKSZONY */
.lightbox-content.zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
    margin: 0;
    transform: scale(1);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100001;
    background: rgba(0,0,0,0.3);
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    transition: background 0.3s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* =========================================
   8. FOOTER
   ========================================= */
.site-footer {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: calc(var(--spacing) * 3) 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-column h3 { 
    color: var(--color-text-light); 
    margin-bottom: var(--spacing); 
}

.footer-nav ul {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing) / 2);
}

.footer-nav a { 
    color: var(--color-text-light); 
    opacity: 0.8; 
}

.footer-nav a:hover { 
    opacity: 1; 
}

.copyright {
    text-align: center;
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #145a8b;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =========================================
   9. TEXT PAGES (404, About, Terms)
   ========================================= */
.text-page-section {
    padding: calc(var(--spacing) * 3) 0;
    max-width: 800px;
    margin: 0 auto;
}

.text-page-section h1 { text-align: center; margin-bottom: 2rem; }
.text-page-section ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.text-page-section li { margin-bottom: 0.5rem; }
.text-page-section p { margin-bottom: 1rem; }

.error-page-content {
    text-align: center;
    padding: 4rem 1rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

/* =========================================
   10. MEDIA QUERIES (RESPONSIVENESS)
   ========================================= */
@media (max-width: 1200px) {
    .main-nav ul { gap: 15px; }
}

@media (max-width: 992px) {
    .header-actions { 
        order: 3; 
        width: 100%; 
        margin-top: 15px; 
    }
    
    .nav-toggle { 
        display: block; 
    }

    .main-nav {
        order: 4;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #0d466f;
        padding: 80px 20px 20px;
        transform: translateY(-100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        border-bottom: 2px solid #145a8b;
    }
    
    .main-nav.nav--visible { 
        transform: translateY(0); 
    }

    .main-nav ul { 
        flex-direction: column; 
        align-items: center; 
        gap: 20px; 
    }
    
    .main-nav a { 
        color: var(--color-text-light); 
        font-size: 20px; 
    }
    
    .nav-toggle span { 
        background: var(--color-primary); 
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    
    .product-grid { grid-template-columns: 1fr; }
    
    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: center; 
    }
    
    .footer-nav ul { align-items: center; }
    
    /* Product Page Mobile */
    .product-details-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem; 
    }
    
    .gallery-thumbnails {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* Category Buttons Mobile */
    .category-buttons-grid {
        grid-template-columns: 1fr;
    }
    .cat-btn {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-input { min-width: 180px; }
}