/* Custom Bundle Builder — Global Floating Widget v1.0 */

/* ===== FLOATING CTA BUTTON (Sol Alt — Sabit) ===== */
.cbb-floating-cta {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: 99990 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px;
  padding: 14px 24px 14px 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 50px !important;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(99,102,241,0.45), 0 2px 8px rgba(0,0,0,0.2);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
  line-height: 1.2;
  letter-spacing: 0.3px;
}
.cbb-floating-cta:hover {
  max-width: none;
  box-shadow: 0 10px 35px rgba(99,102,241,0.6), 0 4px 12px rgba(0,0,0,0.25);
  transform: translateY(-3px) !important;
}
.cbb-floating-cta-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}
.cbb-floating-cta-text {
  opacity: 1;
  transform: none;
  transition: none;
  font-size: 14px;
  font-weight: 700;
}
.cbb-floating-cta:hover .cbb-floating-cta-text {
  opacity: 1;
  transform: none;
}
.cbb-floating-cta-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
  animation: cbb-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cbb-badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ===== FLOATING SUMMARY BUTTON (CTA Üstünde Yuvarlak) ===== */
.cbb-floating-summary-btn {
  position: fixed !important;
  bottom: 80px !important;
  left: 30px !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: 99991 !important;
  width: 50px;
  height: 50px;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #fff !important;
  border: 3px solid rgba(255,255,255,0.3) !important;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16,185,129,0.45), 0 2px 6px rgba(0,0,0,0.15);
  /* NOT: burada "!important" KULLANILMAZ — JS'in .hide()/.show() ile ürettiği
     inline "display:none" aksi halde ezilir ve buton set boşken de görünür kalır. */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 0;
  overflow: visible;
}
.cbb-floating-summary-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 24px rgba(16,185,129,0.6), 0 3px 10px rgba(0,0,0,0.2);
}
.cbb-floating-summary-btn.cbb-fsb-active {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  animation: cbb-fsb-pulse 2s infinite;
}
@keyframes cbb-fsb-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(16,185,129,0.45); }
  50% { box-shadow: 0 4px 24px rgba(16,185,129,0.7), 0 0 0 8px rgba(16,185,129,0.1); }
}
.cbb-fsb-icon {
  font-size: 22px;
  line-height: 1;
}
.cbb-fsb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  animation: cbb-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== FLOATING PANEL (Sol Alt — CTA Üzerinde) ===== */
.cbb-floating-panel {
  position: fixed;
  bottom: 140px;
  left: 24px;
  width: 360px;
  max-height: 520px;
  z-index: 99991;
  background: linear-gradient(180deg, #1a2332 0%, #0f172a 100%);
  border: 2px solid #334155;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cbb-panel-slide-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cbb-panel-slide-in {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Woodmart tema button override — panel içindeki butonları sıfırla */
.cbb-floating-panel button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Panel Header */
.cbb-fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #334155;
  background: rgba(255,255,255,0.03);
}
.cbb-fp-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cbb-fp-icon { font-size: 20px; }
.cbb-fp-count {
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.cbb-fp-close {
  width: 32px;
  height: 32px;
  border: none !important;
  background: rgba(255,255,255,0.08) !important;
  color: #94a3b8 !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}
.cbb-fp-close:hover {
  background: rgba(239,68,68,0.15) !important;
  color: #ef4444 !important;
}

/* Panel Body */
.cbb-fp-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-height: 100px;
  max-height: 260px;
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
}
.cbb-fp-body::-webkit-scrollbar { width: 4px; }
.cbb-fp-body::-webkit-scrollbar-track { background: transparent; }
.cbb-fp-body::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }

.cbb-fp-empty {
  text-align: center;
  padding: 24px 16px;
  color: #64748b;
}
.cbb-fp-empty span { font-size: 32px; display: block; margin-bottom: 8px; }
.cbb-fp-empty p { margin: 0; font-size: 13px; font-weight: 500; }

/* Panel Item */
.cbb-fp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.2s;
}
.cbb-fp-item:hover { background: rgba(255,255,255,0.04); }
.cbb-fp-item-img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #334155;
  background: #fff;
  flex-shrink: 0;
}
.cbb-fp-item-info {
  flex: 1;
  min-width: 0;
}
.cbb-fp-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.2s;
}
.cbb-fp-item-name:hover { color: #818cf8; text-decoration: underline; }
.cbb-fp-item-img { cursor: pointer; transition: opacity 0.2s; }
.cbb-fp-item-img:hover { opacity: 0.8; }
/* meta stili aşağıda inline qty ile birlikte tanımlanıyor */
.cbb-fp-item-remove {
  width: 28px;
  height: 28px;
  border: none !important;
  background: rgba(239,68,68,0.12) !important;
  color: #ef4444 !important;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none !important;
}
.cbb-fp-item-remove:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

/* Adet kontrolleri — meta satırı içinde inline */
.cbb-fp-item-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.cbb-fp-qty-btn {
  width: auto !important;
  height: auto !important;
  border: none !important;
  background: none !important;
  color: #94a3b8 !important;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  display: inline;
  padding: 0 2px !important;
  line-height: 1;
  transition: color 0.15s;
  box-shadow: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
}
.cbb-fp-qty-btn:hover {
  color: #818cf8 !important;
  background: none !important;
}
.cbb-fp-qty-val {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  display: inline;
}
/* Ürün adı linki */
a.cbb-fp-item-name {
  color: #f1f5f9 !important;
  text-decoration: none;
}
a.cbb-fp-item-name:hover {
  color: #818cf8 !important;
  text-decoration: underline;
}

/* Panel Footer */
.cbb-fp-footer {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  background: rgba(255,255,255,0.02);
}
.cbb-fp-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 15px;
  color: #94a3b8;
}
.cbb-fp-total strong {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.cbb-fp-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.cbb-fp-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cbb-fp-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.cbb-fp-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}
.cbb-fp-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.cbb-fp-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0 !important;
  border: 1px solid #334155;
}
.cbb-fp-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: #6366f1;
}
.cbb-fp-clear {
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}
.cbb-fp-clear:hover { color: #ef4444; }

/* ===== FLOATING PANEL TOGGLE (Sağ Alt) ===== */
.cbb-floating-panel-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99992;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(99,102,241,0.4), 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}
.cbb-floating-panel-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 35px rgba(99,102,241,0.5);
}
.cbb-fpt-icon { font-size: 24px; line-height: 1; }
.cbb-fpt-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}

/* ===== PRODUCT PAGE BUTTON ===== */
.cbb-product-set-btn-wrap {
  margin-top: 12px;
}
.cbb-product-set-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 24px !important;
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.cbb-product-set-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45) !important;
  color: #fff !important;
}
.cbb-product-set-btn span {
  font-size: 16px;
}

/* ===== WOODMART YAPIŞKAN SEPET BARI UYUMU =====
   Tema form.cart > * { flex: 1 1 100% } verdiği için set butonu barda ikinci
   satıra düşüp barın dışına taşıyordu. Geniş ekranda aynı satırda tutulur;
   1280px altında sığmadığı için gizlenir (yüzen "Set Oluştur" butonu görünür). */
.wd-sticky-btn .cbb-product-set-btn-wrap {
  flex: 0 0 auto;
  margin-top: 0 !important; /* satır içi margin-top: 10px'i ezer */
}
.wd-sticky-btn .cbb-product-set-btn { white-space: nowrap; }
@media (min-width: 1280px) {
  /* Sepet sütunu daralmasın; gerekirse ürün başlığı daralır (form taşmasın). */
  .wd-sticky-btn .wd-sticky-btn-cart { flex-shrink: 0; }
}
@media (max-width: 1279px) {
  .wd-sticky-btn .cbb-product-set-btn-wrap { display: none; }
}

/* Bar açıkken yüzen butonlar barın üstüne çıkar (çakışmasın). transform
   yukarıda !important ile kilitli olduğundan bağımsız translate kullanılır. */
body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-cta,
body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-summary-btn,
body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel-toggle,
body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { translate: 0 -80px; }
body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { max-height: min(520px, calc(100vh - 240px)); overflow-y: auto; }

@media (max-width: 1024px) {
  /* Tablet: bar alttaki araç çubuğunun (toolbar) üstünde durur. */
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-cta,
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-summary-btn,
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel-toggle,
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { translate: 0 -134px; }
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { max-height: min(520px, calc(100vh - 294px)); }
}
/* Kısa ekranlar (yatay telefon vb.): panel kaydırılıp kısaltılırsa alt butonları
   kırpılıyordu; panel eski konumunda kalır (barın üstünü örter). */
@media (min-width: 769px) and (max-height: 640px) {
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { translate: none; max-height: 520px; }
}
@media (max-width: 768px) {
  /* WhatsApp sipariş butonu da mobil barda ikinci satıra düşüp "Sepete Ekle"yi gizliyordu. */
  .wd-sticky-btn .wmwo-whatsapp-btn { display: none !important; }
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-cta,
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-summary-btn,
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel-toggle { translate: 0 -50px; }
  /* Mobilde panel alttan açılan tam genişlik sayfa; barın üstünü örtmesi doğal. */
  body:has(.wd-sticky-btn.wd-sticky-btn-shown) .cbb-floating-panel { translate: none; max-height: 70vh; }
}

/* Toast notification */
.cbb-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  padding: 14px 24px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(34,197,94,0.4);
  animation: cbb-toast-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}
.cbb-toast.cbb-toast-out {
  animation: cbb-toast-out 0.3s ease forwards;
}
@keyframes cbb-toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cbb-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* ===== RESPONSIVE =====
   NOT: Konumlandırma (top/right/bottom/left) burada TANIMLANMAZ.
   Konum ve boşluklar, Ayarlar > Floating Buton bölümünden yönetilir ve
   CBB_Global_Widget::build_inline_css() tarafından satır içi CSS olarak basılır.
   Burada sadece boyut/tipografi düzenlemeleri yer alır. */
@media (max-width: 768px) {
  .cbb-floating-cta {
    padding: 12px 18px 12px 14px;
    font-size: 13px;
    gap: 8px;
  }
  .cbb-floating-cta:hover {
    transform: none !important;
  }
  .cbb-floating-summary-btn {
    width: 44px;
    height: 44px;
  }
  .cbb-floating-panel {
    max-height: 70vh;
    border-bottom: none;
  }
  .cbb-floating-panel-toggle {
    width: 54px;
    height: 54px;
  }
}
