/* =========================================================
   ДЕМО-БЛОКИ ДЛЯ СТРАНИЦ ПРИМЕРОВ
   ========================================================= */

/* ---------- Галерея ---------- */
.gallery-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery-demo__item { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #00b862 0%, #00e07a 100%); transition: transform var(--transition), box-shadow var(--transition); cursor: zoom-in; text-decoration: none; }
.gallery-demo__item:nth-child(2) { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.gallery-demo__item:nth-child(3) { background: linear-gradient(135deg, #064e3b 0%, #00b862 100%); }
.gallery-demo__item:nth-child(4) { background: linear-gradient(135deg, #00e07a 0%, #7dffb0 100%); }
.gallery-demo__item:nth-child(5) { background: linear-gradient(135deg, #10b981 0%, #00b862 100%); }
.gallery-demo__item:nth-child(6) { background: linear-gradient(135deg, #0b2418 0%, #00b862 100%); }
.gallery-demo__item span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700; color: rgba(4, 20, 12, .75); }
.gallery-demo__item:hover { transform: scale(1.05); box-shadow: 0 20px 40px rgba(4, 20, 12, 0.15); }

/* Плитки галереи внутри .article__body не должны наследовать underline и transition: color от ссылок */
.article__body a.gallery-demo__item,
.article__body a.gallery-demo__item:hover,
.article__body a.gallery-demo__item:focus { transition: transform var(--transition), box-shadow var(--transition); }
.article__body .gallery-demo__item,
.article__body .gallery-demo__item:hover,
.article__body .gallery-demo__item:focus { text-decoration: none; color: inherit; }

/* ---------- Лайтбокс ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(2, 8, 5, .88); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 40px; }
.lightbox.is-open { display: flex; }
.lightbox__img { width: 70vw; height: 70vh; max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 64px; font-weight: 800; color: rgba(4, 20, 12, .75); cursor: pointer; user-select: none; background: linear-gradient(135deg, #00b862 0%, #00e07a 100%); }
.lightbox__close { position: absolute; top: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .1); color: #fff; font-size: 24px; cursor: pointer; transition: background .2s; z-index: 3; display: flex; align-items: center; justify-content: center; }
.lightbox__close:hover { background: rgba(255, 255, 255, .2); }
.lightbox__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .12); color: #fff; font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; transition: background .2s, transform .2s; display: flex; align-items: center; justify-content: center; z-index: 3; }
.lightbox__arrow:hover { background: rgba(255, 255, 255, .22); }
.lightbox__arrow:active { transform: translateY(-50%) scale(.94); }
.lightbox__arrow--prev { left: 24px; }
.lightbox__arrow--next { right: 24px; }
.lightbox__counter { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); padding: 6px 14px; background: rgba(0, 0, 0, .5); border-radius: 100px; color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .08em; font-family: 'JetBrains Mono', monospace; z-index: 3; }

/* ---------- Карусель ---------- */
.carousel-demo { position: relative; overflow: hidden; border-radius: 12px; }
.carousel-demo__track { display: flex; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.carousel-demo__slide { min-width: 100%; height: 220px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: #041208; }
.carousel-demo__slide:nth-child(1) { background: linear-gradient(135deg, #00e07a, #7dffb0); }
.carousel-demo__slide:nth-child(2) { background: linear-gradient(135deg, #00b862, #00e07a); }
.carousel-demo__slide:nth-child(3) { background: linear-gradient(135deg, #047857, #10b981); }
.carousel-demo__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.carousel-demo__btn { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); transition: all var(--transition); }
.carousel-demo__btn:hover { background: var(--accent-soft); color: var(--accent); border-color: #b6f0cf; }

/* ---------- Календарь ---------- */
.calendar-demo { display: flex; flex-direction: column; gap: 14px; }
.calendar-demo__days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calendar-demo__day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; background: var(--bg-soft); border: 1.5px solid transparent; border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); transition: all var(--transition); }
.calendar-demo__day:hover { border-color: #b6f0cf; }
.calendar-demo__day.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.calendar-demo__week { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.calendar-demo__num { font-size: 16px; font-weight: 800; }
.calendar-demo__times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calendar-demo__time { padding: 10px; background: var(--bg-soft); border: 1.5px solid transparent; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); transition: all var(--transition); }
.calendar-demo__time:hover:not(:disabled) { border-color: #b6f0cf; }
.calendar-demo__time.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.calendar-demo__time:disabled { opacity: .4; cursor: not-allowed; }
.calendar-demo__result { padding: 12px 16px; background: var(--accent-soft); border-radius: 10px; color: #067a44; font-weight: 600; font-size: 14px; }
.calendar-demo__result strong { color: #041208; font-weight: 800; }

/* ---------- Мультиязычность ---------- */
.lang-demo { padding: 8px; }
.lang-demo__switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 20px; }
.lang-demo__btn { padding: 8px 16px; font-weight: 700; font-size: 13px; border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink-soft); font-family: inherit; transition: all var(--transition); }
.lang-demo__btn.is-active { background: #fff; color: var(--accent); box-shadow: 0 2px 6px rgba(4, 20, 12, .06); }
.lang-demo__title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: var(--ink); }
.lang-demo__text { font-size: 15px; color: var(--ink-soft); margin-bottom: 16px; }
.lang-demo__link { font-size: 14px; font-weight: 700; color: var(--accent); transition: color .2s; }
.lang-demo__link:hover { color: var(--accent-2); }

/* ---------- Калькулятор ---------- */
.calc-demo { display: flex; flex-direction: column; gap: 22px; }
.calc-demo__field { display: flex; flex-direction: column; gap: 10px; }
.calc-demo__label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-muted); }
.calc-demo__label strong { font-size: 16px; font-weight: 800; color: var(--accent); letter-spacing: 0; text-transform: none; }
.calc-demo__hint { font-size: 12px; color: var(--ink-muted); margin-top: -2px; }

/* Карточки типа сайта */
.calc-demo__types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-demo__type { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: all var(--transition); }
.calc-demo__type input { position: absolute; opacity: 0; pointer-events: none; }
.calc-demo__type:hover { border-color: #b6f0cf; transform: translateY(-2px); }
.calc-demo__type:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 8px 20px rgba(0, 224, 122, .18); }
.calc-demo__type-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-soft); color: var(--ink-soft); transition: all var(--transition); }
.calc-demo__type:has(input:checked) .calc-demo__type-icon { background: var(--accent); color: #041208; }
.calc-demo__type-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.calc-demo__type-price { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.calc-demo__type:has(input:checked) .calc-demo__type-price { color: #067a44; }

/* Слайдеры */
.calc-demo__range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 100px; background: var(--line); outline: none; cursor: pointer; }
.calc-demo__range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 224, 122, .4); cursor: pointer; transition: transform .15s ease; }
.calc-demo__range::-webkit-slider-thumb:hover { transform: scale(1.1); }
.calc-demo__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 224, 122, .4); cursor: pointer; }

/* Итоговая сводка */
.calc-demo__summary { margin-top: 4px; padding: 18px 20px; background: linear-gradient(135deg, #041208 0%, #0b2418 100%); border-radius: 14px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.calc-demo__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; color: rgba(255, 255, 255, .65); }
.calc-demo__row span:last-child { color: #fff; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.calc-demo__total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; margin-top: 4px; border-top: 1px solid rgba(0, 255, 136, .16); font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.calc-demo__total strong { font-size: 28px; font-weight: 800; color: #7dffb0; letter-spacing: -.02em; }

/* ---------- Оплата ---------- */
.pay-demo { display: flex; flex-direction: column; gap: 16px; max-width: 380px; margin: 0 auto; }
.pay-demo__head { text-align: center; }
.pay-demo__label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.pay-demo__amount { font-size: 40px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1; margin-top: 6px; }
.pay-demo__item { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; background: var(--bg-soft); border-radius: 12px; }
.pay-demo__item strong { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pay-demo__item span { font-size: 13px; color: var(--ink-muted); }
.pay-demo__note { font-size: 12.5px; color: var(--ink-muted); text-align: center; }

/* ---------- CRM ---------- */
.crm-demo { padding: 8px; }
.crm-demo__title { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.crm-demo__text { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.55; }
.crm-demo__form { display: flex; flex-direction: column; gap: 10px; }
.crm-demo__form input,
.crm-demo__form textarea { width: 100%; padding: 12px 14px; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: all var(--transition); }
.crm-demo__form input:focus,
.crm-demo__form textarea:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 224, 122, .12); }
.crm-demo__form textarea { resize: vertical; }
.crm-demo__result { padding: 12px 16px; background: var(--accent-soft); border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #067a44; }

@media (max-width: 640px) {
  .gallery-demo { grid-template-columns: repeat(2, 1fr); }
  .calendar-demo__days { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .calendar-demo__times { grid-template-columns: repeat(3, 1fr); }
  .lightbox { padding: 16px; }
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__img { width: 88vw; height: 68vh; font-size: 48px; }
  .lightbox__arrow { width: 42px; height: 42px; font-size: 18px; }
  .lightbox__arrow--prev { left: 10px; }
  .lightbox__arrow--next { right: 10px; }
  .lightbox__counter { top: 16px; font-size: 12px; padding: 5px 12px; }
  .calc-demo__types { grid-template-columns: 1fr; }
  .calc-demo__total strong { font-size: 22px; }
}
