/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #7b2ff7;
  --primary-dark:  #5a1db5;
  --primary-light: #f3ebff;
  --accent:        #f9ca24;
  --bg:            #f7f8fc;
  --surface:       #ffffff;
  --text:          #1a1a2e;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 4px 24px rgba(123,47,247,.08);
  --shadow-hover:  0 8px 32px rgba(123,47,247,.2);
  --transition:    0.2s cubic-bezier(.4,0,.2,1);
  --header-h:      64px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Rubik', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  padding-bottom: 100px; /* под sticky bar */
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-block { display: flex; align-items: center; }
.site-logo-img { height: 38px; width: auto; filter: brightness(0) invert(1); }
.header-tagline {
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.08);
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  margin-left: auto;
}

/* Кнопка корзины в хедере */
.header-cart-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary);
  border: none; border-radius: 12px;
  color: #fff; cursor: pointer;
  padding: 8px 16px;
  font-size: 14px; font-weight: 600; font-family: 'Rubik', sans-serif;
  transition: all var(--transition);
  position: relative;
  box-shadow: 0 4px 16px rgba(123,47,247,.4);
  white-space: nowrap;
}
.header-cart-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: #fc3f1d; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #1a1a2e;
}
.cart-sum { font-weight: 700; }
.cart-btn-label { font-weight: 600; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 64px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(123,47,247,.3) 0%, transparent 70%);
}
.hero-inner { position: relative; max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: clamp(26px,5vw,46px); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 14px; letter-spacing:-.02em; }
.hero p { font-size: 16px; color: rgba(255,255,255,.7); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.calc-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.section-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.step-badge {
  min-width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(123,47,247,.3);
  flex-shrink: 0;
}
.section-header h2 { font-size: 21px; font-weight: 700; margin-bottom: 3px; }
.section-desc { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   CLIENT FORM
   ============================================================ */
.client-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing:.06em; display:flex;align-items:center;gap:5px; }
.form-group label i { color: var(--primary); }
.form-group input, .form-group select {
  padding: 11px 13px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Rubik', sans-serif;
  color: var(--text); background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123,47,247,.12);
}
.cart-field-val {
  padding: 11px 13px;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  min-height: 42px;
}

/* ============================================================
   SERVICE CARDS GRID
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ── карточка ── */
.service-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: default;
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 6px 24px rgba(123,47,247,.12);
  transform: translateY(-2px);
}

/* выбранная */
.service-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 4px 24px rgba(123,47,247,.2);
  background: linear-gradient(180deg, #faf7ff 0%, #f3ebff 100%);
}
.service-card.is-selected .card-add-btn {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #a5d6a7;
}
.service-card.is-selected .card-add-btn i.fa-plus::before { content: '\f00c'; } /* check */

/* featured */
.service-card--featured {
  border-color: #f9ca24;
  background: linear-gradient(180deg, #fffbea, #fff8d6);
}
.service-card--featured:hover { border-color: #f0932b; }
.service-card--featured.is-selected {
  border-color: #f0932b;
  background: linear-gradient(180deg, #fff3cd, #ffe599);
}
.service-card--featured.is-selected .card-add-btn {
  background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7;
}

/* select area */
.card-select-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 10px;
  flex: 1;
}
.card-icon {
  min-width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
.card-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.card-price-tag { font-size: 14px; font-weight: 800; color: var(--primary); white-space: nowrap; flex-shrink: 0; }
.service-card--featured .card-price-tag { color: #d4851a; }

/* кнопка добавить */
.card-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px 14px;
  background: var(--primary-light);
  border: 2px solid #c4b5fd;
  border-radius: 0 0 14px 14px;
  color: var(--primary);
  font-size: 13px; font-weight: 700; font-family: 'Rubik', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: auto;
}
.card-add-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.card-add-btn--gold {
  background: #fff8e1; border-color: #f9ca24; color: #c87b00;
}
.card-add-btn--gold:hover { background: #f9ca24; color: #7c4800; border-color: #f0932b; }

/* SEO tip */
.seo-tip {
  background: linear-gradient(90deg,#fffbeb,#fef3c7);
  border-top: 1px solid #fde68a;
  font-size: 10.5px; font-weight: 600; color: #92400e;
  padding: 5px 12px;
  display: flex; align-items: center; gap: 5px;
}
.seo-tip i { color: #f59e0b; }

/* ============================================================
   TAGS
   ============================================================ */
.tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: #f1f3f5; color: var(--text-muted); }
.tag-blue   { background: #dbeafe; color: #1d4ed8; }
.tag-red    { background: #fee2e2; color: #b91c1c; }
.tag-green  { background: #d1fae5; color: #065f46; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-purple { background: #ede9fe; color: #6d28d9; }
.tag-pink   { background: #fce7f3; color: #9d174d; }
.tag-teal   { background: #ccfbf1; color: #0f766e; }
.best-badge {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  background: linear-gradient(135deg,#f9ca24,#f0932b); color: #fff;
  padding: 2px 6px; border-radius: 20px; margin-left: 4px;
  text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}

/* ============================================================
   STICKY CART BAR
   ============================================================ */
.sticky-cart {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  padding: 0 16px 0;
  pointer-events: none;
}
.sticky-cart-inner {
  max-width: 900px;
  margin: 0 auto;
  background: #1a1a2e;
  border-radius: 20px 20px 0 0;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -4px 32px rgba(0,0,0,.3);
  pointer-events: all;
  border-top: 2px solid var(--primary);
}
.sticky-cart-info { display: flex; flex-direction: column; gap: 3px; }
.sticky-cart-count { font-size: 13px; color: rgba(255,255,255,.6); font-weight: 500; }
.sticky-cart-prices { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sticky-cart-prices span { font-size: 15px; color: rgba(255,255,255,.85); }
.sticky-cart-prices b { color: #fff; font-weight: 800; }
.sticky-extra-badge b { color: var(--accent); }
.sticky-cart-btn {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; border-radius: 12px;
  color: #fff; cursor: pointer;
  padding: 12px 22px;
  font-size: 15px; font-weight: 700; font-family: 'Rubik', sans-serif;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(123,47,247,.4);
  white-space: nowrap;
}
.sticky-cart-btn:hover { background: linear-gradient(135deg, #8f3fff, var(--primary)); box-shadow: 0 6px 24px rgba(123,47,247,.6); transform: translateY(-1px); }
.sticky-arrow { opacity: .7; }

/* ============================================================
   CART PAGE
   ============================================================ */
.cart-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.cart-page-inner { display: flex; flex-direction: column; gap: 24px; }
.cart-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 2px solid var(--border);
  border-radius: 10px; color: var(--text-muted);
  cursor: pointer; padding: 8px 16px;
  font-size: 14px; font-weight: 600; font-family: 'Rubik', sans-serif;
  transition: all var(--transition);
}
.cart-back-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cart-page-title { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.cart-page-title i { color: var(--primary); }

/* строки в корзине */
.cart-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 4px 0 8px;
}
.cart-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  margin-bottom: 8px;
  animation: slideIn .15s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.cart-item-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 15px; flex-shrink: 0;
}
.cart-item-icon--extra { background: #fff8e1; color: #c87b00; }
.cart-item-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.cart-item-period { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cart-item-price { font-size: 15px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.cart-item-price--extra { color: #c87b00; }
.cart-item-del {
  width: 30px; height: 30px; border-radius: 8px;
  background: #fee2e2; border: none; cursor: pointer;
  color: #b91c1c; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.cart-item-del:hover { background: #b91c1c; color: #fff; }

.cart-empty-msg {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.cart-empty-msg i { font-size: 40px; opacity: .3; }
.cart-empty-msg p { font-size: 15px; }

/* итоги корзины */
.cart-totals {
  background: #1a1a2e;
  border-radius: 16px; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.cart-total-row { display: flex; align-items: center; justify-content: space-between; }
.ct-label { font-size: 14px; color: rgba(255,255,255,.65); display:flex;align-items:center;gap:6px; }
.ct-val { font-size: 16px; color: #fff; font-weight: 700; }
.ct-bold { font-size: 22px !important; color: #fff !important; }
.ct-discount { color: #6ee7b7 !important; }
.ct-extra { color: var(--accent) !important; }
.cart-discount-row { display: flex; align-items: center; justify-content: space-between; }
.cart-discount-row .ct-label { color: #6ee7b7; }
.cart-divider { height: 1px; background: rgba(255,255,255,.1); margin: 4px 0; }

/* кнопка PDF */
.btn-pdf {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; font-family: 'Rubik', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(123,47,247,.4);
}
.btn-pdf:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(123,47,247,.55); }
.btn-pdf--cart { width: 100%; margin-top: 8px; padding: 18px; font-size: 17px; }
.pdf-note { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   DISCOUNT BOX
   ============================================================ */
.discount-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
}
.discount-box-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  background: linear-gradient(135deg,#faf7ff,#f3ebff);
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}
.discount-box-header i { color: var(--primary); font-size: 15px; }
.discount-box-header span { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.discount-box.active .discount-box-header { border-bottom-color: var(--border); }

/* toggle switch */
.discount-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink:0; }
.discount-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db; border-radius: 22px;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.discount-toggle input:checked + .toggle-slider { background: var(--primary); }
.discount-toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.discount-box-body { padding: 16px 18px; }
.discount-input-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.discount-hint { font-size: 13px; color: var(--text-muted); flex: 1; }
.discount-input-wrap {
  display: flex; align-items: center;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg);
  transition: border-color var(--transition);
  width: 100px; flex-shrink: 0;
}
.discount-input-wrap:focus-within { border-color: var(--primary); }
.discount-input-wrap input {
  border: none !important; box-shadow: none !important;
  width: 60px; padding: 9px 8px; font-size: 16px; font-weight: 700;
  font-family: 'Rubik', sans-serif; background: transparent;
  text-align: center;
}
.discount-pct-sign { font-size: 16px; font-weight: 700; color: var(--primary); padding-right: 10px; }

.discount-preview {
  background: linear-gradient(135deg,#1a1a2e,#16213e);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.dp-row { display: flex; justify-content: space-between; align-items: center; }
.dp-label { font-size: 12px; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing:.06em; }
.dp-old { font-size: 14px; color: rgba(255,255,255,.4); text-decoration: line-through; }
.dp-new { font-size: 20px; font-weight: 800; color: #6ee7b7; }
.dp-save { font-size: 11px; color: #fcd34d; font-weight: 600; }
.dp-divider { height: 1px; background: rgba(255,255,255,.1); margin: 2px 0; }

/* зачёркнутая цена в итогах корзины */
.ct-old { font-size: 13px; color: rgba(255,255,255,.4); text-decoration: line-through; margin-right: 6px; }
.ct-custom-discount { color: #6ee7b7 !important; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #1a1a2e; padding: 24px; text-align: center; border-top: 1px solid rgba(255,255,255,.06); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-logo { margin-bottom: 4px; }
.footer-logo-img { height: 30px; filter: brightness(0) invert(1); opacity: .6; }
.site-footer p { font-size: 12px; color: rgba(255,255,255,.3); }

/* пульс при добавлении */
@keyframes pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); box-shadow: 0 0 0 6px rgba(123,47,247,.15); }
  100% { transform: scale(1); }
}
.service-card.pulse { animation: pulse .4s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
  .calc-section { padding: 18px 14px 22px; }
  .services-grid { grid-template-columns: 1fr; }
  .hero { padding: 44px 16px 52px; }
  .header-tagline { display: none; }
  .sticky-cart-inner { padding: 12px 14px; }
  .sticky-cart-btn { padding: 10px 16px; font-size: 14px; }
  .cart-page { padding: 20px 14px 60px; }
}
