:root {
    --primary-color: #1a3e72;
    --secondary-color: #0972bd;
    --accent-color: #fa0a0a;
    --text-color: #333;
    --light-bg: #f9f9f9;
    --dark-bg: #2c3e50;
    --font-main: 'Roboto', 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', 'Georgia', serif;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-color);
    background-color: #fff;
    overflow-x: hidden;
}

/* Шапка */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d2b4e 100%);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-image {
    max-height: 100px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-image:hover {
    transform: scale(1.05);
}

/* Навигация */
.main-navigation {
    background: var(--dark-bg);
    padding: 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* Кнопка гамбургер-меню */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: white;
    margin: 2px 0;
    transition: var(--transition);
    transform-origin: center;
}

/* Состояние когда меню открыто */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Меню навигации (объединенный блок) */
.nav-menu {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
    flex-wrap: wrap;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 1.2rem 1.5rem;
    display: block;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    font-size: 1.1rem;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-color);
    transition: var(--transition);
}

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

.current-menu-item a {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
}

/* Мобильное меню */
@media (max-width: 768px) {
    .main-navigation {
        position: relative;
        min-height: 30px;
    }
    
    .nav-container {
        position: relative;
        min-height: 30px;
    }
    
    .menu-toggle {
        display: flex;
        top: 15px; /* Задаем значение сразу, убрав дублирование */
        right: 15px;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--dark-bg);
        flex-direction: column;
        padding: 70px 0 2rem 0;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        margin: 0;
    }
    
    .nav-menu.active {
        right: 0;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }
    
    .nav-menu li {
        width: 100%;
        text-align: left;
        margin: 0;
    }
    
    .nav-menu a {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Затемнение фона при открытом меню */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .main-navigation {
        padding: 10px 0;
    }
}

/* Основное содержимое */
.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

section {
    padding: 3rem 0;
    margin: 0 auto;
}

section:nth-child(even) {
    background-color: var(--light-bg);
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Типографика */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

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

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

/* Кнопки */
.button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    text-align: center;
    margin: 0.5rem 0;
}

.button-primary {
    background: var(--secondary-color);
    color: white;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.button-primary:hover {
    background: #0a5a9a;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #0a5a9a;
    color: white;
}

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

.button-outline:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
}

.text-center {
    text-align: center;
}

/* Карточки */
.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

/* Галерея книг */
.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 2rem 0;
}

.book-item {
    perspective: 1000px;
}

.book-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.book-item:hover .book-item-inner {
    transform: rotateY(10deg);
}

.book-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.book-item:hover img {
    box-shadow: var(--shadow-lg);
}

/* Цитаты */
blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    background: rgba(250,10,10,0.05);
    font-style: italic;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

blockquote p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--primary-color);
    margin: 0;
}

.quote-author {
    display: block;
    text-align: right;
    font-style: normal;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--text-color);
}

/* Списки */
ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.benefits-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 1rem;
}

.benefits-list li:before {
    content: "✓";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Подвал */
.site-footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    list-style: none;
    margin-bottom: 2rem;
}

.footer-nav li {
    margin: 0 1rem;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem;
    display: block;
}

.footer-nav a:hover {
    color: var(--accent-color);
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Кнопка "Наверх" */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    border: none;
    cursor: pointer;
}

.back-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-top:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.back-top svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-section > * {
    animation: fadeIn 0.6s ease forwards;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .header-image {
        max-height: 90px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .header-image {
        max-height: 80px;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .book-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .header-image {
        max-height: 70px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .book-gallery {
        grid-template-columns: 1fr;
    }
    
    .button {
        display: block;
        width: 100%;
    }
}
