/* ==========================================================================
   PLIK: css/style.css
   VERSION: SENIOR VIP HIGH-END (SEO & UX OPTIMIZED)
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    /* Main Palette */
    --primary-color: #FF6B6B;       /* Koralowy/Czerwony - Akcent */
    --primary-hover: #ff5252;
    --secondary-color: #4ECDC4;     /* Turkus - Uzupełnienie */
    
    /* Neutral Palette (High-End Dark Mode ready) */
    --dark-bg: #292f36;             /* Ciemny grafit */
    --text-color: #333333;          /* Główny tekst */
    --text-muted: #666666;          /* Opisy */
    --light-bg: #ffffff;            /* Tło kart */
    --site-bg: #f8f9fa;             /* Tło strony (bardzo jasny szary) */
    
    /* Branding */
    --amazon-orange: #FF9900;
    --amazon-orange-hover: #e68a00;

    /* Effects */
    --shadow-soft: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.1);
    --radius-std: 12px;
    --transition-fast: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--site-bg);
    -webkit-font-smoothing: antialiased; /* Premium font rendering */
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img, video {
    max-width: 100%;
    display: block;
    height: auto;
}

/* ==========================================================================
   2. VIP IMAGE HANDLING (SKELETON & PLACEHOLDERS)
   ========================================================================== */

/* Kontener zastępczy (Szary box z ikoną) */
.img-placeholder-wrapper {
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2; /* Nad uszkodzonym img */
    border-radius: inherit;
}

/* Ukrywanie uszkodzonego obrazka pod spodem */
img.img-error {
    opacity: 0;
    position: absolute; /* Żeby nie zajmował miejsca layoutu */
    pointer-events: none;
}

/* Animacja Skeleton (Shimmer Effect) */
.skeleton-loading {
    background: #f6f7f8;
    background-image: linear-gradient(
        to right,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-repeat: no-repeat;
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear forwards;
    min-height: 100%;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

/* ==========================================================================
   3. HEADER & NAVIGATION (Glassmorphism)
   ========================================================================== */
header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px); /* Efekt szkła */
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark-bg);
    letter-spacing: -0.5px;
}

.nav-links { 
    display: flex; 
    gap: 25px; 
    align-items: center; 
}

.nav-links a { 
    font-weight: 600; 
    font-size: 0.95rem;
    color: #555; 
}

.nav-links a:hover, 
.nav-links a.active { 
    color: var(--primary-color); 
}

/* ==========================================================================
   4. BUTTONS & CTA
   ========================================================================== */
.btn-view {
    display: block; 
    text-align: center; 
    background: var(--dark-bg); 
    color: #fff; 
    padding: 14px; 
    border-radius: 8px; 
    margin-top: 15px; 
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    transition: transform 0.2s, background 0.3s;
}

.btn-view:hover { 
    background: var(--primary-color); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.cta-button-small {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.cta-button-small:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.25);
}

.buy-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%; 
    background: var(--amazon-orange); 
    color: white; 
    padding: 18px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    border-radius: 8px; 
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.25);
    cursor: pointer;
    transition: var(--transition-fast);
}

.buy-btn:hover { 
    transform: translateY(-3px); 
    background: var(--amazon-orange-hover); 
    box-shadow: 0 8px 20px rgba(255, 153, 0, 0.35);
}

/* ==========================================================================
   5. LANDING & CATEGORIES
   ========================================================================== */
.hero {
    background-color: var(--light-bg);
    padding: 80px 5%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--dark-bg);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    max-width: 650px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.category-cards {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.cat-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    width: 280px;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: var(--transition-fast);
}

.cat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0,0,0,0.05);
}

.cat-icon { font-size: 2.5rem; margin-bottom: 15px; display: block; }
.cat-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--dark-bg);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}
.cat-btn:hover { background: var(--primary-color); }

/* ==========================================================================
   6. SHOP GRID (LISTING)
   ========================================================================== */
.shop-container {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 20px;
}

.shop-header { text-align: center; margin-bottom: 50px; }
.shop-header h1 { font-size: 2.5rem; margin-bottom: 10px; color: var(--dark-bg); }

#page-loader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.listing-toolbar {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form input {
    flex: 1 1 320px;
    min-height: 44px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 0.95rem;
}

.search-form button {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    border: 0;
    background: var(--dark-bg);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.search-form .clear-btn {
    background: #f1f1f1;
    color: #444;
}

.active-filter-label {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f4f6f8;
    color: #445;
    font-size: 0.82rem;
    font-weight: 600;
}

.listing-results-meta {
    margin-bottom: 20px;
    color: #667;
    font-size: 0.92rem;
    font-weight: 600;
}

#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    transition: opacity 0.3s;
}

.product-card {
    background: #fff;
    border-radius: var(--radius-std);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f4f4f4; /* Tło pod obrazkiem */
}

/* Obrazek w Gridzie */
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block;
}

.product-card:hover .product-image img:not(.img-error) {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark-bg);
    line-height: 1.4;
}

.product-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.product-tags-preview {
    color: #5e6473;
    font-size: 0.82rem;
    min-height: 22px;
    margin-bottom: 6px;
}

.listing-empty {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.price-tag {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: auto;
}

/* ==========================================================================
   7. PRODUCT DETAILS (VIP LAYOUT)
   ========================================================================== */
.product-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1.1fr; /* Lekko szersza prawa strona */
    gap: 50px;
    align-items: start;
}

/* Lewa Kolumna (Galeria) */
.gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: 100px;
}

.main-stage {
    width: 100%;
    aspect-ratio: 1/1;
    background: #fff;
    border-radius: var(--radius-std);
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    position: relative;
    background: #f9f9f9;
}

.gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Miniaturki */
.thumbnails {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.thumb-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #eee;
}

.thumb-wrapper.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15);
}

.thumb-wrapper:hover { opacity: 0.9; transform: translateY(-2px); }

.thumb-img { width: 100%; height: 100%; object-fit: cover; }

/* Prawa Kolumna (Info) */
.product-details h1 {
    font-size: 2.2rem;
    color: var(--dark-bg);
    margin-top: 0;
    line-height: 1.2;
    margin-bottom: 10px;
}

.price {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin: 15px 0 25px;
    letter-spacing: -0.5px;
}

.description-content {
    color: #444;
    font-size: 1.05rem;
    line-height: 1.8;
}

.description-content h2, .description-content h3 {
    font-size: 1.3rem;
    margin-top: 30px;
    color: var(--dark-bg);
    margin-bottom: 15px;
}

.description-content ul { padding-left: 20px; margin-bottom: 20px; }
.description-content li { margin-bottom: 8px; }

.product-tags-section {
    margin-top: 28px;
}

.product-tags-section h2 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--dark-bg);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #444;
    font-size: 0.84rem;
    font-weight: 600;
}

.tag-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.related-products-section {
    margin-top: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}

.related-card {
    display: block;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

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

.related-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f4f4f4;
}

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

.related-title {
    padding: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark-bg);
    line-height: 1.35;
}

/* ==========================================================================
   8. PAGINATION (Modern Soft Square)
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 60px 0 20px;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.page-btn.active {
    background: var(--dark-bg);
    color: #fff;
    border-color: var(--dark-bg);
    transform: scale(1.05);
    cursor: default;
}

.page-btn:disabled {
    border: none;
    background: transparent;
    color: #aaa;
    cursor: default;
    box-shadow: none;
}

/* ==========================================================================
   9. LIGHTBOX (Overlay)
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.92); /* Ciemniejszy, bardziej elegancki */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: 0.3s;
}

.close-lightbox:hover { color: var(--primary-color); transform: rotate(90deg); }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
footer {
    background: var(--dark-bg);
    color: #aaa;
    text-align: center;
    padding: 50px 20px;
    margin-top: 80px;
    font-size: 0.9rem;
}

footer p { margin-bottom: 10px; }
footer a { color: #ccc; text-decoration: underline; }
footer a:hover { color: #fff; }

/* ==========================================================================
   11. MEDIA QUERIES (Responsive)
   ========================================================================== */
@media (max-width: 900px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .gallery-wrapper {
        position: static; /* Wyłącz sticky na mobile */
    }

    .thumbnails {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .shop-header h1 { font-size: 2rem; }
    
    .page-btn { min-width: 38px; height: 38px; font-size: 0.9rem; }

    .listing-toolbar {
        padding: 12px;
    }

    .search-form input {
        flex-basis: 100%;
    }
}
