/* ============================================================
   smma-widgets.css — Калькулятор SMM + Подарок (контент-план)
   Самодостаточный модуль. Все токены префиксованы --sw-* (без
   конфликта с темой). Подключать через wp_enqueue_style.
   Шрифты Manrope / Golos Text должны быть загружены темой;
   иначе используется системный fallback.
   ============================================================ */
:root {
  --sw-blue: #1763e6;
  --sw-blue-deep: #0e44a8;
  --sw-blue-ink: #0a2f73;
  --sw-red: #f1382e;
  --sw-ink: #0c121c;
  --sw-ink-2: #141b26;
  --sw-muted: #2c3542;
  --sw-line: #e7ebf2;
  --sw-paper-2: #f4f7fb;
  --sw-paper-3: #eef3fa;
  --sw-chip: #eaf1fe;
  --sw-font-head: "Manrope", system-ui, sans-serif;
  --sw-font-body: "Golos Text", system-ui, sans-serif;
  --sw-shadow-md: 0 14px 40px rgba(16, 23, 37, 0.10);
  --sw-shadow-lg: 0 30px 70px rgba(10, 47, 115, 0.16);
}

#smma-widgets-dock, #smma-widgets-dock *,
.sw-overlay, .sw-overlay * { box-sizing: border-box; }

/* ---- dock (left CTA buttons) ---- */
.sw-dock { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 70; display: flex; flex-direction: column; gap: 12px; }
.sw-fab {
  display: flex; align-items: center; gap: 12px;
  height: 54px; max-width: 54px; padding: 0 16px; overflow: hidden;
  border: 0; border-radius: 16px; cursor: pointer; color: #fff;
  font-family: var(--sw-font-head); font-weight: 800; font-size: 14.5px; line-height: 1.1; text-align: left;
  box-shadow: var(--sw-shadow-md); position: relative;
  transition: max-width .34s cubic-bezier(.2,.8,.3,1), box-shadow .2s ease, transform .14s ease;
  animation: sw-in .5s cubic-bezier(.2,.8,.3,1) both;
}
.sw-fab svg { flex: none; }
.sw-fab .sw-fab-label { white-space: nowrap; opacity: 0; transition: opacity .18s ease .04s; }
.sw-fab .sw-fab-label small { display: block; font-family: var(--sw-font-body); font-weight: 600; font-size: 11px; opacity: .82; margin-top: 2px; }
.sw-fab:hover { max-width: 300px; box-shadow: var(--sw-shadow-lg); }
.sw-fab:hover .sw-fab-label { opacity: 1; }
.sw-fab:active { transform: translateY(1px); }
.sw-fab--calc { background: var(--sw-blue); }
.sw-fab--calc:hover { background: var(--sw-blue-deep); }
.sw-fab--gift { background: var(--sw-red); animation-delay: .09s; }
.sw-fab--gift::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: sw-ring 2.8s ease-out infinite; animation-delay: 1.2s; }
@keyframes sw-in { from { transform: translateX(-18px); } }
@keyframes sw-ring { 0% { box-shadow: 0 0 0 0 rgba(241,56,46,.5); } 70% { box-shadow: 0 0 0 13px rgba(241,56,46,0); } 100% { box-shadow: 0 0 0 0 rgba(241,56,46,0); } }
@media (prefers-reduced-motion: reduce) { .sw-fab, .sw-fab--gift::before { animation: none; } }

/* ---- overlay + modal ---- */
body.sw-lock { overflow: hidden; }
.sw-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,23,45,.55); backdrop-filter: blur(4px); animation: sw-fade .2s ease both; }
@keyframes sw-fade { from { opacity: 0; } }
.sw-modal { width: min(444px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 22px; box-shadow: var(--sw-shadow-lg); position: relative; animation: sw-pop .26s cubic-bezier(.2,.8,.3,1) both; }
@keyframes sw-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.sw-close { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sw-paper-2); color: var(--sw-ink-2); display: grid; place-items: center; cursor: pointer; z-index: 2; transition: background .15s ease; }
.sw-close:hover { background: var(--sw-paper-3); }

.sw-head { padding: 20px 24px 0; }
.sw-head--gift { padding-bottom: 4px; }
.sw-kicker { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sw-font-head); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sw-blue); }
.sw-kicker::before { content: ""; width: 22px; height: 2px; background: var(--sw-red); border-radius: 2px; }
.sw-kicker--red { color: var(--sw-red); }
.sw-kicker--red::before { background: var(--sw-blue); }
.sw-title { font-family: var(--sw-font-head); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-size: 20px; margin: 9px 0 0; color: var(--sw-ink); }
.sw-sub { color: var(--sw-muted); font-size: 13px; line-height: 1.4; margin: 6px 0 0; }
.sw-body { padding: 14px 24px 22px; }

/* ---- step 1: service type ---- */
.sw-step-label { font-family: var(--sw-font-head); font-weight: 700; font-size: 13px; color: var(--sw-ink); margin: 15px 0 0; }
.sw-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.sw-type { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--sw-line); background: var(--sw-paper-2); cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.sw-type b { font-family: var(--sw-font-head); font-weight: 800; font-size: 14px; color: var(--sw-ink-2); }
.sw-type span { font-family: var(--sw-font-body); font-weight: 500; font-size: 10.5px; color: var(--sw-muted); }
.sw-type:hover { border-color: var(--sw-blue); }
.sw-type.on { border-color: var(--sw-blue); background: var(--sw-chip); }
.sw-type.on b { color: var(--sw-blue-ink); }
.sw-type.on span { color: var(--sw-blue); }

/* ---- step 2: budget slider ---- */
.sw-budget-val { text-align: center; font-family: var(--sw-font-head); font-weight: 800; font-size: 23px; color: var(--sw-ink); margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sw-budget-val .sw-bv-u { font-size: 13px; font-weight: 700; color: var(--sw-muted); }
.sw-range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; margin-top: 10px; background: var(--sw-paper-3); outline: none; cursor: pointer; }
.sw-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--sw-blue); border: 4px solid #fff; box-shadow: var(--sw-shadow-md); cursor: pointer; transition: transform .12s ease; }
.sw-range::-webkit-slider-thumb:active { transform: scale(1.12); }
.sw-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--sw-blue); border: 4px solid #fff; box-shadow: var(--sw-shadow-md); cursor: pointer; }
.sw-range-minmax { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11px; font-weight: 600; color: var(--sw-muted); }

/* ---- result block ---- */
.sw-result { margin-top: 14px; padding: 13px 16px; border-radius: 16px; background: linear-gradient(135deg, var(--sw-blue), var(--sw-blue-deep)); color: #fff; }
.sw-result--sm { padding: 12px 16px; margin-top: 0; }
.sw-r-label { font-size: 11px; font-weight: 600; opacity: .82; text-transform: uppercase; letter-spacing: .1em; }
.sw-r-price { font-family: var(--sw-font-head); font-weight: 800; font-size: 24px; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sw-r-price span { font-size: 14px; font-weight: 700; opacity: .82; }
.sw-r-metrics { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.2); }
.sw-r-metrics > span { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; opacity: .92; }
.sw-r-metrics b { font-family: var(--sw-font-head); font-weight: 800; font-size: 15px; white-space: nowrap; letter-spacing: -.01em; }
.sw-note { font-size: 11.5px; color: var(--sw-muted); line-height: 1.45; margin: 10px 0 0; }
.sw-back { display: block; width: 100%; margin-top: 12px; background: none; border: 0; color: var(--sw-muted); font-family: var(--sw-font-body); font-weight: 600; font-size: 13px; cursor: pointer; }
.sw-back:hover { color: var(--sw-blue); }

/* ---- gift visual + month accent ---- */
.sw-gift-hero { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.sw-gift-ico { flex: none; width: 70px; height: 70px; border-radius: 18px; background: linear-gradient(135deg, var(--sw-red), #c21d14); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(241,56,46,.3); }
.sw-month { display: flex; align-items: center; gap: 13px; background: #fdeceb; border: 1.5px solid #f6d2cf; border-radius: 16px; padding: 14px 16px; margin-bottom: 4px; }
.sw-month > svg { color: var(--sw-red); flex: none; }
.sw-month-cap { font-family: var(--sw-font-head); font-weight: 800; font-size: 16px; color: var(--sw-ink); line-height: 1.1; }
.sw-month-sub { font-size: 12.5px; color: var(--sw-muted); margin-top: 4px; line-height: 1.4; }

/* ---- form fields (widget-scoped, no clash with theme .field/.btn) ---- */
.sw-field { margin-top: 14px; }
.sw-field label { display: block; font-family: var(--sw-font-head); font-weight: 600; font-size: 13px; color: var(--sw-ink-2); margin-bottom: 6px; }
.sw-field input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--sw-line); font-family: var(--sw-font-body); font-size: 15px; color: var(--sw-ink); background: var(--sw-paper-2); transition: border-color .15s ease, background .15s ease; }
.sw-field input:focus { outline: none; border-color: var(--sw-blue); background: #fff; }
.sw-field input.sw-invalid { border-color: var(--sw-red); background: #fff5f4; }
.sw-err { color: var(--sw-red); font-size: 12px; margin-top: 5px; font-weight: 600; }
.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--sw-font-head); font-weight: 700; font-size: 16px; padding: 15px 26px; border-radius: 999px; border: 0; cursor: pointer; transition: filter .2s ease, background .2s ease, transform .15s ease; text-decoration: none; }
.sw-btn:active { transform: translateY(1px); }
.sw-btn-red { background: var(--sw-red); color: #fff; box-shadow: 0 10px 24px rgba(241,56,46,.26); }
.sw-btn-red:hover { filter: brightness(.95); }
.sw-btn-red:disabled { opacity: .7; cursor: default; }
.sw-btn-ghost { background: #fff; color: var(--sw-ink); border: 1.5px solid var(--sw-line); }
.sw-btn-ghost:hover { border-color: var(--sw-blue); color: var(--sw-blue); }
.sw-reassure { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--sw-muted); }
.sw-reassure svg { color: #1f9d55; flex: none; }
.sw-consent { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; font-size: 12px; color: var(--sw-muted); line-height: 1.4; }
.sw-consent input { margin-top: 2px; accent-color: var(--sw-blue); width: 16px; height: 16px; flex: none; }
.sw-consent a { color: var(--sw-blue); text-decoration: underline; }
.sw-consent.sw-consent-bad span { color: var(--sw-red); }
.sw-ok { text-align: center; padding: 18px 8px; }
.sw-ok .sw-tick { width: 56px; height: 56px; border-radius: 50%; background: #e9f7ee; color: #1f9d55; display: grid; place-items: center; margin: 0 auto 12px; }
.sw-ok h3 { font-family: var(--sw-font-head); font-weight: 800; font-size: 22px; margin: 0; color: var(--sw-ink); }
.sw-ok p { color: var(--sw-muted); margin: 8px 0 0; font-size: 14px; line-height: 1.45; }

/* ---- mobile: two compact buttons bottom-left ---- */
@media (max-width: 860px) {
  /* Над липкой панелью «Обсудить проект» (она внизу), чтобы не перекрывать её и контент. */
  .sw-dock { left: 12px; top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); transform: none; gap: 12px; }
  /* Компактные круглые кнопки-иконки (без текста), чтобы не залезать на экран. */
  .sw-fab { width: 52px; height: 52px; min-width: 52px; max-width: 52px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
  .sw-fab .sw-fab-label { display: none; }
  .sw-fab:hover { max-width: 52px; }
  .sw-overlay { padding: 0; align-items: flex-end; }
  .sw-modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; animation: sw-sheet .3s cubic-bezier(.2,.8,.3,1) both; }
  @keyframes sw-sheet { from { transform: translateY(100%); } }
}
