/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 2rem;
}

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

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.hero-content {
    text-align: center;
    color: white;
    max-width: 800px;
    margin: 0 auto;
}

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

.highlight {
    background: linear-gradient(45deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

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

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    background: var(--bg-secondary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: white;
}

.service-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.service-card ul {
    list-style: none;
    margin-top: 1rem;
}

.service-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.service-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Countries Section */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.country-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.country-flag {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    background-size: cover;
    background-position: center;
    border: none;
}

.country-flag.japan {
    background-image: url('images/japan_round_icon_64.png');
    background-size: cover;
    background-position: center;
}

.country-flag.korea {
    background-image: url('images/korea_south_round_icon_64.png');
    background-size: cover;
    background-position: center;
}

.country-flag.china {
    background-image: url('images/china_round_icon_64.png');
    background-size: cover;
    background-position: center;
}

.country-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.feature {
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Process Section */
.process {
    background: var(--bg-secondary);
}

.process-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.process-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--border-color);
    transform: translateX(-50%);
}

.process-step {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.process-step:nth-child(even) {
    flex-direction: row-reverse;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.step-content {
    flex: 1;
    padding: 0 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    margin: 0 1rem;
}

.process-step:nth-child(even) .step-content {
    text-align: right;
}

/* Gallery Section */
.gallery-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 0 20px; /* Добавляем отступы для мобильных устройств */
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 10;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.gallery-nav:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

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

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

.gallery-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Infinite scroll - buttons always active */
.gallery-nav {
    opacity: 1 !important;
}


.gallery-scroll-indicator {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.8;
}

.gallery-grid {
    display: flex;
    gap: 1.5rem;
    overflow: visible;
    padding: 1rem 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: transform 0.3s ease;
    width: max-content;
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex: 0 0 300px;
    aspect-ratio: 16/9;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

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

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.gallery-overlay p {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.gallery-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contact Section */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-buttons {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand i {
    font-size: 2rem;
    color: var(--accent-color);
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-section ul li i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .contact-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
    }
    
    .process-timeline::before {
        left: 30px;
    }
    
    .process-step {
        flex-direction: row !important;
        padding-left: 60px;
    }
    
    .process-step:nth-child(even) .step-content {
        text-align: left;
    }
    
    .step-number {
        position: absolute;
        left: 0;
    }
    
    .step-content {
        margin: 0;
    }
    
    /* Исправление галереи для мобильных устройств */
    .gallery-container {
        padding: 0 40px; /* Увеличиваем отступы */
    }
    
    .gallery-grid {
        justify-content: center; /* Центрируем элементы */
        padding-left: 0; /* Убираем левый отступ */
    }
    
    .gallery-item {
        flex: 0 0 280px; /* Фиксированная ширина для мобильных */
        margin: 0 10px; /* Добавляем отступы между элементами */
    }
    
    .gallery-nav-prev {
        left: 5px; /* Приближаем кнопки навигации */
    }
    
    .gallery-nav-next {
        right: 5px;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .services-grid,
    .countries-grid {
        grid-template-columns: 1fr;
    }
    
    /* Дополнительные исправления для очень маленьких экранов */
    .gallery-container {
        padding: 0 30px;
    }
    
    .gallery-item {
        flex: 0 0 260px; /* Уменьшаем ширину для маленьких экранов */
        margin: 0 8px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .gallery-nav-prev {
        left: 2px;
    }
    
    .gallery-nav-next {
        right: 2px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error states */
.success {
    color: #059669;
    background: #d1fae5;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.error {
    color: #dc2626;
    background: #fee2e2;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

/* Telegram specific styles */
.fab.fa-telegram {
    color: #1e40af; /* Темно-синий цвет для лучшей видимости */
}

.contact-item a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #0088cc;
}

/* Telegram button hover effect */
.btn:hover .fab.fa-telegram {
    color: white;
}

/* YouTube specific styles */
.fab.fa-youtube {
    color: #ff0000;
}

.btn:hover .fab.fa-youtube {
    color: white;
}

/* WhatsApp specific styles */
.fab.fa-whatsapp {
    color: #25d366;
}

.btn:hover .fab.fa-whatsapp {
    color: white;
}

/* Large button styles */
.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease; /* Плавная анимация для скрытия/показа */
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 525px; /* Увеличено на 50% */
    height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.chat-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    border-color: #667eea;
}

.chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-input button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

/* Message styles for widget */
.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 450px; /* Увеличено до 450px для использования всего пространства */
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.ai-message .message-content {
    background: #f1f5f9;
}

/* Стили для кнопок действий в чате */
.chat-actions {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.chat-actions-title {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.chat-actions-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.chat-action-btn {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease;
    flex: 1;
    max-width: 140px;
    text-decoration: none;
    justify-content: center;
}

.chat-action-btn.telegram {
    background: #0088cc;
}

.chat-action-btn.telegram:hover {
    background: #0078b8;
}

.chat-action-btn.whatsapp {
    background: #25D366;
}

.chat-action-btn.whatsapp:hover {
    background: #20bd5a;
}

/* Responsive design - улучшенная адаптивность */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        max-width: 400px;
        height: 500px;
        bottom: 80px;
        right: 0;
        left: auto;
    }
    
    .message-content {
        max-width: calc(100vw - 140px);
        max-width: 280px;
    }
    
    .chat-actions-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .chat-action-btn {
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
    
    .chat-window {
        width: calc(100vw - 20px);
        max-width: 380px;
        height: 450px;
        bottom: 75px;
        right: 0;
        left: auto;
    }
    
    .message-content {
        max-width: calc(100vw - 120px);
        max-width: 260px;
    }
    
    .chat-header h3 {
        font-size: 15px;
    }
    
    .chat-input input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .chat-actions-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .chat-action-btn {
        max-width: none;
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chat-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .chat-window {
        width: calc(100vw - 20px);
        height: 400px;
        bottom: 70px;
        right: 0;
        left: auto;
        max-width: none;
    }
    
    .message-content {
        max-width: calc(100vw - 100px);
        max-width: 240px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-header h3 {
        font-size: 14px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .chat-input input {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .chat-actions {
        padding: 8px;
    }
    
    .chat-actions-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .chat-action-btn {
        max-width: none;
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .chat-widget {
        bottom: 8px;
        right: 8px;
    }
    
    .chat-toggle {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    
    .chat-window {
        width: calc(100vw - 16px);
        height: 380px;
        bottom: 65px;
        right: 0;
        left: auto;
    }
    
    .message-content {
        max-width: calc(100vw - 90px);
        max-width: 220px;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .chat-header {
        padding: 10px 12px;
    }
    
    .chat-header h3 {
        font-size: 13px;
    }
    
    .chat-messages {
        padding: 8px;
    }
    
    .chat-input-container {
        padding: 8px;
    }
    
    .chat-input input {
        font-size: 16px;
        padding: 8px 10px;
    }
    
    .chat-input button {
        width: 35px;
        height: 35px;
    }
    
    .chat-actions {
        padding: 6px;
    }
    
    .chat-actions-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .chat-action-btn {
        max-width: none;
        width: 100%;
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Очень маленькие экраны iPhone SE */
@media (max-width: 320px) {
    .chat-window {
        width: calc(100vw - 12px);
        height: 350px;
        bottom: 60px;
        right: 0;
        left: auto;
    }
    
    .message-content {
        max-width: calc(100vw - 80px);
        max-width: 200px;
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .chat-header h3 {
        font-size: 12px;
    }
    
    .chat-actions {
        padding: 4px;
    }
    
    .chat-actions-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .chat-action-btn {
        max-width: none;
        width: 100%;
        padding: 6px 10px;
        font-size: 11px;
    }
}