@import url('https://fonts.googleapis.com/css2?family=Lora:wght@600;700&display=swap');

:root {
  --bg: radial-gradient(circle at top left, rgba(255, 107, 53, 0.025), transparent 55%),
        radial-gradient(circle at bottom right, rgba(0, 102, 204, 0.035), transparent 55%),
        #f5f7fb;
  --bg-light: #ffffff;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #4a5568;
  --muted: #718096;
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --accent: #0066cc;
  --accent-light: #1e88e5;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --container: min(1200px, 92vw);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

h1 {
  font-family: var(--font-serif);
  font-weight: 700;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-link {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-header .brand-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.5px;
  transition: color 0.2s;
}

.site-header .brand-name:hover {
  color: var(--primary);
}

.site-header .tagline {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* Brand hero */
.brand-hero {
  background:
    linear-gradient(135deg, rgba(255,107,53,0.08) 0%, transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04) 0,
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.04) 0,
      rgba(255,255,255,0.04) 1px,
      transparent 1px,
      transparent 16px
    ),
    #0a1724;
  color: #fff;
  padding: 1.75rem 0;
}

.brand-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.brand-hero-logo {
  height: 56px;
  width: auto;
}

.brand-hero-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.brand-hero-sub {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
}

.btn-on-dark {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}

.btn-on-dark:hover {
  background: var(--primary-dark);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav a:hover {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.1);
}

/* Hero Section */
.hero {
  padding: 7rem 0 8rem;
  background: linear-gradient(160deg, #fefaf8 0%, #ffffff 45%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 4.5vw + 1rem, 3.25rem);
  margin: 0 0 1.5rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 18em;
}

.hero p {
  color: var(--text-secondary);
  margin: 0 0 2rem;
  font-size: 1.125rem;
}

.hero-reassure {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 35em;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

/* Cards */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 18px;
  transition: all 0.3s;
  box-shadow: 0 4px 14px var(--shadow);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(10, 23, 36, 0.045) 0,
      rgba(10, 23, 36, 0.045) 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(10, 23, 36, 0.035) 0,
      rgba(10, 23, 36, 0.035) 1px,
      transparent 1px,
      transparent 16px
    );
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
  border-color: var(--primary);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
  border-color: var(--primary);
}

.card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
}

.card p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.price {
  margin-top: 12px;
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
}

/* Sections */
.services, .advantages {
  padding: 60px 0;
}

.services {
  background: var(--bg-light);
}

.advantages h2, .services h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  margin: 0 0 2.5rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.section-lead {
  text-align: center;
  color: var(--text-secondary);
  margin: -24px 0 40px;
  font-size: 16px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Как мы работаем */
.work-steps {
  padding: 60px 0;
  background: var(--bg-light);
}

.work-steps h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  margin: 0 0 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 16px;
  position: relative;
  padding-top: 48px;
  box-shadow: 0 2px 8px var(--shadow);
}

.step-num {
  position: absolute;
  top: 16px;
  left: 20px;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  line-height: 36px;
  text-align: center;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.step-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Что вы получите */
.result-benefits {
  padding: 60px 0;
}

.result-benefits h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  margin: 0 0 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.result-benefits .section-lead {
  margin-bottom: 40px;
}

.benefit-card h3 {
  font-size: 18px;
}

/* CTA блок */
.cta-block {
  padding: 60px 0;
  background: var(--bg-light);
  text-align: center;
}

.cta-block h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.5vw + 0.5rem, 2rem);
  margin: 0 0 1rem;
  color: var(--text);
  font-weight: 700;
}

.cta-block p {
  color: var(--text-secondary);
  margin: 0 0 24px;
  font-size: 17px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-block-inline {
  margin-top: 48px;
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

/* Наши работы (главная) */
.portfolio-preview {
  padding: 60px 0;
}

.portfolio-preview h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  margin: 0 0 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.portfolio-preview .section-lead {
  margin-bottom: 32px;
}

.portfolio-preview .card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.portfolio-preview .card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

.portfolio-preview .card h3 {
  padding: 16px 20px 8px;
  margin: 0;
  font-size: 18px;
}

.portfolio-preview .card p {
  padding: 0 20px 20px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.portfolio-preview-link {
  text-align: center;
  margin: 32px 0 0;
}

/* Portfolio */
.portfolio .card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.portfolio-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

.portfolio-image-btn:focus,
.portfolio-image-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.portfolio .card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 0;
  transition: opacity 0.2s;
}

.portfolio-image-btn:hover img {
  opacity: 0.9;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    radial-gradient(circle at top right, rgba(255,107,53,0.15), transparent 60%),
    #050d16;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lightbox-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 100%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  color: #fff;
  margin: 0;
  font-size: 16px;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-close:focus,
.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Полупрозрачные уголки по бокам от фото */
.lightbox-prev,
.lightbox-next {
  flex-shrink: 0;
  width: 56px;
  min-height: 140px;
  align-self: stretch;
  max-height: calc(90vh - 40px);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, opacity 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-corner {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-prev {
  order: -1;
  border-radius: 0 20px 20px 0;
  margin-right: 0;
}

.lightbox-next {
  border-radius: 20px 0 0 20px;
  margin-left: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Стрелки влево/вправо — символы в разметке для стабильного отображения */
.lightbox-arrow {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: inherit;
  pointer-events: none;
}

.lightbox-prev .lightbox-arrow {
  transform: none; /* ◀ влево */
}

.lightbox-next .lightbox-arrow {
  transform: none; /* ▶ вправо */
}

.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.lightbox-prev[hidden],
.lightbox-next[hidden] {
  display: none;
}

.portfolio .card h3 {
  padding: 16px 20px 8px;
  margin: 0;
}

.portfolio .card p {
  padding: 0 20px 20px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  background: var(--bg-light);
  padding: 32px 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer strong {
  color: var(--text);
  margin-right: 8px;
}

/* Contact Form */
.form-intro {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 16px;
}

.contact-form {
  margin-top: 0;
  display: grid;
  gap: 16px;
  max-width: 600px;
}

.contact-form .grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

input, textarea {
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

input:focus, textarea:focus,
input:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.consent-label a {
  color: var(--primary);
  text-decoration: underline;
}

.consent-label a:hover {
  color: var(--primary-dark);
}

/* Модальное окно согласия — поверх страницы */
.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.consent-modal.consent-modal-open {
  display: flex;
}

.consent-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 1;
}

.consent-modal-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.consent-modal-content {
  padding: 24px 24px 20px;
  overflow-y: auto;
  flex: 1;
}

.consent-modal-content h2 {
  font-size: 16px;
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.consent-modal-content p,
.consent-modal-content ul {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.consent-modal-content ul {
  padding-left: 20px;
}

.consent-modal-content a {
  color: var(--primary);
  text-decoration: underline;
}

.consent-modal-content .consent-modal-btn-close {
  margin-top: 16px;
}

.consent-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: color 0.2s, background 0.2s;
}

.consent-modal-close:hover {
  color: var(--text);
  background: var(--border);
}

.contacts {
  margin-top: 24px;
}

.contacts p {
  margin: 12px 0;
  font-size: 16px;
  color: var(--text-secondary);
}

.contacts strong {
  color: var(--text);
  margin-right: 8px;
}

.contacts a {
  color: var(--primary);
  text-decoration: underline;
}

.contacts a:hover {
  color: var(--primary-dark);
}

/* Privacy / Policy page */
.privacy-content {
  max-width: 800px;
  padding: 40px 24px;
}

.privacy-content h1 {
  margin-bottom: 16px;
}

.privacy-content h2 {
  font-size: 20px;
  margin: 32px 0 16px;
  color: var(--text);
}

.privacy-content section p,
.privacy-content section ul {
  margin: 8px 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.privacy-content section ul {
  padding-left: 24px;
}

.privacy-content .privacy-back {
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 5rem 0 6rem;
  }

  .hero h1 {
    font-size: clamp(1.5rem, 5vw + 1rem, 2rem);
  }

  .hero p {
    font-size: 1rem;
  }
  
  .contact-form .grid {
    grid-template-columns: 1fr;
  }
  
  .site-header .container {
    flex-direction: column;
    height: auto;
    padding: 16px 24px;
    gap: 16px;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav a {
    margin: 0;
  }
  
  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
  
  .advantages h2, .services h2,
  .work-steps h2, .result-benefits h2,
  .portfolio-preview h2 {
    font-size: 1.75rem;
  }

  .steps-list {
    grid-template-columns: 1fr;
  }

  .cta-block h2 {
    font-size: 1.625rem;
  }

  .brand-logo {
    height: 32px;
  }

  .brand-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-hero-logo {
    height: 48px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 4rem 0 5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 16px;
  }
}

/* =======================
   Chat Widget (FIXED)
   ======================= */

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

/* ---------- Button ---------- */

.chat-button {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
  transition: all 0.3s;
  color: white;
  position: relative;
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid white;
}

/* ---------- Window ---------- */

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.chat-window-open {
  display: flex;
}

/* ---------- Header ---------- */

.chat-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chat-status {
  font-size: 12px;
  opacity: 0.9;
  display: block;
  margin-top: 4px;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Messages ---------- */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.user-message {
  align-self: flex-end;
}

.bot-message {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--border);
}

.user-message .message-content {
  background: var(--primary);
  color: white;
  border: none;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: break-word;
}

.message-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.chat-typing-indicator .typing-text {
  font-style: italic;
  color: var(--muted);
}

/* ---------- Input area ---------- */

.chat-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--border);
}

/* FORM */

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* TEXTAREA ROW */

.chat-input-row {
  width: 100%;
}

.chat-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  min-height: 48px;
  max-height: 240px;
  padding: 12px 16px;

  border: 2px solid var(--border);
  border-radius: 16px;

  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;

  resize: none;
  overflow-y: hidden;

  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.chat-input::placeholder {
  color: var(--muted);
}

.chat-input:focus {
  border-color: var(--primary);
  outline: none;
}

.chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ACTIONS ROW (GRID, НЕ FLEX) */

.chat-actions-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

/* CONSENT */

.chat-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.chat-consent-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
}

.chat-consent-label a {
  color: var(--primary);
  text-decoration: underline;
}

.chat-consent-label a:hover {
  color: var(--primary-dark);
}

.chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  background: var(--primary);
  border: none;
  border-radius: 24px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-send:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.chat-send:active {
  transform: scale(0.95);
}

/* Responsive Chat */
@media (max-width: 640px) {
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    max-height: 600px;
    bottom: 80px;
    right: 0;
  }

  .chat-button {
    width: 56px;
    height: 56px;
  }

  .chat-input-container {
    padding: 12px;
  }

  .chat-input {
    min-height: 48px;
    max-height: 180px;
  }
}


/* Lightbox navigation: big side corners */
/* Кнопки навигации как крупные "уголки" слева/справа поверх фото */
.lightbox-content{
  position: relative;
  flex-wrap: nowrap;
  padding: 0 110px; /* место под уголки, чтобы не перекрывать фото */
}

/* фото под стрелками */
.lightbox-photo-wrap{ position: relative; z-index: 1; }

/* стрелки поверх контента, по центру по вертикали */
.lightbox-prev,
.lightbox-next{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 160px;
  min-height: 0;
  max-height: none;
  align-self: auto;
  z-index: 2;
  opacity: 0.95;
}

/* левый "уголок" — треугольная форма */
.lightbox-prev{
  left: 0;
  border-radius: 0;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

/* правый "уголок" — зеркально */
.lightbox-next{
  right: 0;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* делаем стрелки крупнее */
.lightbox-arrow{
  font-size: 44px;
}

@media (max-width: 640px){
  .lightbox-content{ padding: 0 78px; }
  .lightbox-prev, .lightbox-next{ width: 72px; height: 120px; }
  .lightbox-arrow{ font-size: 34px; }
}
