/* Sol sosyal medya şeridi + sağ WhatsApp sohbet penceresi
   Renk/yazı tipi: style.css'teki --cw-* değişkenleri. Görünüm: .cw-v1 / .cw-v2 / .cw-v3 */
.cw-rail, .cw-chat {
  --_accent: var(--cw-accent, #5B2D8E);
  --_accent-2: var(--cw-accent-2, var(--_accent));
  --_accent-ink: var(--cw-accent-ink, #fff);
  --_head: var(--cw-head, var(--_accent));
  --_surface: var(--cw-surface, #fff);
  --_soft: var(--cw-soft, #F4F0F8);
  --_text: var(--cw-text, #1E1240);
  --_muted: var(--cw-muted, #6B6488);
  --_line: var(--cw-line, rgba(30, 18, 64, .1));
  --_font: var(--cw-font, system-ui, sans-serif);
  --_radius: var(--cw-radius, 22px);
  --_wa: #25D366;
  --_wa-dark: #128C4A;
  --_ease: cubic-bezier(.22, 1, .36, 1);
  font-family: var(--_font);
}
.cw-rail svg, .cw-chat svg { width: 1em; height: 1em; display: block; flex-shrink: 0; }
.cw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.cw-chat, .cw-rail) button { margin: 0; padding: 0; line-height: 1; min-height: 0; -webkit-appearance: none; appearance: none; text-transform: none; letter-spacing: normal; }

/* =========================================================
   SOSYAL ŞERİT — ortak
   ========================================================= */
.cw-rail {
  position: fixed; left: 18px; top: 50%; z-index: 80;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(-50%);
  animation: cwRailIn .8s .6s var(--_ease) both;
}
@keyframes cwRailIn { from { opacity: 0; transform: translate(-24px, -50%); } }
.cw-rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cw-rail a, .cw-rail button {
  position: relative; display: flex; align-items: center;
  font: inherit; color: inherit; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
}
.cw-rail a:focus-visible, .cw-rail button:focus-visible { outline: 2px solid var(--_accent); outline-offset: 3px; }
.cw-rail__ic { display: grid; place-items: center; flex-shrink: 0; }
.cw-rail__label { font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- V1 · degrade kapsül, alt bölümde WhatsApp ---------- */
.cw-v1.cw-rail {
  padding: 16px 7px 7px; border-radius: 999px;
  background: linear-gradient(180deg, var(--_accent) 0%, var(--_accent-2) 100%);
  box-shadow: 0 20px 40px -18px rgba(91, 45, 142, .7);
}
.cw-rail.cw-v1 .cw-rail__label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: rgba(255, 255, 255, .75); margin-bottom: 12px;
}
.cw-rail.cw-v1 ul { gap: 8px; }
.cw-rail.cw-v1 .cw-rail__ic {
  width: 38px; height: 38px; border-radius: 50%; font-size: 17px; color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .45);
  transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--_ease);
}
.cw-rail.cw-v1 a:hover .cw-rail__ic, .cw-rail.cw-v1 a:focus-visible .cw-rail__ic { background: #fff; color: var(--_accent); border-color: #fff; transform: scale(1.06); }
.cw-rail.cw-v1 .cw-rail__item--whatsapp { margin-top: 6px; }
.cw-rail.cw-v1 .cw-rail__item--whatsapp .cw-rail__ic { width: 40px; height: 40px; font-size: 20px; background: var(--_wa); border-color: var(--_wa); }
.cw-rail.cw-v1 .cw-rail__item--whatsapp button:hover .cw-rail__ic { transform: scale(1.08); }
.cw-rail.cw-v1 .cw-rail__tip {
  position: absolute; left: calc(100% + 18px); top: 50%;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--_text); color: #fff; font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transform: translate(-8px, -50%);
  transition: opacity .25s, transform .35s var(--_ease);
}
.cw-rail.cw-v1 a:hover .cw-rail__tip, .cw-rail.cw-v1 a:focus-visible .cw-rail__tip,
.cw-rail.cw-v1 button:hover .cw-rail__tip, .cw-rail.cw-v1 button:focus-visible .cw-rail__tip { opacity: 1; transform: translate(0, -50%); }

/* ---------- V2 · kenara yapışık sekmeler, üzerine gelince açılır ---------- */
.cw-v2.cw-rail { left: 0; align-items: flex-start; }
.cw-rail.cw-v2 ul, .cw-rail.cw-v3 ul { align-items: flex-start; }
.cw-rail.cw-v2 .cw-rail__label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: 0 0 14px 18px; color: var(--_muted);
  display: flex; align-items: center; gap: 10px;
}
.cw-rail.cw-v2 .cw-rail__label::after { content: ""; width: 1px; height: 34px; background: currentColor; opacity: .5; }
.cw-rail.cw-v2 ul { gap: 2px; }
.cw-rail.cw-v2 a, .cw-rail.cw-v2 button {
  height: 48px; padding-right: 4px; border-radius: 0 14px 14px 0;
  background: var(--_surface); color: var(--_accent);
  border: 1px solid var(--_line); border-left: 0;
  box-shadow: 0 10px 24px -16px rgba(35, 64, 47, .5);
  transition: background-color .3s, color .3s, padding .45s var(--_ease);
}
.cw-rail.cw-v2 .cw-rail__ic { width: 48px; height: 48px; font-size: 18px; }
.cw-rail.cw-v2 .cw-rail__tip {
  max-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  transition: max-width .45s var(--_ease), margin .45s var(--_ease);
}
.cw-rail.cw-v2 a:hover, .cw-rail.cw-v2 a:focus-visible, .cw-rail.cw-v2 button:hover, .cw-rail.cw-v2 button:focus-visible { background: var(--_accent); color: var(--_accent-ink); padding-right: 18px; }
.cw-rail.cw-v2 a:hover .cw-rail__tip, .cw-rail.cw-v2 a:focus-visible .cw-rail__tip,
.cw-rail.cw-v2 button:hover .cw-rail__tip, .cw-rail.cw-v2 button:focus-visible .cw-rail__tip { max-width: 120px; margin-left: -4px; }
.cw-rail.cw-v2 .cw-rail__item--whatsapp { margin-top: 10px; }
.cw-rail.cw-v2 .cw-rail__item--whatsapp button { background: var(--_wa); color: #fff; border-color: var(--_wa); }
.cw-rail.cw-v2 .cw-rail__item--whatsapp button:hover { background: var(--_wa-dark); }

/* ---------- V3 · ayrık renkli daireler, hap şeklinde genişler ---------- */
.cw-v3.cw-rail { align-items: flex-start; }
.cw-rail.cw-v3 .cw-rail__label { display: none; }
.cw-rail.cw-v3 ul { gap: 10px; }
.cw-rail.cw-v3 a, .cw-rail.cw-v3 button {
  --dot: var(--_accent);
  height: 46px; padding: 4px; border-radius: 999px;
  background: var(--cw-glass, rgba(255, 255, 255, .75));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--_line); color: var(--_text);
  box-shadow: 0 12px 30px -16px rgba(30, 18, 64, .45);
  transition: transform .45s var(--_ease), box-shadow .3s;
}
.cw-rail.cw-v3 .cw-rail__item--instagram a { --dot: #FFD400; }
.cw-rail.cw-v3 .cw-rail__item--youtube a { --dot: #8CC63F; }
.cw-rail.cw-v3 .cw-rail__item--facebook a { --dot: #7FCCE3; }
.cw-rail.cw-v3 .cw-rail__item--linkedin a { --dot: #5B2D8E; }
.cw-rail.cw-v3 .cw-rail__item--whatsapp button { --dot: var(--_wa); }
.cw-rail.cw-v3 .cw-rail__ic {
  width: 36px; height: 36px; border-radius: 50%; font-size: 17px;
  background: var(--dot); color: #1E1240;
}
.cw-rail.cw-v3 .cw-rail__item--linkedin .cw-rail__ic, .cw-rail.cw-v3 .cw-rail__item--whatsapp .cw-rail__ic { color: #fff; }
.cw-rail.cw-v3 .cw-rail__tip {
  max-width: 0; overflow: hidden; white-space: nowrap;
  font-size: 13px; font-weight: 700;
  transition: max-width .5s var(--_ease), margin .5s var(--_ease);
}
.cw-rail.cw-v3 a:hover, .cw-rail.cw-v3 a:focus-visible, .cw-rail.cw-v3 button:hover, .cw-rail.cw-v3 button:focus-visible { transform: translateX(4px); box-shadow: 0 16px 34px -14px rgba(30, 18, 64, .5); }
.cw-rail.cw-v3 a:hover .cw-rail__tip, .cw-rail.cw-v3 a:focus-visible .cw-rail__tip,
.cw-rail.cw-v3 button:hover .cw-rail__tip, .cw-rail.cw-v3 button:focus-visible .cw-rail__tip { max-width: 110px; margin: 0 14px 0 10px; }

/* =========================================================
   WHATSAPP — ortak
   ========================================================= */
.cw-chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 130;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  color: var(--_text);
}
.cw-toggle {
  position: relative; height: 60px; min-width: 60px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--_wa); color: #fff; display: grid; place-items: center; font-size: 30px;
  box-shadow: 0 14px 30px -10px rgba(18, 140, 70, .65);
  transition: transform .4s var(--_ease), background-color .3s;
}
.cw-toggle:hover { transform: scale(1.05); }
.cw-toggle:focus-visible { outline: 3px solid var(--_accent); outline-offset: 6px; }
.cw-toggle > .cw-toggle__wa, .cw-toggle > .cw-toggle__x { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .25s, transform .4s var(--_ease); }
.cw-toggle__x { opacity: 0; transform: rotate(-90deg) scale(.6); font-size: 24px; }
.cw-toggle__label { display: none; }
.cw-chat.is-open .cw-toggle { background: var(--_accent); color: var(--_accent-ink); }
.cw-chat.is-open .cw-toggle__wa { opacity: 0; transform: rotate(90deg) scale(.6); }
.cw-chat.is-open .cw-toggle__x { opacity: 1; transform: none; }

/* V1 · nabız halkaları */
.cw-v1 .cw-toggle::before, .cw-v1 .cw-toggle::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--_wa);
  animation: cwPulse 2.6s ease-out infinite;
}
.cw-v1 .cw-toggle::after { animation-delay: 1.3s; }
@keyframes cwPulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.cw-v1.is-open .cw-toggle::before, .cw-v1.is-open .cw-toggle::after { display: none; }

/* V2 · yazılı hap buton */
.cw-v2 .cw-toggle { grid-template-columns: auto auto; gap: 10px; padding: 0 24px 0 18px; height: 56px; font-size: 26px; }
.cw-v2 .cw-toggle__label { display: block; grid-area: 1 / 2; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.cw-v2.is-open .cw-toggle { padding: 0; width: 56px; min-width: 56px; grid-template-columns: auto; }
.cw-v2.is-open .cw-toggle__label { display: none; }

/* V3 · logo renklerinde dönen halka */
.cw-v3 .cw-toggle::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; z-index: -1;
  background: conic-gradient(#FFE600, #8CC63F, #7FCCE3, #5B2D8E, #FFE600);
  animation: cwSpin 6s linear infinite;
}
@keyframes cwSpin { to { transform: rotate(360deg); } }
.cw-v3 .cw-toggle { isolation: isolate; box-shadow: 0 14px 30px -10px rgba(30, 18, 64, .5); }
.cw-v3.is-open .cw-toggle::before { animation-play-state: paused; opacity: .4; }

@keyframes cwPop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* Panel */
.cw-panel {
  width: min(370px, calc(100vw - 32px));
  display: flex; flex-direction: column;
  background: var(--_surface); border: 1px solid var(--_line); border-radius: var(--_radius);
  box-shadow: 0 30px 70px -24px rgba(20, 12, 40, .5);
  overflow: hidden; transform-origin: bottom right;
  animation: cwOpen .45s var(--_ease) both;
}
.cw-panel[hidden] { display: none; }
@keyframes cwOpen { from { opacity: 0; transform: translateY(14px) scale(.94); } }

.cw-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px;
  background: var(--_head); color: var(--_accent-ink);
}
.cw-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid rgba(255, 255, 255, .75); }
.cw-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cw-head strong { font-size: 16px; line-height: 1.25; }
.cw-head span { font-size: 12px; opacity: .85; display: inline-flex; align-items: center; gap: 6px; }
.cw-head span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--_wa); box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.cw-close {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: inherit; display: grid; place-items: center; font-size: 16px;
  transition: background-color .25s;
}
.cw-close:hover { background: rgba(255, 255, 255, .3); }

.cw-body {
  padding: 14px 14px 12px; max-height: min(420px, 58vh); overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(circle at 1px 1px, var(--_line) 1px, transparent 0) 0 0 / 16px 16px,
    var(--_soft);
}

/* İletişim kartı */
.cw-card {
  display: flex; gap: 12px; padding: 14px;
  background: var(--_surface); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(20, 12, 40, .06);
  animation: cwPop .5s .1s var(--_ease) both;
}
.cw-card__mono {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  background: var(--_accent); color: var(--_accent-ink);
}
.cw-card__info { min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; line-height: 1.4; color: var(--_muted); }
.cw-card__info strong { font-size: 14px; color: var(--_text); margin-bottom: 2px; }
.cw-card__info span, .cw-card__info a { display: flex; align-items: flex-start; gap: 7px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.cw-card__info svg { font-size: 14px; margin-top: 1px; color: var(--_accent); }
.cw-card__info a:hover { color: var(--_accent); }

.cw-msg {
  position: relative; max-width: 90%; padding: 11px 13px 7px;
  background: var(--_surface); border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 6px rgba(20, 12, 40, .06);
  animation: cwPop .5s .2s var(--_ease) both;
}
.cw-msg p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.cw-msg time { display: block; text-align: right; font-size: 11px; color: var(--_muted); margin-top: 3px; }

/* Hızlı eylemler (2x2) */
.cw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; animation: cwPop .5s .3s var(--_ease) both; }
.cw-action {
  display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 10px;
  border-radius: 999px; border: 1px solid var(--_line); background: var(--_surface); color: var(--_text);
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--_ease);
}
.cw-action svg { font-size: 15px; color: var(--_accent); transition: color .25s; }
.cw-action:hover { border-color: var(--_accent); transform: translateY(-2px); }
.cw-action.is-active { background: var(--_accent); border-color: var(--_accent); color: var(--_accent-ink); }
.cw-action.is-active svg { color: inherit; }

.cw-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 16px; border-top: 1px solid var(--_line); background: var(--_surface); }
.cw-form textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none;
  font: inherit; font-size: 14px; line-height: 1.45; color: var(--_text); padding: 9px 0; max-height: 110px;
}
.cw-form textarea::placeholder { color: var(--_muted); }
.cw-send {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--_wa); color: #fff; display: grid; place-items: center; font-size: 18px;
  transition: transform .3s var(--_ease);
}
.cw-send:hover { transform: scale(1.08) rotate(-8deg); }

/* Görünüm farkları — panel */
.cw-v2 .cw-panel { border-radius: 10px; }
.cw-v2 .cw-card, .cw-v2 .cw-action { border-radius: 8px; }
.cw-v2 .cw-msg { border-radius: 2px 10px 10px 10px; }
.cw-v3 .cw-head { background: linear-gradient(120deg, var(--_head), var(--cw-head-2, var(--_head))); }

/* Panel açıkken yukarı çık butonu gizlensin */
.cw-is-open .to-top { opacity: 0 !important; visibility: hidden !important; }

@media (max-width: 1100px) {
  .cw-rail { display: none; }
}
@media (max-width: 480px) {
  .cw-chat { right: 14px; bottom: 14px; }
  .cw-toggle { height: 56px; min-width: 56px; font-size: 28px; }
  .cw-v2 .cw-toggle { padding: 0 20px 0 16px; height: 52px; }
  .cw-panel { width: calc(100vw - 28px); }
}
@media (prefers-reduced-motion: reduce) {
  .cw-rail, .cw-panel, .cw-msg, .cw-card, .cw-actions { animation: none; }
  .cw-toggle::before, .cw-toggle::after { animation: none !important; }
}
