/* =================================================================== */
/* 1. ШРИФТЫ И ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ */
/* =================================================================== */

@font-face {
  font-family: 'Sansation';
  src: url('fonts/sansation_light.woff2') format('woff2'),
       url('fonts/sansation_light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Sansation';
  src: url('fonts/sansation_regular.woff2') format('woff2'),
       url('fonts/sansation_regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Sansation';
  src: url('fonts/sansation_bold.woff2') format('woff2'),
       url('fonts/sansation_bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    --bg-light: #f7f9f2;
    --primary-color: #333A45;
    --secondary-color: #D1D5DB;
    --accent-red: #f23942;
    --dark-red: #941d26;
    --text-dark: #2d2d2d;
    --text-light: #fff;
    --font-heading: 'Sansation', sans-serif;
    --font-body: 'Sansation', sans-serif;
    --shadow: 0 10px 30px rgba(51, 58, 69, 0.1);
    --subtle-gradient: linear-gradient(180deg, #fff 0%, #f9fbf4 100%);
    --accent-gradient: linear-gradient(45deg, var(--accent-red), #ff6b73);
}

/* =================================================================== */
/* 2. БАЗОВЫЕ СТИЛИ */
/* =================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ИСПРАВЛЕНИЕ 1: Добавляем overflow-x: hidden для тега <html> */
/* Это гарантирует, что никакой элемент не сможет создать горизонтальную прокрутку на всей странице. */
html, body {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--text-dark);
    background-color: #fff;
    font-weight: 400;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
    font-weight: 700;
}
h3 {font-size: 26px; margin-bottom: 30px;}
h4 {font-size: 20px; margin-bottom: 20px;}

/* =================================================================== */
/* 3. ШАПКА И НАВИГАЦИЯ */
/* =================================================================== */

.main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    padding: 20px 0;
    background-color: transparent; 
}
.main-header.scrolled {
    background-color: rgba(30, 35, 40, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 15px 0;
}
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo .name {
    font-size: 24px;
    font-weight: bold;
    color: #fff; /* Добавил цвет, т.к. на белом фоне не видно */
}

.logo .subtitle {
    font-size: 16px;
    font-weight: normal;
    color: #f2f2f2;
    letter-spacing: 1px;
}
.nav-links { display: flex; list-style: none; gap: 40px; align-items: center; }
.nav-links li a { color: var(--text-light); text-decoration: none; font-size: 1rem; padding: 10px 0; position: relative; transition: color 0.3s ease; }
.nav-links li a::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background-color: var(--accent-red); transition: width 0.3s ease; }
.nav-links li a:hover::after, .nav-links li a.active-link::after { width: 100%; }
.nav-links li a.active-link { color: #fff; }
.nav-button { background-color: transparent; border: 1px solid var(--text-light); border-radius: 50px; text-decoration: none; color: var(--text-light); padding: 8px 24px; transition: all 0.3s ease; }
.nav-button:hover { background-color: var(--text-light); color: var(--primary-color); }
.hamburger { display: none; cursor: pointer; z-index: 10; }
.hamburger span { display: block; width: 25px; height: 3px; margin: 5px 0; background-color: var(--text-light); transition: all 0.3s ease-in-out; }

/* =================================================================== */
/* 4. БЛОК 1: ПЕРВЫЙ ЭКРАН (HERO) */
/* =================================================================== */

.hero-section {
    height: 100vh;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: relative;
    background: url('https://kosmopt.ru/img/bg_girl.jpg') no-repeat center center/cover;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, rgba(20, 20, 20, 0.7), rgba(20, 20, 20, 0.2));
}
.hero-section .container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.hero-content {
    max-width: 60%;
    margin-top: 40px;
}
.hero-content h1 {
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 20px;
    animation: fadeInDown 1s ease-out 0.2s both;
}
.hero-content .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 300;
    animation: fadeInDown 1s ease-out 0.4s both;
}
.hero-content .primary-button {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* =================================================================== */
/* 5. ОБЩИЕ КОМПОНЕНТЫ И СЕКЦИИ */
/* =================================================================== */

.content-section { padding: 100px 0; }
.alt-bg { background: var(--subtle-gradient); }
.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 20px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    margin: 20px auto 60px;
}
.section-title span {
    display: block;
    font-family: var(--font-body);
    font-size: 1rem;
    color: #999;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.cta-button {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.primary-button {
    background: var(--accent-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(242, 57, 66, 0.4);
}
.primary-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(148, 29, 38, 0.5), 0 0 25px rgba(242, 57, 66, 0.4);
}
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =================================================================== */
/* 6. СТИЛИ ДЛЯ КОНКРЕТНЫХ БЛОКОВ */
/* =================================================================== */

/* -- БЛОК "ПРОБЛЕМЫ" -- */
.problems-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.problem-card {
    background: #fff; padding: 30px; text-align: center; border-radius: 15px;
    transition: all 0.4s ease; position: relative; z-index: 1; border: 1px solid #eee;
}
.problem-card::before {
    content: ''; position: absolute; top: -2px; left: -2px;
    width: calc(100% + 4px); height: calc(100% + 4px);
    background: var(--accent-gradient); border-radius: 17px;
    z-index: -1; opacity: 0; transition: opacity 0.4s ease;
}
.problem-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); border-color: transparent; }
.problem-card:hover::before { opacity: 1; }
.problem-card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 15px; }
.problem-card h4 { font-size: 1.8rem; } /* Был h3, но в HTML у вас h4 */

/* -- БЛОК "РЕШЕНИЯ" -- */
.solution-item { display: flex; align-items: center; gap: 60px; margin-bottom: 80px; }
.solution-item.reverse { flex-direction: row-reverse; }
.solution-image { flex: 1; }
.solution-image img { width: 100%; border-radius: 15px; box-shadow: var(--shadow); display: block; /* Убирает нижний отступ у картинки */ }
.solution-text { flex: 1; }

/* -- БЛОК "ГАЛЕРЕЯ" -- */
.portfolio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; }
.portfolio-item { position: relative; overflow: hidden; border-radius: 15px; box-shadow: var(--shadow); aspect-ratio: 1 / 1; cursor: pointer; }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.portfolio-item:hover img { transform: scale(1.1); }
.portfolio-item::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.8) 50%, transparent 70%);
    background-size: 200% 100%; background-position: -200% 0;
    opacity: 0; transition: opacity 0.4s ease; animation: shimmer 2s linear infinite; 
}
.portfolio-item:hover::after { opacity: 1; }
@keyframes shimmer { to { background-position: 200% 0; } }

/* -- БЛОК "ЦЕНЫ" -- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.pricing-card {
    background: linear-gradient(160deg, #ffffff, #fdfdfd); padding: 40px; border-radius: 15px; text-align: center;
    border: 1px solid #eee; transition: all 0.3s ease; position: relative; 
    /* ИСПРАВЛЕНИЕ 2: Ставим overflow: hidden на все карточки */
    /* Это предотвратит "вылезание" значка "Популярно" за пределы карточки, что могло вызывать прокрутку. */
    overflow: hidden; 
}
.pricing-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); }
.card-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 20px; }
.price { font-size: 2rem; font-family: var(--font-heading); color: var(--primary-color); margin: 20px 0; }
.card-button { background-color: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.card-button:hover { background-color: var(--primary-color); color: white; }
.pricing-card.popular { border: 2px solid transparent; position: relative; background-clip: padding-box; }
.pricing-card.popular::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -2px; border-radius: inherit; background: var(--accent-gradient); }
.popular-badge { position: absolute; top: 15px; right: -30px; background: var(--accent-red); color: white; padding: 5px 30px; transform: rotate(45deg); font-size: 0.8rem; font-weight: 700; }

/* -- БЛОК "АКЦИЯ" -- */
.promo-section { background: var(--accent-gradient); color: var(--text-light); text-align: center; padding: 80px 0; }
.promo-section h2 { color: var(--text-light); font-size: 2.5rem; }
.promo-button { background-color: var(--bg-light); color: var(--dark-red); margin-top: 20px; }
.promo-button:hover { background-color: #fff; transform: translateY(-3px); }

/* -- БЛОК "ФОРМА ЗАПИСИ" -- */
.cta-container { text-align: center; max-width: 700px; margin: 0 auto; }
.booking-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 30px; }
.booking-form input { padding: 15px; font-size: 1rem; border: 1px solid #ccc; border-radius: 50px; flex: 1 1 250px; background-color: var(--bg-light); }
.booking-form button { flex-basis: 100%; }

/* =================================================================== */
/* 7. ФУТЕР И ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ */
/* =================================================================== */

.footer { background: var(--primary-color); color: var(--text-light); text-align: center; padding: 20px 0; }

.scroll-to-top {
    position: fixed; bottom: 25px; right: 25px; /* Изменил bottom для лучшего вида */
    width: 50px; height: 50px;
    background: #2d2d2d; color: var(--text-light);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 998; cursor: pointer; text-decoration: none;
    opacity: 0; visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.scroll-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(148, 29, 38, 0.5), 0 0 15px rgba(242, 57, 66, 0.4);
    color: var(--text-light);
}

/* =================================================================== */
/* 8. АДАПТИВНОСТЬ (MEDIA QUERIES) */
/* =================================================================== */

@media (max-width: 992px) {
    .nav-links {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background-color: rgba(30, 30, 35, 0.98); backdrop-filter: blur(10px);
        flex-direction: column; justify-content: center; align-items: center;
        gap: 50px; transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
        padding-bottom: 80px; /* Добавляем отступ для комфорта */
    }
    .nav-links.active { transform: translateY(0); }
    .nav-links li a { font-size: 1.5rem; }
    .nav-button { display: none; }
    .hamburger { display: block; }
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .content-section { padding: 80px 0; }
    .hero-content { max-width: 100%; text-align: center; }
    .hero-content h1 { font-size: 2.5rem; }
    .section-title { font-size: 2.2rem; }
    .solution-item, .solution-item.reverse { flex-direction: column; gap: 30px; }
    .pricing-grid { grid-template-columns: 1fr; }
    .booking-form button { width: 100%; }
    .scroll-to-top {
         bottom: 20px; right: 20px;
         width: 45px; height: 45px;
         font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .problems-grid { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .booking-form input { flex-basis: 100%; }
    .booking-form button { margin-top: 0; }
}
/* =================================================================== */
/* 9. СТИЛИ ДЛЯ JAVASCRIPT-АНИМАЦИЙ */
/* =================================================================== */

/* Начальное состояние для секций, которые должны появиться */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Конечное состояние, которое добавляет JS */
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}
#ai-widget-container-6 #chat-credit {
        text-align: center;
        font-size: 11px;
        padding: 6px 0;
        color: #888;
        background: #f9f9f9;
        border-top: 1px solid #ddd;
    }
#ai-widget-container-6    #chat-credit a {
        color: #888;
        text-decoration: none;
    }
#ai-widget-container-6    #chat-credit a:hover {
        text-decoration: underline;
        color: #555;
    }
    
    
    /* --- Стилизация основной кнопки чата --- */
#ai-widget-container-6 #chat-toggle {
    background-color: #C71585; /* Ярко-пурпурный */
}

/* --- Стилизация виджета --- */

/* Меняем цвет шапки чата */
#ai-widget-container-6 #chat-header {
    background-color: #DB7093; /* Бледно-фиолетовый */
}

/* Меняем цвет кнопки "Отправить" и сообщений пользователя */
#ai-widget-container-6 #send-btn,
#ai-widget-container-6 .ai-widget-message.ai-widget-user  {
    background-color: #C71585; /* Ярко-пурпурный */
}