/* ============================================
   STRONA PRODUKTU — UKŁAD
============================================ */
.product-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* ============================================
   GALERIA
============================================ */
.product-gallery {
    width: 40%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

.product-gallery__main {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-bg2);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}


.product-gallery-main-wrapper {
    width: 100%;
    display: block;
}

/* ============================================
   INFORMACJE O PRODUKCIE
============================================ */
.product-info {
    flex: 1;
    max-width: 600px;

    align-self: stretch;            /* ← dopasowanie do wysokości galerii */
    display: flex;
    flex-direction: column;
    justify-content: center; /* ← tytuł u góry, price-box na dole */
}

.product-info h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.product-cta {
    display: inline-block;
    margin-top: 0.5rem;
    background: var(--color-accent);
    color: var(--color-bg);
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.product-cta:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

/* ============================================
   OPIS PRODUKTU
============================================ */
.product-description-section {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem; /* ← dopasowane do .product-page */
}

.product-description-section h2 {
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
}

.product-description-section p {
    line-height: 1.6;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* ============================================
   WŁAŚCIWOŚCI PRODUKTU
============================================ */
.product-properties {
    width: 100%;               /* ← kluczowe */
    max-width: 1200px;         /* ← ograniczenie szerokości */
    margin: 3rem auto;         /* ← centrowanie */
    padding: 1rem 2rem;        /* ← spójny padding z opisem */

    background: var(--color-bg2);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.product-properties li {
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);

    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.product-properties li:last-child {
    border-bottom: none;
}

.product-properties .prop-key {
    width: 140px;
    min-width: 140px;
    font-weight: 600;
    color: var(--color-accent-light);
}

.product-properties .prop-value {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.45;
}

/* ============================================
   SWIPER
============================================ */
.product-swiper-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 480px;
    border-radius: 12px;
    background: var(--color-bg2);
    border: 1px solid var(--color-border);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.product-swiper-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

/* ============================================
   SWIPER
============================================ */
/* ... (kod dla .product-swiper-main i jego img pozostaje bez zmian) ... */

.product-swiper-thumbs {
    margin: 0.8rem auto 0;     /* ← ZMIANA: Dodano auto po bokach dla centrowania całego kontenera */
    width: 100%;
    max-width: 520px;          /* ← KLUCZOWE: Blokada rozciągania. Pasek miniatur nie przekroczy 520px */
    overflow: hidden;          /* Swiper sam zarządza przewijaniem */
    scrollbar-width: none;
}

/* NOWOŚĆ: Definicja klasy, którą steruje JavaScript (centruje miniatury, gdy jest ich mało) */
.product-swiper-thumbs.is-centered .swiper-wrapper {
    justify-content: center;
}

.product-swiper-thumbs .swiper-wrapper {
    display: flex;
    gap: 10px;
}

.product-swiper-thumbs .swiper-slide {
    width: 70px !important;    
    height: 70px !important;
    flex-shrink: 0;            
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg2);
    overflow: hidden;
    cursor: pointer;
}

.product-swiper-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.3rem;
}

.product-swiper-thumbs .swiper-slide-thumb-active {
    border-color: var(--color-accent);
}

.product-swiper-thumbs.is-centered .swiper-wrapper {
    justify-content: center;
}

/* ============================================
   STRZAŁKI
============================================ */
.swiper-button-next,
.swiper-button-prev {
    color: var(--color-accent);
    width: 34px;
    height: 34px;

    top: 50%;
    transform: translateY(-50%);
    margin-top: 0 !important;

    background: none !important;

    font-weight: 900;
    font-size: 30px;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.6);
}

/* ============================================
   RESPONSYWNOŚĆ
============================================ */
@media (min-width: 1300px) {

    .product-page {
        display: grid;
        grid-template-columns: 55% 45%;
        gap: 4rem;
        align-items: start;
    }

    .product-gallery,
    .product-info {
        width: 100%;
        max-width: none;
    }
}

@media (min-width: 1500px) {

    .product-page {
        display: grid;
        grid-template-columns: 55% 45%;
        gap: 5rem;
        align-items: start;
    }

    .product-gallery,
    .product-info {
        width: 100%;
        max-width: none;
    }

    .product-swiper-main {
        max-height: clamp(620px, 50vw, 1100px);
    }

    .product-swiper-thumbs .swiper-slide {
        width: clamp(110px, 6vw, 170px) !important;
        height: clamp(110px, 6vw, 170px) !important;
    }

    .product-swiper-thumbs {
        max-width: 800px;
    }
}

@media (max-width: 1280px) {
    .product-description-section {
        max-width: 85%;
    }
}

@media (max-width: 1080px){
    .product-swiper-thumbs .swiper-slide {
        width: 65px !important;
        height: 65px !important;
    }
}

@media (max-width: 900px) {
    .product-page {
        flex-direction: column;
        max-width: 700px;
        padding: 1.5rem 3rem;
        gap: 1.5rem;
        align-items: center;
    }

    .product-info {
        flex: 1;
        max-width: 600px;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .product-info-inner {
        margin-top: 0; /* na mobile nie wyrównujemy do dołu */
    }

    .product-description-section {
        padding: 0 1rem;
    }

    .product-swiper-main {
        max-height: 350px;
        padding: 0;
    }

    .product-gallery {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 400px) {

    .product-description-section {
        padding: 0 1rem;
    }

    .product-info h1{
        font-size: 1.5rem;
    } 
}