/* ============================================
   СТИЛИ ДЛЯ БЛОКА С КНИГОЙ
   Файл: book-block-styles.css
   ============================================ */

/* Импортируем шрифты (если используете) */
@import url('book-block-fonts.css');

/* Обнуление стилей ТОЛЬКО внутри модуля */
.book-module * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основной контекст модуля - делаем его адаптивным к родителю */
.book-module {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    width: 100%;
    max-width: 100%; /* Убираем ограничение по ширине */
    margin: 0;
    padding: 0; /* Убираем отступы, чтобы блок вписывался в контейнер */
    box-sizing: border-box;
}

/* Карточка книги */
.book-module .book-card {
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #fef9f0 100%);
    border-radius: 1rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 1px solid rgba(255, 215, 150, 0.3);
}

.book-module .book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 32px 55px -15px rgba(0, 0, 0, 0.3);
}

/* Гибкая сетка */
.book-module .book-container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Блок с изображением книги */
.book-module .book-image {
    flex: 0.9;
    min-width: 240px;
    background: linear-gradient(145deg, #f7f3ea, #fff5e8);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.book-module .book-cover {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 0.75rem;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.25);
    transition: transform 0.5s ease, box-shadow 0.3s ease;
}

.book-module .book-card:hover .book-cover {
    transform: scale(1.02);
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.3);
}

/* Информационная часть */
.book-module .book-info {
    flex: 1.2;
    padding: 1.8rem 2rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Бейдж */
.book-module .book-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    width: fit-content;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* ЗАГОЛОВОК КНИГИ - УМЕНЬШЕН ЕЩЕ НА 50% */
.book-module .book-title {
    font-size: clamp(0.8rem, 1.67vw, 1.2rem);
    /* 
        Было: clamp(1.2rem, 2.5vw, 1.8rem)
        Стало: clamp(0.6rem, 1.25vw, 0.9rem)
        Уменьшение на 50%
    */
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #2d1f12, #5c3e1f);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.75rem;
}

/* Декоративный разделитель */
.book-module .book-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #f97316, #ffb347);
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Описание книги */
.book-module .book-description {
    margin-bottom: 1.2rem;
}

.book-module .book-description p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #4a3b2c;
    font-weight: 400;
}

/* Мета-информация (автор, страницы, год) */
.book-module .book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
    padding: 0.8rem 0;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.book-module .book-author,
.book-module .book-pages,
.book-module .book-year {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.book-module .meta-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #f59e0b;
    letter-spacing: 0.5px;
}

.book-module .meta-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d1f12;
}

/* Цена */
.book-module .book-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.book-module .price-current {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f97316;
}

.book-module .price-old {
    font-size: 0.95rem;
    font-weight: 500;
    color: #a28c6f;
    text-decoration: line-through;
}

.book-module .price-discount {
    background: #ffedd5;
    color: #f97316;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
}

/* КНОПКА */
.book-module .book-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.8rem 1.8rem;
    border-radius: 60px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: fit-content;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.book-module .book-button span {
    transition: transform 0.2s ease;
}

.book-module .book-button svg {
    transition: transform 0.2s ease;
}

.book-module .book-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.book-module .book-button:hover span {
    transform: translateX(5px);
}

.book-module .book-button:hover svg {
    transform: translateX(5px);
}

.book-module .book-button:active {
    transform: translateY(0);
}

/* Гарантия */
.book-module .book-guarantee {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #a28c6f;
    letter-spacing: 0.3px;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 860px) {
    .book-module .book-container {
        flex-direction: column;
    }
    
    .book-module .book-image {
        min-height: 300px;
        padding: 1.2rem;
        flex: auto;
    }
    
    .book-module .book-cover {
        max-height: 350px;
        width: auto;
        max-width: 80%;
    }
    
    .book-module .book-info {
        padding: 1.5rem;
    }
    
    .book-module .book-meta {
        gap: 1rem;
    }
    
    /* Адаптивный заголовок на планшетах */
    .book-module .book-title {
        font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    }
}

@media (max-width: 520px) {
    .book-module .book-info {
        padding: 1.2rem;
    }
    
    .book-module .book-title {
        font-size: 1rem;
        /* Фиксированный размер на мобильных */
    }
    
    .book-module .price-current {
        font-size: 1.4rem;
    }
    
    .book-module .book-button {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .book-module .book-meta {
        flex-direction: column;
        gap: 0.6rem;
    }
    
    .book-module .book-image {
        padding: 1rem;
    }
    
    .book-module .book-cover {
        max-height: 280px;
        max-width: 90%;
    }
}

/* Фокус для доступности */
.book-module .book-button:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-module .book-info {
    animation: fadeInUp 0.6s ease-out;
}