/* ================== PRODUCT GALLERY SECTION ================== */
.product-gallery-section {
  padding: 80px 0;
}

/* ================== ANA LAYOUT - SOL ÜRÜN + SAĞ GALERİ ================== */
.product-gallery-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  align-items: start;
}

/* ================== SOL TARAF - ÜRÜN KARTI ================== */
.main-product-wrapper {
  position: sticky;
  top: 100px;
}

.product-card-main {
  background: var(--assistant-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.product-card-main .product-image {
  position: relative;
  height: 480px;
  overflow: hidden;
  background: var(--bg-color);
}

.product-card-main .product-image img {
  width: 100%;
  height: 100%;
  object-fit:cover;
}

.product-card-main .product-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 14px;
  background: var(--theme-color);
  color: #1e1e1e;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(196, 154, 56, 0.4);
  z-index: 2;
}

.product-image-toggle {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  padding: 5px 8px;
  border-radius: 30px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-toggle-img {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
}

.btn-toggle-img:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-toggle-img.active {
  background: var(--theme-color);
  color: #1e1e1e;
  box-shadow: 0 2px 10px rgba(196, 154, 56, 0.4);
}

.product-card-main .product-info {
  padding: 30px 25px;
}

.product-card-main .product-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--heading-color);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
  font-family: var(--heading-font);
}

.product-card-main .product-desc {
  font-size: 14px;
  color: var(--font-color);
  line-height: 1.6;
  margin: 0 0 22px;
  font-family: var(--body-font);
}

.product-card-main .product-features {
  margin-top: 20px;
  padding: 18px;
  background: rgba(196, 154, 56, 0.05);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* Ürün özellik satırları (etiket solda - değer sağda) */
.product-card-main .feature-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  gap: 12px;
}

.product-card-main .feature-row:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.product-card-main .feature-label {
  font-size: 11px;
  color: var(--font-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  flex-shrink: 0;
}

.product-card-main .feature-value {
  font-size: 12px;
  color: var(--heading-color);
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.4px;
}

/* ================== SAĞ TARAF - RENK KATALOĞU ================== */
.color-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.color-card {
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Her zaman KARE - genişlik ne olursa olsun */
.color-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.4s ease;
}

.color-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Renk ismi - kartın altında sade etiket */
.color-title {
  margin: 14px 0 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--heading-color);
  font-family: var(--heading-font);
}

/* HOVER */
.color-card:hover {
  transform: translateY(-6px);
}

.color-card:hover .color-thumb {
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.55);
}

.color-card:hover .color-bg {
  transform: scale(1.08);
}

/* ================== MODAL - ORTADA BEYAZ KART ================== */
.color-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 28, 24, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.color-modal.active {
  display: flex;
}

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

/* Beyaz kart — içindeki 800x800 görseli sadece ince bir boşlukla çerçeveler */
.modal-content-wrapper {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: var(--assistant-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-body-lens {
  display: flex;
  justify-content: center;
  width: 100%;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Görsel kutusu — tam 800x800. min() ile üç sınır aynı anda uygulanır:
   1) 800px (hedef boyut)  2) kartın iç genişliği (dar ekranda küçülür)
   3) 75vh (kısa pencerelerde taşmayı önler) — üçü de kare oranını (1:1)
   bozmadan çalışır, çünkü genişlik referans alınır, yükseklik ondan türer. */
.modal-image-wrapper {
  position: relative;
  width: min(800px, 100%, 75vh);
  aspect-ratio: 1 / 1;
  margin: 0 auto 18px;
}

.modal-image-crop {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-color);
}

.modal-image-crop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================== MERCEK (LENS) BÜYÜTME ================== */
/* Görselin üstünde imleci takip eden, içi hafif aydınlık kare.
   .modal-image-crop içinde olduğu için "spotlight" gölgesi sadece
   görselin sınırları içinde kalır, dışarı taşmaz. */
.modal-image-wrapper.has-magnifier {
  cursor: default;
}

.modal-image-wrapper.has-magnifier.magnifier-on {
  cursor: crosshair;
}

/* Mercek Aç/Kapa Düğmesi — görselin sol üst köşesinde */
.magnifier-toggle-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-color);
  color: var(--heading-color);
  font-size: 15px;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: all 0.3s ease;
}

.magnifier-toggle-btn:hover {
  background: var(--theme-color);
  color: #1e1e1e;
  transform: scale(1.06);
}

.magnifier-toggle-btn.active {
  background: var(--theme-color);
  color: #1e1e1e;
  box-shadow: 0 4px 16px rgba(196, 154, 56, 0.55);
}

.magnifier-toggle-btn.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid var(--assistant-color);
}

.img-lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  border: 2px solid var(--theme-color);
  border-radius: 6px;
  pointer-events: none;
  display: none;
  z-index: 3;
}

/* Büyütülmüş görüntünün çıktığı panel — artık modala/görsele göre değil,
   imlece göre konumlanan BAĞIMSIZ/yüzen bir panel (position: fixed).
   JS tarafından <body>'ye taşınır ve fare hareketiyle takip eder;
   böylece modalın 800x800 çerçevesini genişletmeye gerek kalmaz. */
.modal-zoom-result {
  position: fixed;
  top: 0;
  left: 0;
  width: 440px;
  height: 440px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-color);
  background-repeat: no-repeat;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  display: none;
  z-index: 100000;
  pointer-events: none;
}

/* Merceği sadece fare ile kullanılabilecek geniş ekranlarda göster;
   dokunmatik / dar ekranlarda görsel sade haliyle kalır */
@media (max-width: 991px) {
  .img-lens,
  .modal-zoom-result,
  .magnifier-toggle-btn {
    display: none !important;
  }
}



/* Renk başlığı */
.modal-color-title {
  position: relative;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--heading-color);
  font-family: var(--heading-font);
  margin: 0 0 18px;
}

.modal-color-title::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 0 auto 12px;
  background: var(--theme-color);
}

/* Kapat butonu - kartın sağ üstünde */
.modal-close-btn {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--heading-color);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-close-btn:hover {
  background: var(--theme-color);
  color: #1e1e1e;
  transform: rotate(90deg);
  box-shadow: 0 6px 18px rgba(196, 154, 56, 0.45);
}

/* Önceki / Sonraki - kartın altında ortada */
.modal-nav {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.modal-nav-btn {
  width: 46px;
  height: 46px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--heading-color);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.modal-nav-btn:hover {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #1e1e1e;
  box-shadow: 0 4px 15px rgba(196, 154, 56, 0.4);
}

.modal-nav-btn:active {
  transform: scale(0.95);
}

/* ================================================================
   RESPONSIVE  (kareler aspect-ratio ile otomatik ölçeklenir)
   ================================================================ */

/* Large Desktop - 1400px+ */
@media (min-width: 1400px) {
  .color-gallery-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
  }
}

/* Desktop - 1200px */
@media (max-width: 1200px) {
  .product-gallery-layout {
    grid-template-columns: 360px 1fr;
    gap: 32px;
  }

  .color-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .color-title {
    font-size: 0.95rem;
    letter-spacing: 0.8px;
  }
}

/* Tablet - 991px : HÂLÂ 2 SÜTUN, ürün kolonu daraltıldı (banner olmasın) */
@media (max-width: 991px) {
  .product-gallery-section {
    padding: 60px 0;
  }

  .product-gallery-layout {
    grid-template-columns: 300px 1fr;
    gap: 28px;
  }

  .color-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .product-card-main .product-image {
    height: 320px;
  }

  .product-card-main .product-info {
    padding: 24px 20px;
  }

  .product-card-main .product-name {
    font-size: 20px;
  }

  .product-card-main .product-desc {
    font-size: 13px;
  }
}

/* Geçiş aralığı - 820px : ürün kolonunu biraz daha daralt */
@media (max-width: 820px) {
  .product-gallery-layout {
    grid-template-columns: 260px 1fr;
    gap: 24px;
  }
}

/* Telefon - 767px : TEK SÜTUN, ürün kartı ORTALANIP sınırlandı */
@media (max-width: 767px) {
  .product-gallery-section {
    padding: 50px 0;
  }

  .product-gallery-layout {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .main-product-wrapper {
    position: relative;
    top: 0;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }

  .color-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .color-title {
    font-size: 0.9rem;
    letter-spacing: 0.6px;
  }

  .product-card-main .product-image {
    height: 320px;
  }

  /* Modal - telefonda hâlâ dar */
  .modal-content-wrapper {
    max-width: 460px;
  }

  .modal-color-title {
    font-size: 1.3rem;
  }
}

/* Küçük telefon - 480px */
@media (max-width: 480px) {
  .product-gallery-section {
    padding: 40px 0;
  }

  .color-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .color-title {
    font-size: 0.82rem;
    letter-spacing: 0.4px;
  }

  .product-card-main .product-image {
    height: 280px;
  }

  .product-card-main .product-info {
    padding: 22px 18px;
  }

  .product-card-main .product-name {
    font-size: 18px;
  }

  /* Modal */
  .modal-content-wrapper {
    padding: 14px;
    border-radius: 16px;
  }

  .modal-image-wrapper {
    width: min(800px, 100%, 48vh);
    margin-bottom: 14px;
  }

  .modal-color-title {
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
  }

  .modal-close-btn {
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .modal-nav-btn {
    width: 44px;
    height: 44px;
  }
}

/* Keyboard Navigation */
.modal-nav-btn:focus,
.modal-close-btn:focus {
  outline: 2px solid var(--theme-color);
  outline-offset: 4px;
}

/* Print */
@media print {
  .color-modal {
    display: none;
  }
}

/* Smooth Transitions */
.color-card,
.color-bg {
  will-change: transform;
}