/* ============================================================
   КАРУСЕЛЬ «ДО / ПОСЛЕ»
   ============================================================ */

.ba-section {
  padding: 90px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ba-carousel { position: relative; overflow: hidden; border-radius: 24px; }

.ba-track {
  display: flex;
  transition: transform .6s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}

.ba-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 4px;
}

.ba-card {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(18,20,29,.08);
  box-shadow: var(--shadow-card);
  transition: .3s;
  display: flex;
  flex-direction: column;
}
.ba-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.ba-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 280px;
  position: relative;
}
.ba-compare > div { position: relative; overflow: hidden; }
.ba-compare > .ba-before .ph { filter: grayscale(.75) brightness(.7); }

.ba-label {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 4px 11px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  z-index: 2;
}
.ba-label.ba-label-after { background: var(--accent); }

.ba-compare::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: linear-gradient(to bottom, transparent, #fff, transparent);
  z-index: 3;
  box-shadow: 0 0 12px rgba(0,0,0,.25);
}

.ba-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ba-body h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.ba-body p { color: var(--gray); font-size: .9rem; margin-bottom: 18px; flex: 1; line-height: 1.5; }
.ba-cta { width: 100%; padding: 12px 18px; font-size: .88rem; }

.ph {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  position: relative; overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.9);
  font-weight: 800; letter-spacing: .15em;
  font-size: .72rem; text-transform: uppercase;
}
.ph-1 { background: linear-gradient(135deg, #ff6b35, #ffb800); }
.ph-2 { background: linear-gradient(135deg, #12141d, #4b5563); }
.ph-3 { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ph-4 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ph-5 { background: linear-gradient(135deg, #ef4444, #f97316); }
.ph-6 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

.ba-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-top: 28px;
}
.ba-arrows { display: flex; gap: 10px; }

.ba-arrow {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff; color: var(--dark);
  font-size: 1rem; cursor: pointer;
  transition: .2s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.ba-arrow:hover:not(:disabled) {
  background: var(--dark); color: #fff;
  border-color: var(--dark);
  transform: translateY(-2px);
}
.ba-arrow:disabled { opacity: .35; cursor: not-allowed; }

.ba-dots { display: flex; gap: 8px; align-items: center; }
.ba-dot {
  width: 10px; height: 10px;
  border-radius: 50%; border: none;
  background: #c8c5bf;
  cursor: pointer; transition: .3s; padding: 0;
}
.ba-dot.active {
  background: var(--accent);
  width: 30px; border-radius: 100px;
}

.ba-counter {
  font-weight: 700; font-size: .9rem;
  color: var(--gray);
  letter-spacing: .04em;
  min-width: 60px; text-align: right;
}
.ba-counter b { color: var(--dark); }


/* ============================================================
   БЛОК «ПОЧЕМУ МЫ» — строки с цифрами
   ============================================================ */

#why { padding: 110px 0; }

.v2-list { display: flex; flex-direction: column; gap: 16px; }

.v2-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 24px;
  background: #fff;
  padding: 24px 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(18,20,29,.06);
  box-shadow: var(--shadow-card);
  transition: .3s;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: inherit;
  width: 100%;
}
.v2-item:hover {
  transform: translateX(6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.v2-item:active { transform: translateX(4px) scale(.995); }

.v2-num {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.v2-body h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.v2-body p { color: var(--gray); font-size: .95rem; }
.v2-ico {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,107,53,.14), rgba(255,184,0,.14));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--accent);
  flex-shrink: 0;
  transition: .3s;
}
.v2-item:hover .v2-ico {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  transform: rotate(-8deg);
}

.v2-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: .78rem;
  margin-top: 6px;
}
.v2-hint i { transition: .25s; }
.v2-item:hover .v2-hint i { transform: translateX(4px); }


/* ============================================================
   МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 29, .55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFade .25s ease;
}
.modal-overlay.open { display: flex; }

@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 64px -16px rgba(0,0,0,.4);
  animation: modalSlide .3s ease;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-head {
  padding: 28px 32px 20px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.modal-ico {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -6px rgba(255,107,53,.55);
}
.modal-title { flex: 1; padding-right: 32px; }
.modal-title h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.modal-title .modal-tag {
  display: inline-block;
  background: rgba(255,107,53,.1);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 100px;
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.modal-close:hover { background: var(--line); color: var(--dark); }

.modal-body {
  padding: 24px 32px 32px;
  overflow-y: auto;
  color: var(--dark);
  font-size: .97rem;
  line-height: 1.7;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 3px;
}

.modal-body h4 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 24px 0 10px;
}
.modal-body h4:first-child { margin-top: 0; }

.modal-body p { margin-bottom: 12px; color: #2a2d38; }

.modal-body ul { padding-left: 22px; margin-bottom: 14px; }
.modal-body li { margin-bottom: 6px; color: #2a2d38; }
.modal-body li::marker { color: var(--accent); }

.modal-body strong { font-weight: 700; color: var(--dark); }

.modal-body .kw {
  background: rgba(255,184,0,.18);
  padding: 0 4px;
  border-radius: 4px;
}

.modal-cta {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 100px;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  transition: .25s;
}
.modal-cta .primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 24px -8px rgba(255,107,53,.55);
}
.modal-cta .primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.modal-cta .secondary {
  background: #f6f4f1;
  color: var(--dark);
}
.modal-cta .secondary:hover { background: var(--line); }


/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 1024px) {
  .ba-slide { grid-template-columns: 1fr; gap: 20px; }
  .ba-compare { height: 240px; }
}

@media (max-width: 640px) {
  .ba-section { padding: 60px 0; }
  .ba-slide { gap: 16px; }
  .ba-compare { height: 200px; }
  .ba-body { padding: 18px; }
  .ba-body h3 { font-size: 1.05rem; }
  .ba-arrow { width: 42px; height: 42px; }
  .ba-counter { min-width: auto; }
  .ba-nav { flex-wrap: wrap; }

  #why { padding: 70px 0; }

  .v2-item {
    grid-template-columns: 60px 1fr;
    gap: 16px;
    padding: 20px;
  }
  .v2-num { font-size: 2rem; }
  .v2-ico { display: none; }

  .modal-head { padding: 22px 20px 16px; }
  .modal-body { padding: 20px; }
  .modal-title h3 { font-size: 1.15rem; }
  .modal-ico { width: 48px; height: 48px; font-size: 1.2rem; }
  .modal-cta a { flex: 1; justify-content: center; }
}
/* ============================================================
   КАРТОЧКА РАБОТЫ
   ============================================================ */
.work-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
  border: 1px solid rgba(18,20,29,.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: .3s;
  min-height: 320px;
}
.work-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.work-card__photo {
  position: relative;
  background: #e9e6e1;
  overflow: hidden;
  min-height: 320px;
}
.work-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card__info {
  padding: 28px 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.work-card__title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 0;
  color: var(--dark);
}

/* Цена */
.work-card__price {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.work-card__price-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--dark);
}
.work-card__price-note {
  font-size: .72rem;
  color: var(--gray);
}

/* Параметры */
.work-card__specs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.work-card__specs li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .85rem;
  color: var(--gray);
  line-height: 1.35;
}
.work-card__specs li span {
  color: var(--gray);
}
.work-card__specs li b {
  color: var(--dark);
  font-weight: 700;
  white-space: nowrap;
}

/* Кнопка «Показать полный список» */
.work-card__more {
  margin-top: auto;
  align-self: flex-start;
  background: none;
  border: none;
  padding: 6px 0;
  color: var(--accent);
  font-family: inherit;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  border-bottom: 1.5px dashed currentColor;
  transition: .2s;
}
.work-card__more:hover { opacity: .75; }

/* Бейдж «без шва» */
.work-card__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2b7fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .02em;
  z-index: 2;
  box-shadow: 0 8px 20px -6px rgba(43,127,255,.55);
}

/* Адаптив */
@media (max-width: 760px) {
  .work-card { grid-template-columns: 1fr; }
  .work-card__photo { min-height: 220px; aspect-ratio: 4/3; }
  .work-card__info { padding: 20px; gap: 12px; }
  .work-card__price-value { font-size: 1.6rem; }
}

/* ============================================================
   КАРУСЕЛЬ РАБОТ (на главной)
   ============================================================ */
.works-carousel { position: relative; overflow: hidden; }
.works-carousel__track {
  display: flex;
  transition: transform .55s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}
.works-carousel__slide {
  min-width: 100%;
  padding: 4px;
  box-sizing: border-box;
}
.works-carousel__slide .work-card {
  width: 100%;
}

/* Навигация */
.works-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
}
.works-arrows { display: flex; gap: 10px; }

/* ============================================================
   СТРАНИЦА /works — СЕТКА + ФИЛЬТРЫ
   ============================================================ */
.works-page-main {
  padding: 130px 0 80px;
}

.works-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.works-filter {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--dark);
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: .2s;
}
.works-filter:hover { border-color: var(--dark); }
.works-filter.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.works-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
  font-size: 1rem;
}

@media (max-width: 900px) {
  .works-grid { grid-template-columns: 1fr; }
}