/* ================================================================
   social-engagement.css — Tilbe Home Cookie, Newsletter, Compare, Social Proof
   Kaynak: misc.css'den ayristirildi (FAZ 2.2)
   JS bagimliliklari: cookie-newsletter.js, page-enhancements.js
   Yukleme: global (lazy)
   ================================================================ */

/* ── Cookie Consent Banner (account.css'ten taşındı) ── */
/* ── Cookie Consent Banner — Trendyol-inspired ── */
.th-cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--th-z-toast);
  background: transparent;
  pointer-events: none;
  padding: var(--th-space-4);
  transform: translateY(110%);
  opacity: 0;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .4s ease;
}
.th-cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.th-cookie-inner {
  max-width: 480px;
  margin: 0 auto 0 0;
  background: var(--th-neutral-0);
  border-radius: var(--th-radius-2xl);
  padding: var(--th-space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--th-space-4);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--th-ink-900) 12%, transparent), 0 2px 8px color-mix(in srgb, var(--th-ink-900) 6%, transparent);
  border: 1px solid var(--th-neutral-100);
  backdrop-filter: blur(12px);
}
.th-cookie-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--th-green-50, var(--th-emerald-50));
  border-radius: var(--th-radius-xl);
  color: var(--th-color-primary);
}
.th-cookie-icon svg { width: 24px; height: 24px; }
.th-cookie-content { flex: 1; min-width: 0; }
.th-cookie-title {
  margin: 0 0 var(--th-space-0-5);
  font-size: var(--th-text-sm);
  font-weight: var(--th-font-bold);
  color: var(--th-neutral-900);
  letter-spacing: -0.01em;
}
.th-cookie-text {
  margin: 0 0 var(--th-space-3);
  font-size: var(--th-text-sm);
  line-height: 1.5;
  color: var(--th-neutral-500);
}
.th-cookie-text a {
  color: var(--th-color-primary);
  text-decoration: none;
  font-weight: var(--th-font-medium);
  transition: color .2s;
}
.th-cookie-text a:hover { color: var(--th-color-accent); text-decoration: underline; }
.th-cookie-actions {
  display: flex;
  gap: var(--th-space-2);
  width: 100%;
}
.th-cookie-accept {
  flex: 1;
  padding: var(--th-space-2-5) var(--th-space-5);
  background: var(--th-color-primary);
  color: var(--th-neutral-0);
  border: none;
  border-radius: var(--th-radius-lg);
  font-size: var(--th-text-sm);
  font-weight: var(--th-font-semibold);
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  letter-spacing: .01em;
}
.th-cookie-accept:hover {
  background: var(--th-green-700, var(--th-green-900));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--th-color-primary) 25%, transparent);
}
.th-cookie-accept:active { transform: translateY(0); }
.th-cookie-reject {
  flex: 1;
  padding: var(--th-space-2-5) var(--th-space-5);
  background: var(--th-neutral-50, var(--th-color-bg-page));
  color: var(--th-neutral-600);
  border: 1px solid var(--th-neutral-200);
  border-radius: var(--th-radius-lg);
  font-size: var(--th-text-sm);
  font-weight: var(--th-font-medium);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.th-cookie-reject:hover {
  background: var(--th-neutral-100);
  border-color: var(--th-neutral-300);
  transform: translateY(-1px);
}
.th-cookie-reject:active { transform: translateY(0); }

/* Desktop: yatay compact layout */
@media (min-width: 768px) {
  .th-cookie-banner { padding: var(--th-space-4) var(--th-space-6); }
  .th-cookie-inner { max-width: 520px; }
  .th-cookie-actions { width: auto; flex-shrink: 0; }
  .th-cookie-accept, .th-cookie-reject { flex: none; white-space: nowrap; }
}

/* Mobile */
@media (max-width: 768px) {
  .th-cookie-banner { padding: var(--th-space-3); }
  .th-cookie-inner {
    max-width: 100%;
    flex-wrap: wrap;
    padding: var(--th-space-4);
    border-radius: var(--th-radius-sm);
    gap: var(--th-space-2-5);
  }
  .th-cookie-icon { width: 36px; height: 36px; border-radius: var(--th-radius-lg); }
  .th-cookie-icon svg { width: 20px; height: 20px; }
  .th-cookie-content { flex-basis: calc(100% - 50px); }
  .th-cookie-actions { flex-basis: 100%; }
  .th-cookie-accept, .th-cookie-reject { padding: var(--th-space-2-5) var(--th-space-4); }
}

/* ── Newsletter Popup (account.css'ten taşındı) ── */
.th-nl-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--th-ink-900) 50%, transparent);
  z-index: calc(var(--th-z-modal) - 1);
  opacity: 0;
  pointer-events: none;
  transition: var(--th-transition-normal);
}
.th-nl-overlay.active { opacity: 1; pointer-events: auto; }
.th-nl-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--th-color-bg);
  border-radius: var(--th-radius-2xl);
  box-shadow: var(--th-shadow-2xl);
  z-index: var(--th-z-modal);
  width: 90%; max-width: 576px;
  padding: var(--th-space-8);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--th-transition-normal);
}
.th-nl-popup.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.th-nl-popup-close {
  position: absolute;
  top: var(--th-space-3); right: var(--th-space-3);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--th-color-bg-tertiary);
  border: none; border-radius: var(--th-radius-full);
  cursor: pointer; color: var(--th-color-text-muted);
  font-size: var(--th-text-md);
}
.th-nl-popup h3 { font-size: var(--th-text-xl); font-weight: var(--th-font-bold); margin-bottom: var(--th-space-2); }
.th-nl-popup p { font-size: var(--th-text-sm); color: var(--th-color-text-muted); margin-bottom: var(--th-space-5); }
.th-nl-popup-form { display: flex; gap: var(--th-space-2); }
.th-nl-popup-form input {
  flex: 1; padding: var(--th-space-3);
  border: 1px solid var(--th-color-border);
  border-radius: var(--th-radius-lg);
  font-size: var(--th-text-base);
}
.th-nl-popup-form button {
  padding: var(--th-space-3) var(--th-space-5);
  background: var(--th-btn-accent-bg);
  color: var(--th-btn-accent-text);
  border: none; border-radius: var(--th-radius-lg);
  font-weight: var(--th-font-semibold);
  cursor: pointer; white-space: nowrap;
}
.th-nl-popup-note { font-size: var(--th-text-2xs); color: var(--th-color-text-muted); margin-top: var(--th-space-3); }

/* ── Compare Bar (account.css'ten taşındı) ── */
.th-compare-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--th-color-bg);
  border-top: 1px solid var(--th-color-border);
  box-shadow: var(--th-shadow-lg);
  z-index: var(--th-z-sticky);
  padding: var(--th-space-3) var(--th-space-6);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--th-space-4);
}
.th-compare-bar.active { display: flex; }
.th-compare-items { display: flex; gap: var(--th-space-2); }
.th-compare-item {
  width: 56px; height: 56px;
  border-radius: var(--th-radius-lg);
  border: 2px solid var(--th-color-border);
  overflow: hidden; position: relative;
}
.th-compare-item img { width: 100%; height: 100%; object-fit: cover; }
.th-compare-item .remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: var(--th-color-danger); color: var(--th-color-text-inverse);
  border-radius: var(--th-radius-full);
  font-size: var(--th-text-xs-plus);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
}
.th-compare-btn {
  padding: var(--th-space-2) var(--th-space-5);
  background: var(--th-btn-primary-bg);
  color: var(--th-btn-primary-text);
  border: none; border-radius: var(--th-btn-radius);
  font-weight: var(--th-font-semibold);
  cursor: pointer;
}
.th-compare-clear { color: var(--th-color-text-muted); background: none; border: none; cursor: pointer; font-size: var(--th-text-sm); text-decoration: underline; }
.th-compare-bar__actions { display: flex; align-items: center; gap: var(--th-space-3); }
@media (max-width: 768px) {
  .th-compare-bar { flex-direction: column; padding: var(--th-space-2) var(--th-space-4); bottom: 64px; }
  .th-compare-item { width: 44px; height: 44px; }
}


/* ── Live Viewer Counter ("X kişi görüntülüyor") ── */
.th-live-viewers {
  display: inline-flex;
  align-items: center;
  gap: var(--th-space-1-5);
  font-size: var(--th-text-xs);
  color: var(--th-color-text-muted);
}
.th-live-viewers__dot {
  width: var(--th-space-2);
  height: var(--th-space-2);
  border-radius: var(--th-radius-full);
  background: var(--th-color-success);
  animation: th-live-pulse 2s ease-in-out infinite;
}
@keyframes th-live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.th-live-viewers__count {
  font-weight: var(--th-font-semibold);
  color: var(--th-color-text);
}

/* ── Social Proof Notification Toast ("Y kişi satın aldı") ── */
.th-social-toast {
  position: fixed;
  bottom: var(--th-space-6);
  left: var(--th-space-6);
  z-index: var(--th-social-proof-z);
  display: flex;
  align-items: center;
  gap: var(--th-space-3);
  padding: var(--th-social-proof-padding);
  background: var(--th-social-proof-bg);
  color: var(--th-social-proof-text);
  border-radius: var(--th-social-proof-radius);
  box-shadow: var(--th-social-proof-shadow);
  font-size: var(--th-social-proof-font);
  max-width: 340px;
  opacity: 0;
  transform: translateY(var(--th-space-4));
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.th-social-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.th-social-toast__img {
  width: var(--th-space-10);
  height: var(--th-space-10);
  border-radius: var(--th-radius-md);
  object-fit: cover;
  flex-shrink: 0;
}
.th-social-toast__info {
  flex: 1;
  min-width: 0;
}
.th-social-toast__name {
  font-weight: var(--th-font-semibold);
  color: var(--th-social-proof-accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.th-social-toast__action {
  font-size: var(--th-text-xs);
  color: var(--th-social-proof-text);
  opacity: 0.8;
}
.th-social-toast__time {
  font-size: var(--th-text-2xs);
  color: var(--th-social-proof-view-icon);
  margin-top: var(--th-space-0-5);
}
.th-social-toast__close {
  position: absolute;
  top: var(--th-space-2);
  right: var(--th-space-2);
  background: none;
  border: none;
  color: var(--th-social-proof-view-icon);
  font-size: var(--th-text-xs);
  cursor: pointer;
  padding: var(--th-space-1);
  opacity: 0;
  transition: opacity var(--th-transition-fast);
}
.th-social-toast:hover .th-social-toast__close {
  opacity: 1;
}

@media (max-width: 768px) {
  .th-social-toast {
    left: var(--th-space-3);
    right: var(--th-space-3);
    bottom: calc(var(--th-space-16) + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
}

/* ── Consistent Star Rating Component ── */
.th-stars {
  display: inline-flex;
  align-items: center;
  gap: var(--th-space-0-5);
  --th-star-size: var(--th-text-sm);
  --th-star-color: var(--th-color-accent);
  --th-star-empty: var(--th-neutral-300);
}
.th-stars i {
  font-size: var(--th-star-size);
  color: var(--th-star-empty);
}
.th-stars i.filled {
  color: var(--th-star-color);
}
.th-stars i.half {
  position: relative;
  color: var(--th-star-empty);
}
.th-stars i.half::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: var(--th-star-color);
}
.th-stars--lg {
  --th-star-size: var(--th-text-lg);
}
.th-stars--sm {
  --th-star-size: var(--th-text-xs);
}

/* ── Photo Review Incentive Banner ── */
.th-photo-review-cta {
  display: flex;
  align-items: center;
  gap: var(--th-space-3);
  padding: var(--th-space-3) var(--th-space-4);
  background: color-mix(in srgb, var(--th-color-accent) 6%, transparent);
  border: var(--th-border-width-default) solid color-mix(in srgb, var(--th-color-accent) 18%, transparent);
  border-radius: var(--th-radius-lg);
}
.th-photo-review-cta__icon {
  flex-shrink: 0;
  width: var(--th-space-10);
  height: var(--th-space-10);
  border-radius: var(--th-radius-full);
  background: color-mix(in srgb, var(--th-color-accent) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--th-text-lg);
  color: var(--th-color-accent);
}
.th-photo-review-cta__text {
  flex: 1;
  font-size: var(--th-text-sm);
  color: var(--th-color-text);
  line-height: var(--th-leading-normal);
}
.th-photo-review-cta__text strong {
  font-weight: var(--th-font-semibold);
  color: var(--th-color-accent);
}
.th-photo-review-cta__btn {
  flex-shrink: 0;
  padding: var(--th-space-2) var(--th-space-4);
  background: var(--th-color-accent);
  color: var(--th-neutral-0);
  border: none;
  border-radius: var(--th-radius-md);
  font-size: var(--th-text-sm);
  font-weight: var(--th-font-semibold);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--th-transition-fast);
}
.th-photo-review-cta__btn:hover {
  background: var(--th-orange-700);
  color: var(--th-neutral-0);
}

@media (max-width: 576px) {
  .th-photo-review-cta { flex-direction: column; text-align: center; }
  .th-photo-review-cta__btn { width: 100%; }
}

/* ── Reduced motion: FAZ 6.4 ── */
@media (prefers-reduced-motion: reduce) {
  .th-live-viewers__dot { animation: none; }
  .th-social-toast { transition: none; }
}
