/**
 * Ürün detay sayfası – modern iki sütun düzen
 * Referans görünüm: sol galeri (sticky), sağ bilgi; telif içermez, özgün stil.
 */

/* Değişkenler (referans palet, özgün değerler) */
body.single-product {
    --pr-mw: 1200px;
    --pr-heading: #222222;
    --pr-text: #696969;
    --pr-text-light: #878787;
    --pr-price: #222222;
    --pr-price-sale: #ec0101;
    --pr-accent: #fc7f03;
    --pr-btn-bg: #222222;
    --pr-btn-hover: #fc7f03;
    --pr-border: #dddddd;
    --pr-radius: 15px;
    --pr-btn-radius: 40px;
}

body.single-product,
body.single-product.woocommerce {
    overflow-x: hidden;
}

/* Sayfa sarmalayıcıları – gereksiz yükseklik birikimini önle (sonsuz scroll) */
body.single-product .single-product-fullwidth,
body.single-product main.single-product-main {
    min-height: 0;
}

/* ========== ANA YAPI ========== */
body.single-product .pr-page {
    width: 100%;
    padding: 0;
    margin: 0;
}

body.single-product .pr-main {
    width: 100%;
    max-width: var(--pr-mw);
    margin: 0 auto;
    padding: 24px 20px 48px;
    box-sizing: border-box;
}

body.single-product .pr-container {
    width: 100%;
    min-width: 0;
}

/* Sticky için üst elemanlarda overflow engellenmesin */
body.single-product .single-product-fullwidth,
body.single-product main.single-product-main,
body.single-product main,
body.single-product .container,
body.single-product .pr-row,
body.single-product .pr-page {
    overflow: visible !important;
}

body.single-product .pr-main {
    overflow-x: hidden;
    overflow-y: visible;
}

/* ========== İKİ SÜTUN ========== */
.pr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

/* ========== SOL: GALERİ ========== */
.pr-gallery-wrap {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pr-gallery-sticky {
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .pr-gallery-sticky {
        position: sticky;
        top: 80px;
    }
}

@media (max-width: 768px) {
    .pr-gallery-sticky {
        position: relative;
        top: auto;
    }
}

/* WooCommerce galeri – kolon içinde, taşma yok */
.pr-gallery-sticky .woocommerce-product-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.pr-gallery-sticky .woocommerce-product-gallery__wrapper,
.pr-gallery-sticky .woocommerce-product-gallery__image {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
}

.pr-gallery-sticky .woocommerce-product-gallery__image a {
    display: block;
    max-width: 100%;
}

.pr-gallery-sticky .woocommerce-product-gallery__image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: var(--pr-radius);
    background: #f5f5f5;
    object-fit: contain;
}

.pr-gallery-sticky .woocommerce-product-gallery__image:first-child img {
    min-height: 280px;
    object-fit: cover;
}

/* ========== SWİPER GALERİ – TEK KUTU, GÖRSEL ORTADA VE DÜZGÜN (Swiper CSS’ten sonra geçerli olsun) ========== */
body.single-product .pr-gallery-sticky .kutay-gallery-main,
body.single-product .pr-gallery-sticky .kutay-gallery-main.swiper {
    width: 100%;
    min-height: 320px;
    height: clamp(320px, 50vw, 560px);
    position: relative;
    border-radius: var(--pr-radius);
    overflow: hidden;
    background: #f5f5f5;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .swiper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .swiper-wrapper {
    height: 100% !important;
    min-height: 100% !important;
    box-sizing: border-box;
}
body.single-product .pr-gallery-sticky .woocommerce-product-gallery {
    opacity: 1 !important;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .swiper-slide {
    height: 100% !important;
    min-height: 100% !important;
    box-sizing: border-box;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .kutay-gallery-slide-inner {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .kutay-gallery-slide-inner a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
}
body.single-product .pr-gallery-sticky .kutay-gallery-main .kutay-gallery-slide-inner img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: var(--pr-radius);
    display: block !important;
    margin: auto !important;
}

/* Thumbnail Swiper (JS ile eklenen) – yükseklik sınırı, sonsuz scroll önleme */
.pr-gallery-sticky .kutay-gallery-thumbs {
    max-height: 88px;
    min-height: 0;
}

/* Thumbnail listesi */
.pr-gallery-sticky .flex-control-thumbs,
.pr-gallery-sticky .woocommerce-product-gallery .flex-control-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pr-gallery-sticky .flex-control-thumbs li {
    margin: 0;
}

.pr-gallery-sticky .flex-control-thumbs li img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, border-color 0.2s;
}

.pr-gallery-sticky .flex-control-thumbs li img:hover,
.pr-gallery-sticky .flex-control-thumbs li img.flex-active {
    opacity: 1;
    border-color: var(--pr-accent);
}

/* İndirim etiketi */
.pr-gallery-sticky .onsale {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    background: var(--pr-price-sale);
    color: #fff;
    border-radius: 6px;
}

/* ========== SAĞ: BİLGİ ========== */
.pr-info-wrap {
    min-width: 0;
}

.pr-info-inner.summary.entry-summary {
    padding: 0;
}

/* Başlık */
.pr-info-inner .product_title {
    font-size: 25px;
    font-weight: 600;
    color: var(--pr-heading);
    margin: 0 0 12px;
    line-height: 1.25;
}

/* Fiyat */
.pr-info-inner .price {
    font-size: 22px;
    font-weight: 400;
    color: var(--pr-price);
    margin-bottom: 16px;
    display: block;
}

.pr-info-inner .price del {
    font-size: 16px;
    color: var(--pr-text-light);
    margin-right: 8px;
}

.pr-info-inner .price ins {
    text-decoration: none;
    color: var(--pr-price-sale);
}

/* Kısa açıklama */
.pr-info-inner .woocommerce-product-details__short-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--pr-text);
    margin-bottom: 20px;
}

.pr-info-inner .woocommerce-product-details__short-description p:last-child {
    margin-bottom: 0;
}

/* Stok */
.pr-info-inner .stock {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 14px;
}

.pr-info-inner .stock.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.pr-info-inner .stock.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* Varyasyonlar – referans: “Ölçü / Kalınlık” blokları, buton hissi */
.pr-info-inner .variations {
    margin-bottom: 20px;
    border: none;
}

.pr-info-inner .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.pr-info-inner .variations label {
    font-weight: 500;
    color: var(--pr-heading);
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.pr-info-inner .variations .value {
    display: block;
}

.pr-info-inner .variations select {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--pr-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pr-heading);
}

.pr-info-inner .reset_variations {
    font-size: 13px;
    color: var(--pr-text-light);
    margin-top: 8px;
    display: inline-block;
}

.pr-info-inner .reset_variations:hover {
    color: var(--pr-accent);
}

/* Sepete ekle formu */
.pr-info-inner form.cart {
    margin-top: 24px;
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pr-info-inner form.cart .quantity {
    margin: 0;
}

.pr-info-inner form.cart .quantity input.qty {
    width: 80px;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid var(--pr-border);
    border-radius: 8px;
    text-align: center;
}

/* Sepete ekle butonu – tam genişlik, yuvarlak */
.pr-info-inner form.cart .single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--pr-btn-radius);
    background: var(--pr-btn-bg);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    min-height: 52px;
}

.pr-info-inner form.cart .single_add_to_cart_button:hover {
    background: var(--pr-btn-hover);
    color: #fff;
}

.pr-info-inner form.cart .single_add_to_cart_button:active {
    transform: scale(0.98);
}

.pr-info-inner form.cart .single_add_to_cart_button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Ürün meta (SKU, kategoriler) */
.pr-info-inner .product_meta {
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--pr-border);
    font-size: 13px;
    color: var(--pr-text-light);
}

.pr-info-inner .product_meta > span {
    display: block;
    margin-bottom: 6px;
}

.pr-info-inner .product_meta a {
    color: var(--pr-accent);
    text-decoration: none;
}

.pr-info-inner .product_meta a:hover {
    text-decoration: underline;
}

/* Rating */
.pr-info-inner .woocommerce-product-rating {
    margin-bottom: 12px;
}

/* Özel seçenekler (tema/eklenti) */
.pr-info-inner .kutay-product-options-wrapper {
    margin-bottom: 16px;
}

/* ========== ALT: TABLAR VE İLİŞKİLİ ÜRÜNLER ========== */
.pr-page .woocommerce-tabs {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--pr-border);
    width: 100%;
    max-width: var(--pr-mw);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.pr-page .woocommerce-tabs ul.tabs {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--pr-border);
}

.pr-page .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--pr-text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

/* Tab butonlarında turuncu focus çerçevesi olmasın */
.pr-page .woocommerce-tabs ul.tabs li a:focus,
.pr-page .woocommerce-tabs ul.tabs li a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.pr-page .woocommerce-tabs ul.tabs li.active a {
    color: var(--pr-heading);
    border-bottom-color: var(--pr-accent);
}

.pr-page .woocommerce-tabs .panel {
    padding: 0 0 24px;
}

.pr-page .woocommerce-tabs .panel h2 {
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--pr-heading);
}

.pr-page .related.products,
.pr-page .upsells {
    margin-top: 48px;
    width: 100%;
    max-width: var(--pr-mw);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.pr-page .related.products h2,
.pr-page .upsells h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--pr-heading);
}

.pr-page .related ul.products,
.pr-page .upsells ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pr-page .related ul.products li.product,
.pr-page .upsells ul.products li.product {
    margin: 0;
}

.pr-page .related ul.products li.product img,
.pr-page .upsells ul.products li.product img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--pr-radius);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    body.single-product .pr-main {
        padding: 20px 16px 40px;
    }

    .pr-row {
        gap: 32px;
    }

    .pr-page .related ul.products,
    .pr-page .upsells ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body.single-product .pr-main {
        padding: 16px 14px 32px;
    }

    .pr-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pr-gallery-wrap {
        order: 0;
    }

    .pr-info-wrap {
        order: 1;
    }

    .pr-info-inner .product_title {
        font-size: 22px;
    }

    .pr-info-inner .price {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .pr-info-inner form.cart {
        flex-direction: column;
        align-items: stretch;
    }

    .pr-info-inner form.cart .quantity {
        width: 100%;
    }

    .pr-info-inner form.cart .quantity input.qty {
        max-width: 120px;
        width: 100%;
        box-sizing: border-box;
    }

    .pr-info-inner form.cart .single_add_to_cart_button {
        min-width: 0;
        width: 100%;
    }

    .pr-gallery-sticky .flex-control-thumbs li img {
        width: 56px;
        height: 56px;
    }

    .pr-gallery-sticky .woocommerce-product-gallery__image:first-child img {
        min-height: 240px;
    }

    .pr-page .woocommerce-tabs {
        margin-top: 36px;
        padding-top: 24px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .pr-page .related.products,
    .pr-page .upsells {
        padding-left: 14px;
        padding-right: 14px;
    }

    .pr-page .related ul.products,
    .pr-page .upsells ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .pr-page .related ul.products li.product img,
    .pr-page .upsells ul.products li.product img {
        height: 160px;
    }
}

@media (max-width: 480px) {
    body.single-product .pr-main {
        padding: 14px 12px 28px;
    }

    .pr-info-inner .product_title {
        font-size: 20px;
    }

    .pr-info-inner .price {
        font-size: 18px;
    }

    .pr-page .related ul.products li.product img,
    .pr-page .upsells ul.products li.product img {
        height: 140px;
    }
}
