/* ============================================================
   Vitrin: "Bizi takip edin" şeridi ve sabit WhatsApp düğmesi
   Views/Shared/_SocialFollow.cshtml, _WhatsAppFab.cshtml
   ============================================================ */

/* ---------- Bizi takip edin ---------- */
.sfollow {
  --sf-accent: #F26722; --sf-r: 14px; --sf-ink: #15181C; --sf-muted: #5B636D;
  --sf-line: rgba(15, 23, 42, .1); --sf-tile: #fff; --sf-panel: #F7F8FA;
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(200px, 280px) 1fr; align-items: center; gap: 18px 32px;
  margin: 0 0 40px; padding: 22px 24px; border-radius: calc(var(--sf-r) + 6px);
  background: var(--sf-panel); border: 1px solid var(--sf-line); color: var(--sf-ink);
}
.sfollow::before {
  content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; left: -120px; top: -190px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--sf-accent) 28%, transparent), transparent);
  pointer-events: none;
}
.sfollow__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sf-accent);
}
.sfollow__kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.sfollow .sfollow__head p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--sf-muted); }

.sfollow__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.sfollow__list li { flex: 1 1 180px; max-width: 260px; min-width: 0; }
.sfollow__item {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 9px 14px 9px 9px; border-radius: var(--sf-r);
  background: var(--sf-tile); border: 1px solid var(--sf-line); color: inherit; text-decoration: none;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s, background-color .25s;
}
.sfollow__icon {
  flex: none; width: 42px; height: 42px; border-radius: calc(var(--sf-r) - 3px);
  display: grid; place-items: center; color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  transition: background-color .25s, color .25s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.sfollow__icon.has-img { background: none; }
.sfollow__icon img { display: block; width: 32px; height: 32px; object-fit: contain; }
.sfollow__text { display: grid; min-width: 0; line-height: 1.2; }
.sfollow__text b { font-size: 14px; font-weight: 700; }
.sfollow__text small {
  margin-top: 3px; font-size: 12px; color: var(--sf-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sfollow__go { flex: none; margin-left: auto; opacity: .35; transition: opacity .25s, transform .25s; }

.sfollow__item:hover, .sfollow__item:focus-visible {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--c) 80%, transparent);
}
.sfollow__item:hover .sfollow__icon:not(.has-img), .sfollow__item:focus-visible .sfollow__icon:not(.has-img) { background: var(--c); color: #fff; }
.sfollow__item:hover .sfollow__icon { transform: scale(1.06) rotate(-4deg); }
.sfollow__item:hover .sfollow__go, .sfollow__item:focus-visible .sfollow__go { opacity: 1; transform: translate(2px, -2px); color: var(--c); }
.sfollow__item:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* Koyu alt bilgiler (isg, tul) */
.sfollow--isg, .sfollow--tul {
  --sf-ink: #fff; --sf-muted: rgba(255, 255, 255, .62);
  --sf-line: rgba(255, 255, 255, .12); --sf-tile: rgba(255, 255, 255, .04);
  --sf-panel: linear-gradient(120deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
}
.sfollow--isg .sfollow__icon:not(.has-img), .sfollow--tul .sfollow__icon:not(.has-img) {
  background: color-mix(in srgb, var(--c) 20%, transparent); color: color-mix(in srgb, var(--c) 55%, #fff);
}
.sfollow--isg .sfollow__item:hover, .sfollow--tul .sfollow__item:hover { background: rgba(255, 255, 255, .08); }

/* İş güvenliği teması: turuncu vurgu, sert köşeler */
.sfollow--isg { --sf-accent: var(--orange, #F0801F); --sf-r: 8px; margin: var(--s10, 40px) 0 0; }
.sfollow--isg + .footer-top { padding-top: var(--s10, 40px); }
/* Tül teması */
.sfollow--tul { --sf-accent: #E26C8D; --sf-r: 16px; margin-top: 2rem; }
/* Varsayılan tema */
.sfollow--default { --sf-accent: var(--accent, #B34324); }

@media (max-width: 760px) {
  .sfollow { grid-template-columns: 1fr; padding: 18px 16px; gap: 14px; }
  .sfollow__list { gap: 8px; }
  .sfollow__list li { flex: 1 1 calc(50% - 4px); max-width: none; }
  .sfollow__item { gap: 10px; padding: 8px 10px 8px 8px; }
  .sfollow__icon { width: 36px; height: 36px; }
  .sfollow__icon svg { width: 19px; height: 19px; }
  .sfollow__icon img { width: 28px; height: 28px; }
  .sfollow__go { display: none; }
}
@media (max-width: 360px) { .sfollow__list li { flex-basis: 100%; } }

/* ---------- Sabit WhatsApp düğmesi ---------- */
.wa-fab {
  --wa: #25D366; --wa-dark: #128C4A; --wa-bottom: 20px;
  position: fixed; right: 20px; bottom: calc(var(--wa-bottom) + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: #0B3D1F;
  -webkit-tap-highlight-color: transparent; transition: bottom .35s cubic-bezier(.2, .8, .2, 1);
}
.wa-fab__btn { position: relative; width: 62px; height: 62px; flex: none; }
.wa-fab__face {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 32% 26%, #6CF29A 0%, var(--wa) 46%, var(--wa-dark) 100%);
  box-shadow: 0 12px 28px -8px rgba(18, 140, 74, .75), 0 0 0 3px rgba(255, 255, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
  animation: wa-nudge 7s ease-in-out 2.5s infinite;
}
.wa-fab__face svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.wa-fab--img .wa-fab__face { background: #fff; }
.wa-fab--img .wa-fab__face img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Dalga halkaları */
.wa-fab__ring {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--wa);
  background: rgba(37, 211, 102, .18); pointer-events: none;
  animation: wa-pulse 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.wa-fab__ring--late { animation-delay: 1.3s; }

/* Parıltı */
.wa-fab__shine { position: absolute; inset: 0; pointer-events: none; }
.wa-fab__shine::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 45%; left: -70%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-18deg); animation: wa-shine 4.5s ease-in-out 1s infinite;
}

/* Yanında açılan etiket */
.wa-fab__label {
  position: relative; display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px;
  background: #fff; box-shadow: 0 14px 34px -12px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06);
  white-space: nowrap; transform-origin: right center;
  opacity: 0; transform: translateX(10px) scale(.92); pointer-events: none;
  transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.wa-fab__label::after {
  content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: #fff; transform: rotate(45deg); border-radius: 2px;
}
.wa-fab__label b { font-size: 14px; font-weight: 800; color: #0B3D1F; }
.wa-fab__label small { font-size: 11.5px; font-weight: 600; color: #4B5563; }

.wa-fab:hover .wa-fab__label, .wa-fab:focus-visible .wa-fab__label, .wa-fab.is-peek .wa-fab__label {
  opacity: 1; transform: none;
}
.wa-fab:hover .wa-fab__face, .wa-fab:focus-visible .wa-fab__face {
  transform: scale(1.08); animation: none;
  box-shadow: 0 16px 36px -8px rgba(18, 140, 74, .85), 0 0 0 3px #fff, 0 0 26px 4px rgba(37, 211, 102, .55);
}
.wa-fab:focus-visible { outline: none; }
.wa-fab:focus-visible .wa-fab__face { outline: 3px solid #0B3D1F; outline-offset: 3px; }
.wa-fab:active .wa-fab__face { transform: scale(.96); }

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: .75; }
  100% { transform: scale(1.75); opacity: 0; }
}
@keyframes wa-shine {
  0%, 62% { left: -70%; }
  82%, 100% { left: 130%; }
}
@keyframes wa-nudge {
  0%, 84%, 100% { transform: rotate(0); }
  86% { transform: rotate(-12deg) scale(1.06); }
  89% { transform: rotate(10deg) scale(1.06); }
  92% { transform: rotate(-6deg); }
  95% { transform: rotate(3deg); }
}

/* Mobil alt menülerin üstünde dursun */
@media (max-width: 860px) {
  body[data-theme="isg"] .wa-fab { --wa-bottom: 74px; right: 14px; }
}
@media (max-width: 900px) {
  body[data-theme="tul"] .wa-fab { --wa-bottom: 92px; right: 14px; }
}
@media (max-width: 600px) {
  .wa-fab { right: 14px; }
  .wa-fab__btn { width: 56px; height: 56px; }
  .wa-fab__face svg { width: 27px; height: 27px; }
  .wa-fab__label { white-space: normal; max-width: calc(100vw - 110px); }
}
/* Ürün sayfasında "Sepete ekle" çubuğu açıkken onun üstüne çıkar */
body:has(.sticky-buy.on) .wa-fab, body:has(.sticky-buy.show) .wa-fab { --wa-bottom: 150px; }
body:has(.compare-bar.show) .wa-fab { --wa-bottom: 86px; }

/* Tül temasında "yukarı çık" düğmesi WhatsApp'ın üstüne alınır */
body:has(.wa-fab) .totop { bottom: calc(1.25rem + 78px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 900px) {
  body:has(.wa-fab) .totop { bottom: calc(96px + 70px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .wa-fab__ring, .wa-fab__shine::after, .wa-fab__face { animation: none !important; }
  .wa-fab__ring { display: none; }
  .sfollow__item, .sfollow__icon, .wa-fab__label { transition: none; }
}
@media print { .wa-fab, .sfollow { display: none !important; } }
