/**
 * MotoStop - Основные стили
 * Цвета подтягиваются из CSS-переменных (устанавливаются из config)
 */

/* ====== CSS ПЕРЕМЕННЫЕ (будут перезаписаны из JS) ====== */
:root {
    --color-primary: #F26A00;
    --color-secondary: #FFA500;
    --color-accent: #E30613;
    --color-dark: #8B4513;
    --color-white: #FFFFFF;
    --color-light-gray: #F5F5F5;
    --color-dark-gray: #333333;
    
    /* Типографика */
    --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Oswald', 'Impact', sans-serif;
    
    /* Размеры */
    --header-height: 80px;
    --container-width: 1200px;
    --border-radius: 8px;
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    /* Переходы */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ====== СБРОС СТИЛЕЙ ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark-gray);
    background-color: var(--color-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* ====== КОНТЕЙНЕР ====== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ====== ШАПКА ====== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.header.scrolled {
    height: 60px;
    box-shadow: var(--shadow-md);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header__logo img {
    height: 50px;
    width: auto;
    transition: transform var(--transition-fast);
}

.header__logo:hover img {
    transform: scale(1.05);
}

/* ====== НАВИГАЦИЯ ====== */
.nav {
    display: flex;
    align-items: center;
}

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

.nav__item {
    position: relative;
}

.nav__link {
    display: block;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-dark-gray);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.nav__link:hover,
.nav__link.active {
    color: var(--color-white);
    background: var(--color-primary);
}

/* Выпадающее меню */
.nav__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    z-index: 100;
    padding: 8px 0;
}

.nav__item:hover .nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav__dropdown-link {
    display: block;
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--color-dark-gray);
    transition: all var(--transition-fast);
}

.nav__dropdown-link:hover {
    background: var(--color-light-gray);
    color: var(--color-primary);
    padding-left: 24px;
}

/* Стрелка для dropdown */
.nav__link--dropdown::after {
    content: '▼';
    font-size: 0.6rem;
    margin-left: 6px;
    transition: transform var(--transition-fast);
}

.nav__item:hover .nav__link--dropdown::after {
    transform: rotate(180deg);
}

/* ====== КОНТАКТЫ В ШАПКЕ ====== */
.header__contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    position: relative;
    padding-right: 10px; /* Место для увеличения кнопки */
}

.header__phone {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-dark-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn--call {
    background: var(--color-accent);
    color: var(--color-white) !important;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    transition: all var(--transition-fast);
}

.btn--call:hover {
    background: #c00510;
    transform: scale(1.05);
    color: var(--color-white) !important;
}

.header__address {
    font-size: 0.75rem;
    color: #666;
    transition: all var(--transition-normal);
    opacity: 1;
    max-height: 20px;
    overflow: hidden;
}

/* При скролле адрес плавно исчезает */
.header.scrolled .header__address {
    opacity: 0;
    max-height: 0;
    margin-top: -5px;
}

/* ====== БУРГЕР МЕНЮ (МОБИЛКА) ====== */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.burger__line {
    width: 28px;
    height: 3px;
    background: var(--color-dark-gray);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.burger.active .burger__line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger.active .burger__line:nth-child(2) {
    opacity: 0;
}

.burger.active .burger__line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ====== ОСНОВНОЙ КОНТЕНТ ====== */
main {
    flex: 1;
    margin-top: var(--header-height);
    padding: 40px 0;
}

/* ====== HERO СЕКЦИЯ ====== */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 30px 30px;
    opacity: 0.5;
}

.hero__content {
    position: relative;
    z-index: 1;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero__subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero__buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero__buttons .btn {
    min-width: 200px;
    text-align: center;
}

/* ====== КНОПКИ ====== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn--primary:hover {
    background: #c00510;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--color-white);
}

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

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

.btn--outline {
    background: transparent;
    border: 2px solid currentColor;
    color: var(--color-white);
}

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

/* ====== СЕКЦИИ ====== */
.section {
    padding: 60px 0;
}

.section--gray {
    background: var(--color-light-gray);
}

.section__title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--color-dark);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section__title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ====== КАРТОЧКИ УСЛУГ ====== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--color-primary);
}

.service-card__icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.service-card__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-dark);
    margin-bottom: 15px;
}

.service-card__text {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.7;
}

/* ====== ПОДВАЛ ====== */
.footer {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer__section h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--color-secondary);
    text-transform: uppercase;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__link {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.footer__link:hover {
    color: var(--color-secondary);
    padding-left: 5px;
}

.footer__contacts p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

/* Соцсети */
.footer__social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer__social {
        justify-content: center;
    }
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    font-size: 1.3rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.social-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.social-icon:hover {
    background: var(--color-primary);
    transform: scale(1.15);
}

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* ====== AI ЧАТ-БОТ ====== */
.ai-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.ai-chat__toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    font-size: 1.5rem;
}

.ai-chat__toggle:hover {
    transform: scale(1.1);
}

.ai-chat__toggle.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 0 rgba(242, 106, 0, 0.4); }
    50% { box-shadow: var(--shadow-lg), 0 0 0 15px rgba(242, 106, 0, 0); }
}

.ai-chat__window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 500px;
    background: var(--color-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat__window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.ai-chat__header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat__header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.ai-chat__close {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.ai-chat__close:hover {
    opacity: 1;
}

.ai-chat__messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat__message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-chat__message--bot {
    background: var(--color-light-gray);
    color: var(--color-dark-gray);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-chat__message--user {
    background: var(--color-primary);
    color: var(--color-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat__input-area {
    padding: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.ai-chat__input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.ai-chat__input:focus {
    border-color: var(--color-primary);
}

.ai-chat__send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.ai-chat__send:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

/* Форма заявки в чате */
.chat-lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-lead-form p {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.chat-input {
    padding: 10px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

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

.chat-submit-btn {
    padding: 10px 16px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-submit-btn:hover {
    background: #c00510;
    transform: scale(1.02);
}

/* ====== СТРАНИЦЫ КОНТЕНТА ====== */
.page-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: 60px 0;
    text-align: center;
}

.page-header__title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.page-content {
    padding: 50px 0;
}

.page-content h2 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 20px;
}

.page-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Секция карты */
.map-section {
    padding: 40px 0 0;
}

.map-container {
    width: 100%;
    background: #eee;
}

.map-container iframe {
    display: block;
}

.map-info {
    padding: 20px;
    text-align: center;
    background: var(--color-light-gray);
}

.map-info p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Заглушка для пустых страниц */
.placeholder {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.placeholder__icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.placeholder__text {
    font-size: 1.2rem;
}

/* ====== АДАПТИВ ====== */
@media (max-width: 1024px) {
    .nav__list {
        gap: 4px;
    }
    
    .nav__link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .header__contacts {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }
    
    .burger {
        display: flex;
    }
    
    /* Затемнение фона при открытом меню */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;  /* На всю ширину */
        max-width: 100%;  /* Убираем ограничение */
        height: 100vh;
        background: var(--color-white);
        box-shadow: var(--shadow-lg);
        padding: 70px 0 30px;
        transition: right var(--transition-normal);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav__list {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;  /* Отступы по бокам */
    }
    
    .nav__item {
        width: 100%;
    }
    
    .nav__link {
        display: block;
        padding: 15px 25px;
        border-bottom: 1px solid #eee;
        border-radius: 0;
        text-align: left;
        font-size: 1rem;
    }
    
    .nav__link.active {
        background: var(--color-primary);
        color: white;
    }
    
    .nav__dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        background: #f5f5f5;
        display: none;
    }
    
    .nav__dropdown-link {
        padding: 12px 25px 12px 40px;
        border-bottom: 1px solid #eee;
        font-size: 0.95rem;
    }
    
    .nav__item.active .nav__dropdown {
        display: block;
    }
    
    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero__buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__subtitle {
        font-size: 1rem;
    }
    
    .section__title {
        font-size: 1.6rem;
    }
    
    /* Заголовки страниц услуг */
    .page-header {
        padding: 40px 0;
    }
    
    .page-header__title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .ai-chat__window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 0;
        bottom: 70px;
    }
    
    .footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .header__contacts {
        display: none;
    }
    
    /* Placeholder на страницах услуг */
    .placeholder__icon {
        font-size: 3rem;
    }
    
    .placeholder__text {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.6rem;
    }
    
    .page-header__title {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .service-card {
        padding: 20px;
    }
    
    .service-card__title {
        font-size: 1.1rem;
    }
}

/* ====== УТИЛИТЫ ====== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
