/* ==========================================================================
   SiteTimi Kurumsal Tema, Buton, Popup ve Ürün Sayfası Harmonizasyon Stili
   Sürüm: 2026.11.07-v2 (Kusursuz Hizalama, Centered & Scrollable Popups)
   ========================================================================== */

/* --- 1. POPUP & MODAL HARMONIZATION (KUSURSUZ MERKEZLEME VE KAYDIRMA) --- */
html.popup-open,
body.popup-open {
  overflow: hidden !important;
}

.popup-wrapper,
div[class*="popup-wrapper"] {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important; /* flex-start prevents negative top cutoff bug! */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 40px 15px !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
  background: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
  -webkit-overflow-scrolling: touch !important;
}

html.popup-open .popup-wrapper,
html.popup-open div[class*="popup-wrapper"] {
  opacity: 1 !important;
  visibility: visible !important;
}

.popup-container {
  margin: auto !important; /* Margin auto inside flex centers both vertically & horizontally safely */
  max-width: 620px !important;
  width: 100% !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45) !important;
  position: relative !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  z-index: 1000000 !important;
  flex-shrink: 0 !important;
}

html.popup-open .popup-container {
  transform: scale(1) !important;
}

.popup-body {
  border-radius: 16px !important;
  overflow: hidden !important;
}

.popup-inner-body {
  overflow-y: auto !important;
  max-height: calc(90vh - 60px) !important;
}

/* Modal Kapatma Butonu */
.popup-close,
.popup-container .btn.popup-close,
button.popup-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #334155 !important;
  font-size: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 1000005 !important;
  transform: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
  padding: 0 !important;
}

.popup-close::before,
.popup-container .btn.popup-close::before,
button.popup-close::before {
  content: '×' !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: block !important;
  color: #334155 !important;
}

.popup-close:hover,
.popup-container .btn.popup-close:hover,
button.popup-close:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  transform: rotate(90deg) !important;
}

.popup-close:hover::before,
.popup-container .btn.popup-close:hover::before,
button.popup-close:hover::before {
  color: #ffffff !important;
}

.popup-bg,
div[class*="popup-bg"] {
  display: none !important;
}

/* Bülten Pop-up İçi Form Düzenlemesi */
.module-newsletter .newsletter-form .input-group {
  display: flex !important;
  gap: 8px !important;
  margin-top: 15px !important;
}

.module-newsletter .newsletter-email {
  height: 46px !important;
  border-radius: 10px !important;
  border: 1.5px solid #cbd5e1 !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  flex: 1 !important;
}

.module-newsletter .btn-primary {
  height: 46px !important;
  line-height: 46px !important;
  padding: 0 22px !important;
  border-radius: 10px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  border: none !important;
}


/* --- 2. ÜRÜN SAYFASI DÜZENİ (GRID & RESİM DENGESİ) --- */
.route-product-product:not(.popup) .product-info,
div[class*="product-info"] {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  width: 100% !important;
  margin-top: 15px !important;
  margin-bottom: 35px !important;
  clear: both !important;
}

@media (min-width: 992px) {
  .route-product-product:not(.popup) .product-info .product-left,
  div[class*="product-info"] .product-left {
    width: 46% !important;
    max-width: 540px !important;
    flex: 0 0 46% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .route-product-product:not(.popup) .product-info .product-right,
  div[class*="product-info"] .product-right {
    width: 51% !important;
    flex: 0 0 51% !important;
    padding-left: 20px !important;
    margin: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .route-product-product:not(.popup) .product-info .product-left,
  div[class*="product-info"] .product-left {
    width: 48% !important;
    flex: 0 0 48% !important;
    padding: 0 !important;
  }

  .route-product-product:not(.popup) .product-info .product-right,
  div[class*="product-info"] .product-right {
    width: 50% !important;
    flex: 0 0 50% !important;
    padding-left: 15px !important;
  }
}

@media (max-width: 767px) {
  .route-product-product:not(.popup) .product-info .product-left,
  div[class*="product-info"] .product-left,
  .route-product-product:not(.popup) .product-info .product-right,
  div[class*="product-info"] .product-right {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
  }
}

/* Ürün Görseli Sınırlandırması (Kocaman taşmasını önleme) */
.product-image .main-image {
  max-width: 100% !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  position: relative !important;
}

.product-image .main-image img,
.product-image .main-image .swiper-slide img {
  max-height: 480px !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  display: block !important;
}

.product-image .additional-images {
  margin-top: 12px !important;
}

.product-image .additional-image {
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.2s ease !important;
}

.product-image .additional-image:hover,
.product-image .additional-image.swiper-slide-active {
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2) !important;
}


/* --- 3. ÜRÜN SEÇENEKLERİ (OPTIONS) DÜZENİ --- */
.product-options {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin: 20px 0 !important;
}

.product-options .options-title,
.product-options h3.title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: block !important;
}

.product-options .form-group {
  margin-bottom: 14px !important;
}

.product-options .control-label {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
  display: inline-block !important;
}

.product-options select.form-control {
  height: 42px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  font-size: 14px !important;
  color: #1e293b !important;
  padding: 0 12px !important;
  max-width: 320px !important;
}

/* Renk / Push Buton Seçenekleri */
div[class*="product-option-radio"] > div,
.product-option-radio > div {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
}

div[class*="product-option-radio"] .radio,
.product-option-radio .radio {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
}

div[class*="product-option-radio"] .radio label,
.product-option-radio .radio label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  cursor: pointer !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
}

div[class*="product-option-radio"] .radio label:hover,
.product-option-radio .radio label:hover {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
}

div[class*="product-option-radio"] .radio input:checked + label,
div[class*="product-option-radio"] .radio label:has(input:checked) {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25) !important;
}

div[class*="product-option-radio"] img,
.product-option-radio img {
  border-radius: 4px !important;
  width: 24px !important;
  height: 24px !important;
  object-fit: cover !important;
}


/* --- 4. BUTON GRUBU HARMONİZASYONU (SABİT DÜZENLİ, ORANTILI SIRALAMA) --- */
.product-details .button-group-page,
.route-product-product:not(.popup) .product-info .product-details .button-group-page,
.button-group-page {
  position: static !important;
  width: 100% !important;
  z-index: 10 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 0 0 0 !important;
  margin: 15px 0 !important;
}

/* Ana Sepet & Buton Satırı */
.product-details .cart-group,
.button-group-page .cart-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 15px 0 12px 0 !important;
  padding: 0 !important;
  clear: both !important;
}

/* Adet Seçici (48px Yükseklik, Modern Input + Butonlar) */
.cart-group .quantity-group,
.button-group-page .stepper,
.quantity-group {
  display: inline-flex !important;
  align-items: center !important;
  height: 48px !important;
  width: auto !important;
  min-width: 105px !important;
  max-width: 125px !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cart-group .quantity-group input#input-quantity,
.cart-group .quantity-group input.form-control,
.button-group-page .stepper input {
  height: 48px !important;
  line-height: 48px !important;
  width: 65px !important;
  text-align: center !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 0 0 6px !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.cart-group .quantity-group span {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 38px !important;
  height: 48px !important;
  border-left: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
}

.cart-group .quantity-group span i {
  height: 24px !important;
  line-height: 24px !important;
  width: 100% !important;
  text-align: center !important;
  font-size: 13px !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.cart-group .quantity-group span i:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Ana "Sepete Ekle" Butonu (48px Yükseklik, Mavi Gradient) */
.cart-group #button-cart,
.cart-group .btn-cart,
.button-group-page .btn-cart,
#button-cart {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 48px !important;
  line-height: 48px !important;
  padding: 0 24px !important;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex: 1 1 auto !important;
  min-width: 150px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.cart-group #button-cart:hover,
.cart-group .btn-cart:hover,
.button-group-page .btn-cart:hover,
#button-cart:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45) !important;
  transform: translateY(-1px) !important;
  color: #ffffff !important;
}

.cart-group #button-cart .btn-text,
.cart-group .btn-cart .btn-text,
#button-cart .btn-text {
  color: #ffffff !important;
}

/* Yardımcı İşlemler Grubu (Hemen Al + Soru Sorun) */
.cart-group .extra-group,
.button-group-page .extra-group,
.extra-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-wrap: wrap !important;
}

.cart-group .extra-group .btn-extra,
.button-group-page .extra-group .btn-extra,
.btn-extra {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 48px !important;
  line-height: 48px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

/* Hemen Al (Zümrüt Yeşili) */
.cart-group .extra-group .btn-extra[data-quick-buy],
.cart-group .extra-group .btn-1-extra,
.btn-extra[data-quick-buy],
.btn-1-extra {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

.cart-group .extra-group .btn-extra[data-quick-buy]:hover,
.cart-group .extra-group .btn-1-extra:hover,
.btn-extra[data-quick-buy]:hover,
.btn-1-extra:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
  transform: translateY(-1px) !important;
  color: #ffffff !important;
}

.cart-group .extra-group .btn-extra[data-quick-buy] .btn-text,
.cart-group .extra-group .btn-1-extra .btn-text {
  color: #ffffff !important;
}

/* Soru Sorun (Açık Gri / Outline) */
.cart-group .extra-group .btn-extra[href*="open_popup"],
.cart-group .extra-group .btn-2-extra,
.btn-extra[href*="open_popup"],
.btn-2-extra {
  background: #f8fafc !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}

.cart-group .extra-group .btn-extra[href*="open_popup"]:hover,
.cart-group .extra-group .btn-2-extra:hover,
.btn-extra[href*="open_popup"]:hover,
.btn-2-extra:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

.cart-group .extra-group .btn-extra[href*="open_popup"] .btn-text,
.cart-group .extra-group .btn-2-extra .btn-text {
  color: #334155 !important;
}

/* Satır 2: Favori ve Karşılaştırma Butonları */
.product-details .wishlist-compare,
.button-group-page .wishlist-compare,
.wishlist-compare {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 6px 0 20px 0 !important;
  padding: 0 !important;
  flex-wrap: wrap !important;
}

.wishlist-compare .btn-wishlist,
.wishlist-compare .btn-compare {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 40px !important;
  line-height: 40px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  text-decoration: none !important;
  flex: 0 1 auto !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

.wishlist-compare .btn-wishlist .btn-text,
.wishlist-compare .btn-compare .btn-text {
  color: #475569 !important;
}

.wishlist-compare .btn-wishlist:hover {
  color: #e11d48 !important;
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  transform: translateY(-1px) !important;
}

.wishlist-compare .btn-wishlist:hover .btn-text {
  color: #e11d48 !important;
}

.wishlist-compare .btn-compare:hover {
  color: #0284c7 !important;
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  transform: translateY(-1px) !important;
}

.wishlist-compare .btn-compare:hover .btn-text {
  color: #0284c7 !important;
}


/* --- 5. VİTRİN VE KATEGORİ ÜRÜN KARTLARI (GRID) --- */
.product-thumb {
  border-radius: 12px !important;
  border: 1px solid #f1f5f9 !important;
  background: #ffffff !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden !important;
}

.product-thumb:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.12) !important;
  border-color: #e2e8f0 !important;
}

.product-thumb .image {
  overflow: hidden !important;
}

.product-thumb .image img {
  transition: transform 0.4s ease !important;
}

.product-thumb:hover .image img {
  transform: scale(1.04) !important;
}

.product-thumb .caption {
  padding: 14px 16px !important;
}

.product-thumb .name a {
  font-weight: 600 !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  color: #1e293b !important;
  transition: color 0.2s ease !important;
}

.product-thumb .name a:hover {
  color: #0ea5e9 !important;
}

.product-thumb .price {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  margin-top: 6px !important;
  margin-bottom: 10px !important;
}

.product-thumb .button-group {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 14px 14px 14px !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

.product-thumb .button-group .btn-cart {
  flex-grow: 1 !important;
  height: 40px !important;
  line-height: 40px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 14px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.product-thumb .button-group .btn-cart:hover {
  transform: translateY(-1px) !important;
}

.product-thumb .button-group .btn-wishlist,
.product-thumb .button-group .btn-compare {
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.product-thumb .button-group .btn-wishlist:hover {
  color: #e11d48 !important;
  background: #ffe4e6 !important;
  border-color: #fecdd3 !important;
}

.product-thumb .button-group .btn-compare:hover {
  color: #0284c7 !important;
  background: #e0f2fe !important;
  border-color: #bae6fd !important;
}

/* --- 6. HEADER SEPET & ARAMA BUTONLARI --- */
#cart .cart-heading {
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}

.count-badge {
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 2px 7px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}


/* === PRODUCT CARD BUTTON GROUP: SEPETE EKLE + HEART ICON SIDE-BY-SIDE === */
.product-thumb .buttons-wrapper {
  width: 100% !important;
  box-sizing: border-box !important;
}
.product-thumb .button-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.product-thumb .image .button-group {
  padding: 8px 10px !important;
}
.product-thumb .button-group .cart-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  clear: none !important;
  gap: 6px !important;
}
.product-thumb .button-group .cart-group .btn-cart {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.product-thumb .button-group .wish-group {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
  clear: none !important;
  gap: 6px !important;
}
.product-thumb .button-group .wish-group .btn-wishlist,
.product-thumb .button-group .wish-group .btn-compare {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}
