/* GENEL */
:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #e5e7eb;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Roboto', sans-serif; background-color: var(--bg-color); color: var(--text-color); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 15px; }

/* HEADER & FOOTER */
.site-header { background: #fff; border-bottom: 1px solid #ddd; padding: 15px 0; margin-bottom: 20px; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-footer { background: #1f2937; color: #fff; padding: 30px 0; margin-top: 50px; text-align: center; }

/* BREADCRUMB */
.breadcrumb-area { padding: 15px 0; font-size: 0.9rem; color: #6b7280; }
.breadcrumb-area ul { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb-area a:hover { text-decoration: underline; color: var(--theme-color); }

/* --- ANA GRID YAPISI --- */
.main-detail-container {
    display: grid;
    grid-template-columns: 600px minmax(0, 1fr); 
    gap: 50px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

/* --- SOL: GALERİ --- */
.detail-left { position: relative; }

.main-image-box {
    width: 100%;
    height: 550px;
    border: 1px solid #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    background: #fff;
    cursor: crosshair;
}

.main-image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

/* Zoom Butonu */
.zoom-icon {
    position: absolute; top: 15px; right: 15px; width: 45px; height: 45px;
    background: rgba(255, 255, 255, 0.9); border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #555; cursor: pointer; z-index: 10; transition: all 0.3s;
    border: 1px solid #eee; opacity: 0; transform: translateY(-10px);
}
.main-image-box:hover .zoom-icon { opacity: 1; transform: translateY(0); }
.zoom-icon:hover { background: var(--theme-color); color: #fff; border-color: var(--theme-color); }

.status-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(255, 255, 255, 0.9); color: #ef4444; padding: 10px 20px;
    font-weight: bold; border: 2px solid #ef4444; border-radius: 4px; pointer-events: none;
}

.thumb-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.thumb-item {
    width: 90px; height: 90px; border: 1px solid #eee; border-radius: 6px;
    cursor: pointer; opacity: 0.7; transition: .2s; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; padding: 5px;
}
.thumb-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-item:hover, .thumb-item.active { opacity: 1; border-color: var(--theme-color); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }

/* --- SAĞ: BİLGİLER --- */
.detail-right { display: flex; flex-direction: column; min-width: 0; }

.product-title, .short-desc, .product-meta span, .variant-section, .feature-item {
    overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; hyphens: auto;
}

.product-brand { font-size: 1rem; color: var(--theme-color); font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }
.product-title { font-size: 1.8rem; color: #1f2937; margin: 0 0 15px; line-height: 1.3; font-weight: 700; }

.avg-rating-box { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; cursor: pointer; width: fit-content; }
.avg-rating-box .stars { color: #f59e0b; font-size: 1.1rem; }
.avg-rating-box .count { font-size: 0.85rem; color: #64748b; font-weight: 600; text-decoration: underline; }
.avg-rating-box:hover .count { color: var(--theme-color); }

.product-meta {
    display: flex; gap: 20px; font-size: 0.85rem; color: #6b7280; margin-bottom: 20px; align-items: center; flex-wrap: wrap;
    border-bottom: 1px solid #f3f4f6; padding-bottom: 20px;
}
.stock-status { font-weight: 600; display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; }
.stock-status.in-stock { color: #15803d; background: #dcfce7; }
.stock-status.out-stock { color: #b91c1c; background: #fee2e2; }

/* FİYAT KUTUSU */
.price-wrapper { background: #fff; padding: 25px; border-radius: 12px; margin-bottom: 25px; border: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.price-row { display: flex; align-items: center; justify-content: flex-start; gap: 25px; }

.discount-box { background: #f97316; color: white; padding: 10px 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; min-width: 80px; border-radius: 8px; }
.discount-box .percent { font-size: 1.6rem; font-weight: 800; }
.discount-box .label { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }

.price-values { display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; }
.current { font-size: 2.5rem; font-weight: 800; color: var(--price-color); letter-spacing: -1.5px; }
.old { font-size: 1.3rem; color: #9ca3af; text-decoration: line-through; font-weight: 500; }

.short-desc { color: #4b5563; line-height: 1.6; margin-bottom: 25px; font-size: 0.95rem; }

/* 🎯 VARYANT VE İLİŞKİLİ ÜRÜNLER (YENİ SİSTEM) */
.variant-section { margin-bottom: 25px; }
.variant-section h4 { margin: 0 0 12px; font-size: 0.95rem; color: #374151; font-weight: 700; }

.variant-select-box {
    width: 100%; max-width: 450px; padding: 14px 20px; border: 2px solid #e2e8f0; border-radius: 12px;
    font-size: 1rem; font-weight: 600; color: #1e293b; background-color: #f8fafc; cursor: pointer; outline: none; transition: 0.3s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 18px; appearance: none;
}

.variant-list { display: flex; flex-wrap: wrap; gap: 12px; }
.variant-option {
    border: 2px solid #e2e8f0; border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; gap: 8px; transition: .3s cubic-bezier(0.4, 0, 0.2, 1); background: #fff; min-width: 85px; position: relative;
}
.variant-option:hover { border-color: #94a3b8; transform: translateY(-2px); }
.variant-option.selected { border-color: var(--theme-color); background: #fffaf5; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.variant-option.selected::after {
    content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; top: -8px; right: -8px; 
    background: #fff; color: var(--theme-color); font-size: 1.1rem; border-radius: 50%;
}
.variant-option.out-of-stock { opacity: 0.4; cursor: not-allowed; filter: grayscale(100%); }

a.related-option { text-decoration: none; color: inherit; }
a.related-option:hover { border-color: var(--theme-color); background: #fffaf5; transform: translateY(-2px); }

/* 🎯 MASAÜSTÜ: Dinamik İzgara (Grid) ve Dikey Kaydırma (Scroll) */
.related-products-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--related-cols), 1fr);
    gap: 12px;
}

.related-products-wrapper.has-scroll {
    /* Kankacım formül şu: Limit aşıldığında belirlenen satır kadar boy veririz, aşağı doğru scroll çıkar */
    max-height: calc(var(--scroll-row-desktop) * 115px); 
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* Scrollbar'ın kutulara çarpmasını engeller */
}

/* Scrollbar Zarifliği */
.related-products-wrapper.has-scroll::-webkit-scrollbar { width: 6px; }
.related-products-wrapper.has-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.v-thumb { width: 60px; height: 60px; border-radius: 8px; object-fit: contain; background: #f8fafc; margin-bottom: 3px; flex-shrink: 0; }
.v-name { font-size: 0.85rem; font-weight: 700; color: #334155; text-align: center; max-width: 100%; white-space: normal; padding: 0 5px; line-height: 1.2;}

/* 🎯 MOBİL: Izgara (Grid) ve Dikey Kaydırma (Aşağı Scroll) */
@media (max-width: 1000px) {
    .related-products-wrapper {
        grid-template-columns: repeat(var(--related-cols-mobile), 1fr);
        gap: 10px;
    }
    .related-products-wrapper .variant-option {
        flex-direction: column;
        align-items: center;
        padding: 8px;
        text-align: center;
        min-width: unset;
    }
    .related-products-wrapper .variant-option .v-name {
        margin-left: 0;
        font-size: 0.8rem;
    }
    
    /* Mobilde limit aşılırsa TİPik yatay değil, senin istediğin gibi aşağı/dikey scroll çalışır */
    .related-products-wrapper.has-scroll {
        display: grid; /* Flex'i silip Grid'i koruduk ki yan yana kutular durmaya devam etsin */
        overflow-y: auto; /* Dikey Scroll */
        overflow-x: hidden; /* Yatay kaymayı yasakladık */
        max-height: calc(var(--scroll-row-mobile) * 135px); /* Satır limitini mobilde uyguladık */
        padding-right: 5px;
    }
}

/* AKSİYON ALANI */
.action-bar-wrapper { margin-bottom: 30px; }
.qty-control-label { font-size: 0.85rem; font-weight: 800; margin-bottom: 10px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }

.action-bar { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }

.qty-box { display: flex; border: 2px solid #e2e8f0; border-radius: 10px; height: 55px; overflow: hidden; width: 140px; }
.qty-box button { width: 45px; border: none; background: #f8fafc; cursor: pointer; font-size: 1.3rem; font-weight: bold; color: #475569; transition: .2s; }
.qty-box button:hover { background: #f1f5f9; color: var(--theme-color); }
.qty-box input { width: 50px; border: none; text-align: center; font-size: 1.1rem; font-weight: 800; color: #1e293b; outline: none; }

.add-to-cart-btn {
    flex-grow: 2; height: 55px; border: none; background: var(--theme-color); color: var(--theme-text);
    font-size: 1.1rem; font-weight: 800; border-radius: 10px; cursor: pointer; transition: 0.3s;
    text-transform: uppercase; min-width: 200px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.add-to-cart-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.add-to-cart-btn.disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; transform: none !important; box-shadow: none; }

.buy-now-btn {
    flex-grow: 1; height: 55px; border: 2.5px solid var(--theme-color); background: #fff; color: var(--theme-color);
    font-size: 1.1rem; font-weight: 800; border-radius: 10px; cursor: pointer; transition: 0.3s; min-width: 160px;
}
.buy-now-btn:hover { background: var(--theme-color); color: var(--theme-text); }

.fav-btn-box {
    width: 55px; height: 55px; border: 2px solid #e2e8f0; background: #fff; border-radius: 10px;
    cursor: pointer; color: #94a3b8; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; transition: .3s;
}
.fav-btn-box:hover, .fav-btn-box.active { border-color: #e11d48; color: #e11d48; background: #fff1f2; }

/* YORUM SİSTEMİ */
.comment-section { max-width: 1000px; margin: 0 auto; padding-top: 10px; }
.comment-form-box { background: #f8fafc; border: 1px solid #e2e8f0; padding: 35px; border-radius: 20px; margin-bottom: 50px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.comment-form-box h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 25px; color: #1e293b; border-left: 5px solid var(--theme-color); padding-left: 15px; }

.comment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group.full-width { grid-column: 1 / -1; }

.comment-form-grid label { display: block; margin-bottom: 8px; font-weight: 700; color: #475569; font-size: 0.85rem; }
.comment-form-grid input, .comment-form-grid textarea { width: 100%; padding: 14px 18px; border: 1.5px solid #e2e8f0; border-radius: 12px; font-size: 0.95rem; outline: none; transition: 0.2s; background: #fff; }
.comment-form-grid input:focus, .comment-form-grid textarea:focus { border-color: var(--theme-color); box-shadow: 0 0 0 4px rgba(var(--theme-color-rgb), 0.1); }

.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 8px; font-size: 2rem; margin-top: 5px; }
.star-rating input { display: none; }
.star-rating label { cursor: pointer; color: #e2e8f0; transition: 0.2s; }
.star-rating label:hover, .star-rating label:hover ~ label, .star-rating input:checked ~ label { color: #f59e0b; }

.btn-comment-submit { background: #1e293b; color: #fff; border: none; padding: 18px 40px; border-radius: 12px; font-weight: 800; cursor: pointer; transition: 0.3s; margin-top: 15px; font-size: 1rem; }
.btn-comment-submit:hover { background: #000; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.comment-locked-msg { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 25px; border-radius: 16px; font-weight: 700; text-align: center; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 1rem; }

.comment-item { padding: 30px 0; border-bottom: 1.5px solid #f1f5f9; animation: fadeIn 0.5s ease; }
.comment-item:last-child { border-bottom: none; }
.comment-meta { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.comment-stars { color: #f59e0b; font-size: 1rem; letter-spacing: 2px; }
.comment-user { font-weight: 800; color: #1e293b; font-size: 1rem; }
.comment-date { color: #94a3b8; font-size: 0.8rem; font-weight: 500; }
.comment-body { color: #475569; line-height: 1.7; font-size: 1.05rem; font-style: italic; background: #fafafa; padding: 20px; border-radius: 0 15px 15px 15px; border-left: 4px solid #e2e8f0; }

.no-comment-msg { text-align: center; color: #94a3b8; font-style: italic; padding: 40px; border: 2.5px dashed #f1f5f9; border-radius: 20px; font-size: 1.1rem; }

/* TABLAR VE ÖZELLİKLER */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-top: 1px solid #f1f5f9; padding-top: 25px; margin-top: 15px; }
.feature-item { display: flex; align-items: center; gap: 15px; background: #f8fafc; padding: 15px; border-radius: 12px; border: 1px solid #f1f5f9; }
.feature-item i { font-size: 1.8rem; opacity: 0.8; }
.feature-item strong { display: block; font-size: 0.9rem; color: #1e293b; margin-bottom: 2px; }
.feature-item span { font-size: 0.8rem; color: #64748b; }

.tabs-container { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; margin-bottom: 50px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.tabs-head { display: flex; border-bottom: 1px solid #f1f5f9; background: #f8fafc; scrollbar-width: none; }
.tabs-head::-webkit-scrollbar { display: none; }
.tab-btn { padding: 20px 45px; border: none; background: transparent; cursor: pointer; font-size: 1rem; font-weight: 700; color: #64748b; border-bottom: 4px solid transparent; transition: all 0.3s; white-space: nowrap; }
.tab-btn:hover { color: #1e293b; background: #f1f5f9; }
.tab-btn.active { color: var(--theme-color); border-bottom-color: var(--theme-color); background: #fff; }

.tabs-body { padding: 45px; line-height: 1.9; color: #334155; font-size: 1.05rem; min-height: 300px; }

.tab-content { display: none; visibility: hidden; opacity: 0; height: 0; overflow: hidden; } 
.tab-content.active { display: block; visibility: visible; opacity: 1; height: auto; overflow: visible; animation: tabFade 0.4s ease; }

@keyframes tabFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mt-40 { margin-top: 40px; }

/* MOBİL AYARLAR EKRAN DÜZENLEMESİ */
@media (max-width: 1000px) {
    .main-detail-container { grid-template-columns: 1fr; padding: 20px; gap: 35px; }
    .main-image-box { height: 450px; }
    .thumb-item { width: 75px; height: 75px; }
}

@media (max-width: 900px) {
    .main-image-box { height: 380px; }
    .product-title { font-size: 1.6rem; }
    .current { font-size: 2.1rem; }
    .feature-grid { grid-template-columns: 1fr; gap: 12px; }
    .action-bar { gap: 10px; }
    .add-to-cart-btn, .buy-now-btn { width: 100%; flex-grow: 1; height: 50px; }
    .qty-box { width: 100%; justify-content: center; }
    .tab-btn { padding: 15px 25px; font-size: 0.95rem; flex: 1; }
    .tabs-body { padding: 25px; }
    .comment-form-grid { grid-template-columns: 1fr; }
    .comment-form-box { padding: 20px; }
}

/* HAFTANIN FIRSATLARI BÖLÜMÜ */
.firsat-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 768px) { .firsat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }