/* book.css - Стили для страницы книги */

/* Стили для героя книги */
.book-hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
}

.book-subtitle {
    font-size: 1.5rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.book-description {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.book-buttons-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Модальное окно для покупки */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="email"] {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.format-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.format-option {
    position: relative;
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.format-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9f9f9;
    text-align: center;
    min-height: 120px;
}

.format-option input[type="radio"]:checked + label {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.05);
}

.format-option label .format-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.format-option label .format-name {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.format-option label .format-price {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 3px;
}

.format-option label .format-desc {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.purchase-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 10px;
}

.purchase-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.purchase-btn:active {
    transform: translateY(0);
}

.purchase-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.purchase-info p {
    margin: 5px 0;
    font-size: 13px;
    color: #1976d2;
}

.purchase-info strong {
    color: #1565c0;
}

/* Стили для модального окна превью книги */
.book-preview-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.book-preview-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    max-width: 900px;
    width: 95%;
    max-height: 95vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-preview-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-preview-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.book-preview-close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
    opacity: 0.8;
}

.book-preview-close:hover {
    transform: scale(1.1);
    opacity: 1;
}

.book-preview-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.book-preview-info {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
}

.book-preview-info p {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.book-preview-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    font-size: 16px;
    line-height: 1.7;
    color: #212529;
    max-height: 60vh;
}

.book-chapter {
    margin-bottom: 40px;
}

.book-chapter:last-child {
    margin-bottom: 0;
}

.book-chapter h2 {
    color: #2d3748;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.book-chapter h3 {
    color: #4a5568;
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 15px 0;
}

.book-chapter p {
    margin-bottom: 15px;
    text-align: justify;
}

.book-chapter ul {
    margin: 15px 0;
    padding-left: 25px;
}

.book-chapter li {
    margin-bottom: 8px;
}

.book-chapter strong {
    color: #2d3748;
    font-weight: 600;
}

.preview-end-message {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    border: 2px solid #dee2e6;
}

.preview-end-content h3 {
    color: #495057;
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.preview-end-content p {
    color: #6c757d;
    margin-bottom: 20px;
}

.preview-end-content ul {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 25px auto;
}

.preview-end-content li {
    color: #495057;
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.preview-end-content li::before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.preview-cta-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #212529;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
}

.preview-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.4);
    color: #212529;
}

/* Адаптивность */
@media (max-width: 1300px) {
    .book-hero-title {
        text-align: center;
    }

    .book-buttons-container {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .book-hero-title {
        font-size: 2rem !important;
    }

    .book-subtitle {
        font-size: 1.15rem;
    }

    .book-description {
        font-size: 1rem;
    }

    /* Модальные окна */
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .format-selector {
        grid-template-columns: 1fr;
    }

    .format-option label {
        min-height: auto;
        padding: 15px;
    }

    .modal-body .form-group-consent {
        margin-bottom: 1rem;
    }

    .modal-body .form-group-consent label {
        font-size: 0.8rem;
    }

    /* Адаптивность для превью модального окна */
    .book-preview-modal-content {
        margin: 5% auto;
        width: 98%;
        max-height: 98vh;
    }

    .book-preview-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .book-preview-header h2 {
        font-size: 20px;
        flex-direction: column;
        gap: 5px;
    }

    .book-preview-close {
        position: absolute;
        right: 15px;
        top: 15px;
        font-size: 28px;
    }

    .book-preview-info {
        padding: 15px 20px;
    }

    .book-preview-info p {
        font-size: 14px;
    }

    .book-preview-content {
        padding: 20px;
        max-height: 65vh;
    }

    .book-chapter h2 {
        font-size: 20px;
    }

    .book-chapter h3 {
        font-size: 18px;
    }

    .book-preview-content {
        font-size: 15px;
        line-height: 1.6;
    }

    .preview-end-message {
        padding: 20px;
        margin-top: 20px;
    }

    .preview-end-content h3 {
        font-size: 18px;
        flex-direction: column;
        gap: 5px;
    }

    .preview-cta-btn {
        padding: 12px 25px;
        font-size: 16px;
    }
}

/* Стили для двухколоночной структуры секции покупки */
.buy-offers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.offer-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.offer-badge {
    position: absolute;
    top: -22px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 15px rgba(238, 90, 111, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

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

.offer-card-combo {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.offer-card-combo:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.offer-image {
    max-height: 398px;
    margin: 0 auto 1.5rem auto;
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
}

.offer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    line-height: 1.3;
}

.offer-description {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.offer-includes {
    background: rgba(255, 255, 255, 0.08);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.offer-price-box {
    background: rgba(255, 255, 255, 0.12);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.offer-old-price {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 1.1rem;
    margin-bottom: -1rem;
}

.offer-price {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 800;    
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.offer-price-label {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.offer-savings {
    display: inline-block;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

@media (max-width: 968px) {
    .buy-offers-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .offer-card {
        padding: 2rem 1.5rem;
    }

    .offer-image {
        max-width: 240px;
    }

    .offer-title {
        font-size: 1.3rem;
    }

    .offer-description {
        font-size: 1rem;
    }

    .offer-price {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .book-preview-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .book-preview-header {
        border-radius: 0;
        padding: 15px;
    }

    .book-preview-content {
        padding: 15px;
        max-height: 70vh;
    }

    .book-preview-info {
        padding: 10px 15px;
    }

    /* Адаптивность для героя книги на мобильных */
    .book-hero-title {
        font-size: 1.75rem !important;
    }

    .book-subtitle {
        font-size: 1rem !important;
    }

    .book-description {
        font-size: 0.95rem !important;
    }

    /* Кнопки в столбик на мобильных */
    .book-buttons-container {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .book-buttons-container .hero-btn {
        width: 100%;
        padding: 0.9rem 1.2rem;
        font-size: 0.9rem;
        white-space: normal;
        text-align: center;
    }

    .buy-offers-grid {
        gap: 1.5rem;
    }

    .offer-card {
        padding: 1.5rem 1rem;
    }

    .offer-image {
        max-width: 200px;
    }

    .offer-title {
        font-size: 1.2rem;
    }

    .offer-description {
        font-size: 0.95rem;
    }

    .offer-price {
        font-size: 1.8rem;
    }

    .offer-badge {
        font-size: 0.75rem;
        padding: 6px 15px;
        top: -16px;
        right: 15px;
    }
}
