/* ===== CSS Reset и базовые стили ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    /* Сине-голубая цветовая палитра */
    --dark-blue: #0D1B2A;
    --blue: #1B263B;
    --light-blue: #415A77;
    --very-light-blue: #778DA9;
    --accent: #2196F3;
    --accent-light: #64B5F6;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.8);
    
    /* Градиенты */
    --background: linear-gradient(135deg, var(--dark-blue) 0%, var(--blue) 50%, #1A237E 100%);
    --gradient: linear-gradient(135deg, var(--blue), var(--accent), var(--accent-light));
    
    /* Стеклянный эффект */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    
    /* Безопасные зоны для iOS */
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Доступность ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--blue);
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: 8px;
    z-index: 10000;
    transition: top 0.3s ease;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid var(--light-blue);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Фоновое изображение ===== */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fallback для браузеров без поддержки WebP */
    background-image: url('assets/images/background.png');
    background-size: auto;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -3;
    opacity: 0.7;
}

/* WebP версия для поддерживающих браузеров */
@supports (background-image: image-set(url('test.webp') type('image/webp'))) {
    .background-image {
        background-image: 
            image-set(
                url('assets/images/background.webp') type('image/webp'),
                url('assets/images/background.png') type('image/png')
            );
    }
}

/* Мобильная версия - другое фоновое изображение */
@media (max-width: 768px) {
    .background-image {
        /* Fallback для браузеров без поддержки WebP */
        background-image: url('assets/images/background-mobile.jpg');
        background-size: cover;
        background-attachment: scroll;
    }
    
    /* WebP версия для поддерживающих браузеров */
    @supports (background-image: image-set(url('test.webp') type('image/webp'))) {
        .background-image {
            background-image: 
                image-set(
                    url('assets/images/background-mobile.webp') type('image/webp'),
                    url('assets/images/background-mobile.jpg') type('image/jpeg')
                );
        }
    }
}

/* ===== Анимированный логотип ===== */
.header-logo {
    position: fixed;
    top: 15px;
    left: 20px;
    width: 180px;
    height: 60px;
    z-index: 1001;
    pointer-events: none;
}

.header-logo svg {
    width: 100%;
    height: 100%;
}

.text-container text {
    opacity: 0;
    transform: translate(0, 0);
    animation-duration: 0.8s;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
}

.letter-l, .letter-t {
    fill: #64B5F6;
    font-size: 32px !important;
}

.letter-f, .letter-u, .letter-r, .letter-n, .letter-i, 
.letter-t2, .letter-u2, .letter-r2, .letter-e {
    fill: #FFFFFF;
    font-size: 24px !important;
}

/* Анимации для букв */
.letter-l { animation-name: slideInFromLeft; animation-delay: 0s; }
.letter-t { animation-name: slideInFromRight; animation-delay: 0.2s; }
.letter-f { animation-name: flyInFromTop; animation-delay: 0.4s; }
.letter-u { animation-name: flyInFromBottom; animation-delay: 0.5s; }
.letter-r { animation-name: flyInFromLeft; animation-delay: 0.6s; }
.letter-n { animation-name: flyInFromRight; animation-delay: 0.7s; }
.letter-i { animation-name: flyInFromTopLeft; animation-delay: 0.8s; }
.letter-t2 { animation-name: flyInFromTopRight; animation-delay: 0.9s; }
.letter-u2 { animation-name: flyInFromBottomLeft; animation-delay: 1.0s; }
.letter-r2 { animation-name: flyInFromBottomRight; animation-delay: 1.1s; }
.letter-e { animation-name: flyInFromTop; animation-delay: 1.2s; }

.text-container {
    animation: textPulse 8s ease-in-out infinite;
}

/* Keyframes для анимаций */
@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flyInFromTop {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flyInFromBottom {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flyInFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flyInFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes flyInFromTopLeft {
    from { opacity: 0; transform: translate(-30px, -30px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes flyInFromTopRight {
    from { opacity: 0; transform: translate(30px, -30px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes flyInFromBottomLeft {
    from { opacity: 0; transform: translate(-30px, 30px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes flyInFromBottomRight {
    from { opacity: 0; transform: translate(30px, 30px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes textPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
}

/* ===== Стеклянные эффекты ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

/* Fallback для браузеров без backdrop-filter */
@supports not (backdrop-filter: blur(20px)) {
    .glass-card {
        background: rgba(13, 27, 42, 0.9);
    }
}

.glass-button {
    background: rgba(13, 27, 42, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

@supports (backdrop-filter: blur(20px)) {
    .glass-button {
        background: var(--glass-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

.glass-button.primary {
    background: linear-gradient(135deg, var(--blue), var(--accent));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.glass-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 16px;
    color: rgba(13, 27, 42, 0.95);
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
}

@supports (backdrop-filter: blur(10px)) {
    .glass-input {
        backdrop-filter: blur(10px);
    }
}

.glass-input:focus {
    outline: none;
    border-color: var(--light-blue);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(65, 90, 119, 0.1);
}

.glass-input::placeholder {
    color: var(--text-secondary);
}

/* ===== Контейнер ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Шапка ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(13, 27, 42, 0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.header-content {
    display: ruby;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-left: 180px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phone {
    color: white;
    text-decoration: none;
    font-weight: 300;
    padding: 2px 3px;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    padding: 10px 14px;
    color: white;
}

/* ===== Главный баннер ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 50px;
    position: relative;
}

.hero-content {
    padding: 3rem 2rem;
    max-width: 800px;
    position: relative;
}

.hero-badge {
    display: inline-block;
    background: var(--gradient);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.title-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    animation: titleReveal 0.8s forwards;
}

.title-word:nth-child(1) { animation-delay: 0.1s; }
.title-word:nth-child(2) { animation-delay: 0.3s; }
.title-word:nth-child(3) { animation-delay: 0.5s; }

@keyframes titleReveal {
    to { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.hero .btn {
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Секции ===== */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    font-size: 3rem;
    font-weight: 800;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards;
}

.accent-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Особенности ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.feature-card {
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }

.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.feature-card p {
    opacity: 0.8;
    line-height: 1.6;
}

/* ===== Каталоги PDF ===== */
.catalogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.catalog-pdf-item {
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.catalog-pdf-item:hover {
    transform: translateY(-5px);
}

.pdf-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-pdf-item h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.catalog-pdf-item p {
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

/* ===== Галерея ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.catalog-card {
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.catalog-card:nth-child(1) { animation-delay: 0.1s; }
.catalog-card:nth-child(2) { animation-delay: 0.2s; }
.catalog-card:nth-child(3) { animation-delay: 0.3s; }
.catalog-card:nth-child(4) { animation-delay: 0.4s; }

.item-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.image-placeholder {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.catalog-card p {
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.catalog-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.catalog-card:hover .catalog-hover {
    opacity: 1;
}

/* ===== Процесс ===== */
.process-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.process-card {
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    opacity: 0;
    transform: translateX(-50px);
    animation: fadeInUp 0.8s forwards;
}

.process-card:nth-child(even) {
    transform: translateX(50px);
    margin-left: auto;
    flex-direction: row-reverse;
    text-align: right;
}

.process-card:nth-child(1) { animation-delay: 0.1s; }
.process-card:nth-child(2) { animation-delay: 0.2s; }
.process-card:nth-child(3) { animation-delay: 0.3s; }
.process-card:nth-child(4) { animation-delay: 0.4s; }

.step-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 80px;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.step-arrow {
    font-size: 2rem;
    opacity: 0.5;
}

/* ===== Контакты ===== */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.contact-card {
    padding: 3rem 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.contact-card:nth-child(1) { animation-delay: 0.1s; }
.contact-card:nth-child(2) { animation-delay: 0.2s; }
.contact-card:nth-child(3) { animation-delay: 0.3s; }
.contact-card:nth-child(4) { animation-delay: 0.4s; }

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.contact-card a, .contact-card p {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.contact-subtitle {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

.telegram-link, .whatsapp-link {
    color: var(--light-blue) !important;
}

/* ===== Футер ===== */
footer {
    padding: 3rem 0;
}

.footer-content {
    padding: 3rem;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo .logo {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    opacity: 0.7;
}

/* ===== Модальные окна ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.modal-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.full-width {
    width: 100%;
}

/* Согласие на обработку */
.consent-checkbox {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.consent-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ===== Чат-ассистент ===== */
.chat-assistant {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 80%;
    height: 80vh;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    /* Разрешаем прокрутку внутри чата */
    touch-action: none;
}

.chat-assistant.active {
    display: flex;
    transform: translateY(0);
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--light-blue);
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1 1 auto;
    padding: 15px;
    overflow-y: scroll;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* Критично для работы скролла в flex-контейнере на iOS */
    position: relative; /* Важно для правильной работы скролла на iOS */
    /* Разрешаем touch-события для прокрутки */
    touch-action: pan-y;
    /* Убеждаемся, что контейнер может прокручиваться */
    will-change: scroll-position;
    /* Улучшаем инерцию прокрутки на iOS */
    scroll-behavior: smooth;
    /* Увеличиваем чувствительность прокрутки */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(33, 150, 243, 0.6);
    border-radius: 2px;
}

.message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-message {
    align-self: flex-end;
    background: rgba(33, 150, 243, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.message-content {
    white-space: pre-line;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: rgba(13, 27, 42, 0.9);
}

#chatInput {
    flex: 1;
    padding: 12px 15px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    font-size: 16px;
    min-height: 44px;
    /* Предотвращаем изменение viewport при фокусе на Android */
    touch-action: manipulation;
}

#chatInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#sendMessageBtn {
    padding: 12px 20px;
    border-radius: 25px;
    background: rgba(33, 150, 243, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 60px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendMessageBtn:hover {
    background: rgba(33, 150, 243, 0.8);
}

/* Быстрые ответы */
.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.option-btn {
    padding: 12px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.option-btn.selected {
    background: rgba(33, 150, 243, 0.4);
    border-color: var(--light-blue);
}

.option-btn:active {
    transform: scale(0.95);
}

/* Кнопки согласия */
.consent-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.option-btn.agree {
    background: rgba(46, 204, 113, 0.3) !important;
    border-color: rgba(46, 204, 113, 0.5) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    flex: 1;
    min-width: 120px;
}

.option-btn.agree:hover {
    background: rgba(46, 204, 113, 0.4) !important;
    border-color: rgba(46, 204, 113, 0.7) !important;
}

.option-btn.disagree {
    background: rgba(231, 76, 60, 0.3) !important;
    border-color: rgba(231, 76, 60, 0.5) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    flex: 1;
    min-width: 120px;
}

.option-btn.disagree:hover {
    background: rgba(231, 76, 60, 0.4) !important;
    border-color: rgba(231, 76, 60, 0.7) !important;
}

/* Индикатор набора */
.typing-indicator {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    border-radius: 18px;
    color: var(--text-secondary);
    font-style: italic;
}

.typing-dots span {
    animation: typingDots 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDots {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Кнопка открытия чата */
.open-chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    padding: 16px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.5);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.open-chat-btn:hover {
    background: rgba(33, 150, 243, 1) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(33, 150, 243, 0.7);
}

.chat-icon {
    font-size: 1.5rem;
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 1;
    position: relative;
}

.chat-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    animation: pulse 2s infinite;
    display: none;
}

.chat-pulse.active {
    display: block;
}

/* Индикатор шага */
.step-indicator {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== Галерея изображений ===== */
.gallery-modal .modal-content {
    max-width: 98%;
    width: 98%;
    max-height: 98vh;
    margin: 1% auto;
    display: flex;
    flex-direction: column;
}

.gallery-content {
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.gallery-title {
    margin: 0;
    color: var(--light-blue);
    font-size: 1.5rem;
    font-weight: 600;
}

.gallery-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.gallery-fullscreen {
    padding: 8px 12px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.gallery-fullscreen:hover {
    background: rgba(33, 150, 243, 0.3);
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    overflow: visible;
    padding: 0.5rem 2rem;
    min-height: 0;
}

.gallery-main-image-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: visible;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    box-sizing: border-box;
    margin: 0;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    cursor: grab;
    box-sizing: border-box;
}

.gallery-main-image:active {
    cursor: grabbing;
}

.gallery-image {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    transition: transform 0.3s ease, opacity 0.4s ease;
    user-select: none;
    -webkit-user-drag: none;
    display: block !important;
    visibility: visible !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.gallery-image.zoomed {
    cursor: move;
}

.gallery-image-loader {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.gallery-image-loader.active {
    display: block;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    z-index: 100;
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.gallery-nav-btn:hover {
    opacity: 1;
    background: rgba(33, 150, 243, 0.6);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
    left: 20px;
}

.gallery-nav-next {
    right: 20px;
}

.gallery-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 101;
}

.gallery-zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.gallery-zoom-btn:hover {
    opacity: 1;
    background: rgba(33, 150, 243, 0.6);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Мобильная версия галереи */
@media (max-width: 768px) {
    .gallery-modal .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .gallery-content {
        border-radius: 0;
        padding: 0;
    }
    
    .gallery-header {
        padding: 1rem;
    }
    
    .gallery-title {
        font-size: 1.2rem;
    }
    
    .gallery-container {
        padding: 1rem;
    }
    
    .gallery-main-image-wrapper {
        min-height: 50vh;
        height: 50vh;
        max-height: 60vh;
    }
    
    .gallery-image {
        max-width: 95vw;
        max-height: 50vh;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .gallery-nav-prev {
        left: 10px;
    }
    
    .gallery-nav-next {
        right: 10px;
    }
    
    .gallery-zoom-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .gallery-zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .gallery-thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .gallery-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .gallery-footer-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .gallery-prev.small, .gallery-next.small {
        flex: 1;
    }
}

.gallery-thumbnails-wrapper {
    flex-shrink: 0;
    padding: 10px 0;
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(33, 150, 243, 0.5);
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: rgba(33, 150, 243, 0.7);
}

.gallery-thumbnail {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    position: relative;
}

.gallery-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:hover {
    opacity: 0.8;
    transform: translateY(-5px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-thumbnail.active {
    opacity: 1;
    transform: translateY(-5px) scale(1.1);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.4);
}

.gallery-thumbnail.active::before {
    opacity: 1;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-thumbnail:hover img {
    transform: scale(1.1);
}

.gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.gallery-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gallery-counter {
    color: var(--light-blue);
    font-weight: 600;
    font-size: 1.1rem;
}

.gallery-image-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.gallery-footer-actions {
    display: flex;
    gap: 1rem;
}

.gallery-prev, .gallery-next {
    padding: 10px 20px;
    min-width: 120px;
}

.gallery-prev.small, .gallery-next.small {
    padding: 8px 16px;
    min-width: 100px;
    font-size: 0.9rem;
}

/* Полноэкранный режим */
.gallery-modal.fullscreen .gallery-content {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    margin: 0;
    border-radius: 0;
}

.gallery-modal.fullscreen .gallery-main-image-wrapper {
    min-height: calc(100vh - 200px);
    height: calc(100vh - 200px);
    padding: 20px;
}

.gallery-modal.fullscreen .gallery-image {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 220px);
}

/* ===== PDF Просмотрщик ===== */
.pdf-modal .modal-content {
    max-width: 90%;
    width: 90%;
    max-height: 90vh;
    margin: 5% auto;
}

.pdf-viewer-content {
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
}

.pdf-container {
    width: 100%;
    height: 70vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

#pdfCanvasContainer {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

#pdfCanvas {
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background: white;
}

#pdfPageControls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 25px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 2010;
    pointer-events: auto;
}

/* Скрываем кнопки когда модальное окно закрыто */
.pdf-modal:not(.active) #pdfPageControls {
    display: none !important;
}

#pdfPageInfo {
    color: white;
    margin: 0 15px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.pdf-fallback-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(13, 27, 42, 0.9);
    padding: 2rem;
    border-radius: 12px;
    width: 80%;
}

/* Индикатор загрузки для PDF/HTML */
.pdf-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(13, 27, 42, 0.95);
    padding: 2rem;
    border-radius: 12px;
    width: 80%;
    max-width: 400px;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pdf-loading-indicator p {
    margin: 10px 0;
    color: var(--text-primary);
}

.pdf-loading-indicator button {
    margin-top: 15px;
}

/* ===== Сообщения ===== */
.error-message {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: 10px;
    padding: 10px 15px;
    margin: 10px 0;
    color: #ff6b6b;
}

.success-message {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
}

.success-message h3 {
    color: #27ae60;
    margin-bottom: 10px;
}

.form-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    z-index: 10000;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.form-message.error {
    background: #e74c3c;
}

.form-message.success {
    background: #27ae60;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== Анимации только на десктопе ===== */
@media (min-width: 1024px) {
    .glass-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    }
    
    .animated-button:hover .btn-arrow {
        transform: translateX(4px);
    }
    
    .glass-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .glass-button:hover::before {
        left: 100%;
    }
    
    .glass-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        transition: left 0.6s;
    }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Убираем сложные анимации на мобильных */
    .text-container,
    .floating-shape {
        display: none !important;
    }
    
    .header-logo {
        width: 140px;
        height: 50px;
        top: 10px;
        left: 10px;
    }
    
    .logo {
        margin-left: 140px;
        font-size: 1.3rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(13, 27, 42, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1rem;
        border-top: 1px solid var(--glass-border);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
        order: 2; /* Меню справа */
    }
    
    .header-actions .phone {
        order: 1; /* Телефон слева */
    }
    
    .header-actions .phone span:not(.phone-icon) {
        display: none;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 3rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .process-card {
        flex-direction: column !important;
        text-align: center !important;
        transform: translateY(30px) !important;
    }
    
    .step-arrow {
        display: none;
    }
    
    .footer-main {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .features, .gallery, .contact-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Мобильные карточки */
    .hero-content {
        padding: 2rem 1.5rem;
    }
    
    .feature-card, .catalog-card, .contact-card {
        padding: 2rem 1.5rem;
    }
    
    .catalog-pdf-item {
        padding: 2rem 1.5rem;
    }
    
    /* Мобильная галерея */
    .gallery-modal .modal-content {
        max-width: 95%;
        width: 95%;
        margin: 2% auto;
        padding: 1rem;
    }
    
    .gallery-main-image {
        height: 300px;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Мобильный PDF */
    .pdf-modal .modal-content {
        max-width: 95%;
        width: 95%;
        margin: 2% auto;
    }
    
    .pdf-container {
        height: 72vh;
    }
    
    /* Сообщения на мобильных */
    .form-message {
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-logo {
        width: 120px;
        height: 40px;
    }
    
    .logo {
        margin-left: 120px;
        font-size: 1.1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 1.5rem 1rem;
    }
    
    .feature-card, .catalog-card, .contact-card {
        padding: 1.5rem 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .chat-assistant {
        height: 85vh;
        max-height: 85vh;
    }
    
    .chat-messages {
        padding: 12px;
        min-height: 0; /* Важно для скролла на мобильных */
        flex: 1 1 auto;
        overflow-y: scroll;
        touch-action: pan-y;
    }
    
    .message {
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .chat-input-container {
        padding: 12px;
    }
    
    .options-container {
        gap: 6px;
    }
    
    /* Скрываем лишние кнопки в галерее на мобильных (оставляем только закрыть) */
    .gallery-fullscreen {
        display: none !important;
    }
    
    .gallery-nav-btn {
        display: none !important;
    }
    
    .gallery-zoom-controls {
        display: none !important;
    }
    
    .gallery-footer-actions {
        display: none !important;
    }
    
    .option-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 2% auto;
        max-height: 96vh;
        width: 95%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .modal-content form {
        gap: 1rem;
    }
    
    .close {
        right: 1rem;
        top: 1rem;
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }
}

/* iOS специфичные фиксы */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
    
    .chat-assistant {
        height: calc(80vh - env(safe-area-inset-bottom));
        max-height: calc(80vh - env(safe-area-inset-bottom));
    }
    
    .chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        /* Дополнительные настройки для iOS скролла */
        overscroll-behavior-y: contain !important;
        position: relative !important;
        touch-action: pan-y !important;
        /* Убеждаемся, что контейнер имеет высоту для прокрутки */
        will-change: scroll-position;
        /* Улучшаем инерцию прокрутки */
        scroll-behavior: smooth;
        /* Увеличиваем momentum scrolling */
        -webkit-overflow-scrolling: touch;
    }
    
    .chat-input-container {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Предотвращает зум на iOS */
    }
    
    #chatInput {
        font-size: 16px !important;
    }
}

/* Ландшафтный режим */
@media (max-height: 500px) and (orientation: landscape) {
    .chat-assistant {
        height: 95vh;
        max-height: 95vh;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message {
        padding: 8px 12px;
        max-width: 95%;
    }
    
    .hero {
        min-height: 120vh;
    }
}

/* ===== Утилиты ===== */
.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
}

.animated-button {
    position: relative;
    overflow: hidden;
}

.animated-button .btn-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

/* Print стили */
@media print {
    .chat-assistant, .open-chat-btn, .menu-toggle, .header-logo {
        display: none !important;
    }
    
    .glass-card {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* Анимации при скролле */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===== КОМПАКТНЫЙ ЧАТ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 1025px) {
    .chat-assistant {
        width: 380px !important;
        height: 500px !important;
        max-height: 500px !important;
        border-radius: 16px !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    }
    
    .chat-header {
        padding: 12px 16px !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .chat-header h3 {
        font-size: 1rem !important;
    }
    
    .chat-messages {
        padding: 10px 12px !important;
        font-size: 0.9rem;
    }
    
    .message {
        max-width: 90% !important;
        padding: 8px 12px !important;
        margin-bottom: 6px !important;
    }
    
    .message-content {
        font-size: 0.9rem;
    }
    
    .options-container {
        gap: 6px !important;
        margin-top: 6px !important;
    }
    
    .option-btn {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        min-height: 36px !important;
        border-radius: 16px !important;
    }
    
    .chat-input-container {
        padding: 10px 12px !important;
        border-radius: 0 0 16px 16px !important;
    }
    
    #chatInput {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        min-height: 36px !important;
    }
    
    #sendMessageBtn {
        padding: 8px 14px !important;
        min-width: 50px !important;
        min-height: 36px !important;
        font-size: 0.9rem !important;
    }
    
    .progress-bar {
        height: 3px !important;
        margin-top: 6px !important;
    }
    
    .step-indicator {
        font-size: 0.7rem !important;
        margin-top: 6px !important;
    }
    
    .typing-indicator {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
}