/* Product Detail Modern Styles */

/* Base: font ailesini main.css'den devral */
.product-detail {
  font-family: inherit;
}

.pd-container {
  /* main.css'deki .w-container ile uyumlu dar container */
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px; /* sabit header üstünde içerik görünmesi için üst padding */
}

/* Breadcrumb */
.pd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
  margin-bottom: 16px;
}
.pd-breadcrumb a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s;
}
.pd-breadcrumb a:hover {
  color: #2196f3;
}
.pd-breadcrumb .current {
  color: #1a1a1a;
  font-weight: 600;
}
.pd-breadcrumb .pd-nav-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.pd-breadcrumb .nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  text-decoration: none;
  transition: background 0.3s, box-shadow 0.3s;
}
.pd-breadcrumb .nav-btn:hover {
  background: #f2f2f2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Grid - sol görsel daha geniş, sağ bilgi daha dar */
.pd-grid {
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 16px; /* sağ/sol aradaki boşluğu azalt */
  align-items: start;
  max-width: 1100px;
  margin: 0 auto; /* Ortala: grid bloğunu container içinde merkezle */
}
.pd-right {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
/* Left gallery - thumbnail'leri ana görselin altına taşı */
.pd-left {
  /* Desktop: dikey thumbnail sütunu + ana görsel */
  display: grid;
  grid-template-columns: 90px 1fr; /* küçük resimleri ana görsele yaklaştır */
  gap: 8px; /* iç boşlukları biraz azalt */
  align-items: start;
}

/* Sütun yerleşimleri */
.pd-thumbs { grid-column: 1; grid-row: 1; }
.pd-main { grid-column: 2; grid-row: 1; }

/* Main image - daha da küçült */
.pd-main {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 350px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center; /* sağ tarafta kalan boşluğu azalt, görseli ortala */
  overflow: hidden;
  background: #f3f4f6;
 
}
/* Görsel doğal boyutunda, taşarsa kısıtlama ile küçült, kendi arka planı ve radius olsun */
.pd-main img {
  width: auto;
  height: auto;
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  background: #f8f8f8;
  border-radius: 12px;
}
.zoom-btn {
  position: absolute;
  right: 45px;
  bottom: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.3s;
}
.zoom-btn:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Hover Zoom Lens */
.pd-main img { cursor: crosshair; }
.zoom-lens {
  position: absolute;
  width: 220px; /* daha geniş zoom alanı */
  height: 220px; /* daha geniş zoom alanı */
  border-radius: 50%;
  border: 1px solid #d1d5db;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  display: none; /* hover’da gösterilecek */
  background-repeat: no-repeat;
}



.thumbs-container {
  /* Dikey kolon: üstte/ altta nav, ortada liste */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px; /* thumbnail arası boşluğu azalt */
  width: 90px; /* sütunu daralt */
  max-width: none;
  margin: 0;
}

.thumbs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  max-height: 340px; /* 3-4 thumbnail görünür */
  overflow-y: auto;
  padding: 4px 0;
}

.pd-thumb {
  width: 72px;
  height: 72px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-thumb:hover {
  border-color: #007bff;
  transform: scale(1.05);
}


.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-nav {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: #666;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.thumb-nav:hover:not(:disabled) {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.thumb-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f5f5f5;
}

/* Dikey yön okları için dönüş */
#thumbPrev { transform: rotate(90deg); }
#thumbNext { transform: rotate(270deg); }

/* Right info - daha kompakt */
.pd-title {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px;
}

.pd-icons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pd-icons .icon-list {
  display: flex;
  gap: 6px;
}
.pd-icons .icon {
  width: 100%;
  object-fit: contain;
  padding: 3px;
}
.energy-badge {
  background: #2ecc71;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

/* Specs table - daha kompakt */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.spec-table tr {
  height: 40px;
  border-bottom: 1px solid #e8e8e8;
}
.spec-table td {
  padding: 0 8px;
  font-size: 13px;
}
.spec-table .name {
  font-weight: 500;
  color: #555;
}
.spec-table .value {
  text-align: right;
  color: #1a1a1a;
}

/* Meta */
.pd-meta {
  margin-top: 12px;
  color: #666;
  font-size: 14px;
  display: grid;
  gap: 4px;
}
.pd-meta strong {
  font-weight: 700;
  color: #444;
}

/* Details head + buttons */
.pd-details {
  margin-top: 32px;
}
.pd-details .details-head {
  text-align: center;
  font-size: 16px;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 14px;
}
.pd-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-primary {
  background: #2196f3;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(33, 150, 243, 0.15);
  transition: all 0.3s;
  font-size: 13px;
}
.btn-primary:hover {
  filter: brightness(0.95);
  box-shadow: 0 8px 22px rgba(33, 150, 243, 0.22);
}

/* Accordion overrides for spacing */
.pd-accordion .accordion-item {
  border-color: #e0e0e0;
}
.pd-accordion .accordion-header {
  background: #f8f9fa;
}
.pd-accordion .accordion-item.active .accordion-header {
  background: #eef6ff; /* yumuşak mavi, anasayfa tonuna daha yakın */
  border-bottom-color: #cfe1ff;
}
/* Aktif başlıkta metin rengini beyaza çekmeyelim, okunabilir olsun */
.pd-accordion .accordion-item.active .accordion-header { color: #1a1a1a; }

/* Accordion ikon ve içerik boşlukları */
.pd-accordion .accordion-icon { color: #3b82f6; }
.pd-accordion .accordion-content > div { padding: 16px; }

/* Responsive */
@media (max-width: 1024px) {
  .pd-grid {
    grid-template-columns: 1fr;
  }
  .pd-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .thumbs-container {
    flex-direction: row;
    width: auto;
    margin: 0 auto;
  }
  .thumbs-wrapper {
    flex-direction: row;
    max-height: none;
    overflow-y: visible;
  }
  #thumbPrev, #thumbNext { transform: none; }
}

@media (max-width: 768px) {
  .pd-container {
    padding: 100px 16px 32px;
  }
  .pd-main {
    min-height: 300px;
  }
  .pd-title {
    font-size: 24px;
  }
  .pd-thumb {
    width: 65px;
    height: 65px;
  }
  .pd-thumbs .thumbs-container {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .pd-main {
    min-height: 280px;
  }
  .pd-title {
    font-size: 22px;
  }
  .btn-primary {
    width: 100%;
    text-align: center;
  }
  .pd-thumb {
    width: 60px;
    height: 60px;
  }
  .pd-thumbs .thumbs-container {
    max-width: none;
  }
}

/* Zoom Modal */
.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.zoom-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
}

.zoom-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.zoom-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.zoom-close:hover {
  background: #f5f5f5;
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive zoom modal */
@media (max-width: 768px) {
  .zoom-container {
    max-width: 95vw;
    max-height: 85vh;
  }

  .zoom-close {
    top: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}
/* Ürün Kodu Tablosu (urun-table) */
.accordion-content .content-section {
  overflow-x: auto; /* İçerik genişlerse yatay kaydırma sağlar */
}

.urun-table {
  border-collapse: collapse;
  table-layout: auto; /* İçeriğe göre sütun genişliği */
  width: 100%; /* Dar olsa bile tam genişlik kaplasın */
  max-width: 100%; /* Taşma olursa container yatay scroll ile çözer */
}

.urun-table thead th,
.urun-table tbody td {
  border: 1px solid #e8e8e8;
  padding: 8px 10px; /* Varsayılan boşluk: yazı bitişinden ~10px */
  vertical-align: middle;
}

.urun-table thead th {
  text-align: left; /* Başlıklar sola hizalı */
  font-weight: 600;
  color: #1a1a1a;
  background: #f9f9f9;
  /* min-width kaldırıldı: sütunlar içerik kadar olsun */
}

.urun-table tbody td {
  text-align: left; /* Hücreler de sola hizalı, tutarlı görünüm */
}

/* Hücre içeriği başlıktan genişse sütun genişler; metin tek satır kalsın */
.urun-table thead th,
.urun-table tbody td {
  white-space: nowrap;
}

/* Ürün Kodu Tablosu: dinamik genişlik ve daha doğal sarma davranışı */
.pd-accordion .urun-table th:first-child,
.pd-accordion .urun-table td:first-child {
  width: auto !important; /* main.css’teki sabit genişliği kaldır */
}
.pd-accordion .urun-table tbody td:nth-child(1) { white-space: nowrap; }
.pd-accordion .urun-table tbody td:nth-child(2),
.pd-accordion .urun-table tbody td:nth-child(3) { white-space: normal; }

/* Uzun içeriklerde taşma yerine yatay kaydırma kullanımı için görsel limitleri */
.urun-table td img {
  height: 1.5em !important; /* biraz daha büyük görünüm */
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 4px;
  display: inline-block !important; /* inline kalsın; inline style blok gelse bile ez */
  vertical-align: middle; /* metin ortasına hizala */
  margin-left: 6px; /* metin ve görsel arasında boşluk */
  object-fit: contain;
}

/* Geçmişte kaydedilmiş tablolarda gizli birleşik hücreleri gizle */
.urun-table td[data-merged-hidden="true"],
.product-code-table table td[data-merged-hidden="true"] {
  display: none;
}

/* Sınıfı olmayan ürün kodu tabloları için genel kural */
.product-code-table table td img {
  height: 1.5em !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  display: inline-block !important;
  vertical-align: middle;
  object-fit: contain;
}

/* Modern tablo görünümü: daha rafine stil */
.pd-accordion .product-code-table {

  padding: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.pd-accordion .urun-table {
  border-collapse: separate;
  border-spacing: 0;
}

/* Ürün kodu tablosu: sınıf yoksa genel table için de uygula */
.pd-accordion .product-code-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.pd-accordion .product-code-table table thead th {
  background: #f8fafc;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
}
.pd-accordion .product-code-table table tbody td { border-bottom: 1px solid #e5e7eb; }
.pd-accordion .product-code-table table tbody tr:nth-child(even) td { background: #f9fafb; }
.pd-accordion .product-code-table table tbody tr:hover td { background: #f1f5f9; }

.pd-accordion .urun-table thead th {
  background: #f8fafc;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
}

.pd-accordion .urun-table tbody td { border-bottom: 1px solid #e5e7eb; }
.pd-accordion .urun-table tbody tr:nth-child(even) td { background: #f9fafb; }
.pd-accordion .urun-table tbody tr:hover td { background: #f1f5f9; }

/* Container genişledikçe padding artsın; daraldıkça küçülsün */
@container codeTable (min-width: 1000px) {
  .urun-table thead th,
  .urun-table tbody td { padding: 12px 16px; }
  .product-code-table table thead th,
  .product-code-table table tbody td { padding: 12px 16px; }
}

@container codeTable (min-width: 700px) and (max-width: 999px) {
  .urun-table thead th,
  .urun-table tbody td { padding: 10px 12px; }
  .product-code-table table thead th,
  .product-code-table table tbody td { padding: 10px 12px; }
}

@container codeTable (max-width: 699px) {
  .urun-table thead th,
  .urun-table tbody td { padding: 6px 8px; }
  .product-code-table table thead th,
  .product-code-table table tbody td { padding: 6px 8px; }
}

/* Media query fallback: container queries desteklenmezse padding dinamik kalsın */
@media (min-width: 1000px) {
  .pd-accordion .product-code-table thead th,
  .pd-accordion .product-code-table tbody td,
  .pd-accordion .urun-table thead th,
  .pd-accordion .urun-table tbody td { padding: 12px 16px; }
}

@media (min-width: 700px) and (max-width: 999px) {
  .pd-accordion .product-code-table thead th,
  .pd-accordion .product-code-table tbody td,
  .pd-accordion .urun-table thead th,
  .pd-accordion .urun-table tbody td { padding: 10px 12px; }
}

@media (max-width: 699px) {
  .pd-accordion .product-code-table thead th,
  .pd-accordion .product-code-table tbody td,
  .pd-accordion .urun-table thead th,
  .pd-accordion .urun-table tbody td { padding: 6px 8px; }
}
