/* --- 1. ОБЩИЕ СТИЛИ И ПЕРЕМЕННЫЕ --- */
:root {
    --primary-color: #8e44ad;
    --secondary-color: #9b59b6;
    --light-bg: #f8f7fa;
    --text-color: #333;
    --header-color: #5d3d77;
}
body { font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; margin: 0; padding: 0; background-color: #fff; color: var(--text-color); line-height: 1.6; }
body.modal-open { overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* --- 2. СТИЛИ КОМПОНЕНТОВ СТРАНИЦЫ --- */
.header { background-color: #fff; padding: 20px 40px; text-align: center; border-bottom: 2px solid var(--light-bg); }
.header h1 { color: var(--header-color); margin: 0; font-size: 2.5em; font-weight: 300; }
.header h1 span { font-weight: 700; color: var(--primary-color); }
.hero { background: linear-gradient(135deg, #f3e9f7, #fcfaff); text-align: center; padding: 80px 20px; }
.hero h2 { font-size: 2.8em; color: var(--header-color); margin-bottom: 20px; }
.hero p { font-size: 1.2em; max-width: 800px; margin: 0 auto 30px auto; }

.cta-button { background-color: var(--secondary-color); color: #fff; padding: 15px 25px; border-radius: 50px; text-decoration: none; font-size: 1.1em; font-weight: bold; transition: background-color 0.3s ease, transform 0.3s ease; cursor: pointer; border: none; display: inline-flex; align-items: center; justify-content: center; min-height: 24px; line-height: 1.3; }
.cta-button:hover { background-color: var(--primary-color); transform: translateY(-3px); }

section { padding: 60px 0; }
section:nth-child(even) { background-color: var(--light-bg); } /* Для чередования фона */

.section-title { text-align: center; font-size: 2.5em; color: var(--header-color); margin-bottom: 40px; position: relative; }
.section-title::after { content: ''; display: block; width: 80px; height: 3px; background-color: var(--primary-color); margin: 10px auto 0; border-radius: 2px; }

/* ВОССТАНОВЛЕННЫЕ СТИЛИ: Секция "Почему стоит заказать?" */
#why .content-wrapper { display: flex; justify-content: space-around; align-items: flex-start; gap: 40px; flex-wrap: wrap; text-align: left; }
#why .text-block { flex: 1; min-width: 300px; }
#why h3 { color: var(--primary-color); font-size: 1.5em; margin-bottom: 15px; }
#why ul { list-style: none; padding: 0; }
#why ul li { padding-left: 25px; position: relative; margin-bottom: 10px; }
#why ul li::before { content: '✓'; color: var(--secondary-color); font-weight: bold; position: absolute; left: 0; top: 2px; }

#advantages { background-color: var(--light-bg); }
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.advantage-item { background: #fff; padding: 30px; border-radius: 12px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.advantage-item .icon { font-size: 3em; line-height: 1; margin-bottom: 15px; color: var(--primary-color); }
.advantage-item h3 { margin-top: 0; margin-bottom: 10px; color: var(--header-color); }
.advantage-item p { color: #555; font-size: 0.95em; margin-bottom: 0; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.service-card { background-color: #fff; border-radius: 12px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); padding: 30px; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; will-change: transform, box-shadow; }
.service-card:hover { transform: translateY(-10px); box-shadow: 0 10px 25px rgba(142, 68, 173, 0.2); }
.service-card > div { flex-grow: 1; }
.service-card h3 { font-size: 1.8em; color: var(--primary-color); margin-top: 0; margin-bottom: 15px; }
.service-card .icon { font-size: 3em; margin-bottom: 10px; }
.service-card p { font-size: 1em; color: #555; margin-bottom: 20px; }
.service-card ul { list-style: none; padding: 0; margin-bottom: 25px; text-align: left; }
.service-card ul li { padding-left: 25px; position: relative; margin-bottom: 10px; }
.service-card ul li::before { content: '✓'; color: var(--secondary-color); font-weight: bold; position: absolute; left: 0; }

#kids-book { background-color: var(--light-bg); }
.book-promo-wrapper { display: flex; align-items: center; gap: 50px; background: #fff; padding: 40px; border-radius: 15px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.book-image-placeholder { flex-basis: 300px; height: 400px; border: 3px dashed var(--secondary-color); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background-color: var(--light-bg); }
.book-image-placeholder .book-icon { font-size: 5em; color: var(--primary-color); line-height: 1; }
.book-image-placeholder p { color: var(--header-color); font-weight: bold; margin-top: 20px; }
.book-description { flex: 1; }
.book-description h3 { font-size: 2em; color: var(--header-color); margin-top: 0; }
/* ВОССТАНОВЛЕННЫЕ СТИЛИ: Список в описании книги */
.book-description ul { list-style: none; padding: 0; margin: 20px 0; }
.book-description ul li { padding-left: 25px; position: relative; margin-bottom: 10px; }
.book-description ul li::before { content: '⭐'; position: absolute; left: 0; top: 2px; }

.footer { background-color: var(--header-color); color: #eee; text-align: center; padding: 40px 20px; }
.footer p { margin: 0; }
.footer .social-links {
    margin-top: 20px;
}
.footer .social-links a {
    color: #fff;
    text-decoration: none; /* Removing underline from the link container */
    margin: 0 15px;
    font-size: 1em;
    transition: opacity 0.3s ease;
    display: inline-flex; /* Added for alignment */
    align-items: center;  /* Added for alignment */
    gap: 8px;             /* Added for spacing */
}
.footer .social-links a:hover {
    opacity: 0.8;
}

.footer .social-links a:hover span {
    text-decoration: underline;
}

/* --- 3. СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1000; display: none; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.active { display: flex; justify-content: center; align-items: center; opacity: 1; }
.modal-content { background: #fff; padding: 30px 40px; border-radius: 12px; width: 90%; max-width: 500px; position: relative; box-shadow: 0 5px 20px rgba(0,0,0,0.2); transform: scale(0.9); transition: transform 0.3s ease; box-sizing: border-box; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 10px; right: 15px; font-size: 2em; color: #aaa; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-content h3 { margin-top: 0; color: var(--header-color); text-align: center; margin-bottom: 25px; }
.form-notice { text-align: center; padding: 10px; background-color: rgba(142, 68, 173, 0.08); border-radius: 5px; margin-bottom: 20px; color: var(--header-color); font-weight: 500; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }
.captcha-group { display: flex; align-items: center; gap: 10px; }
.captcha-group input { flex-grow: 1; }
.form-error { color: #d9534f; background-color: #f2dede; border: 1px solid #ebccd1; padding: 10px; border-radius: 5px; margin-top: 15px; text-align: center; display: none; }
hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }
#services-checklist { max-height: 200px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 5px; padding: 10px; margin-top: 5px; background-color: #fdfdfd; }
.service-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px; border-bottom: 1px solid #f0f0f0; }
.service-item:last-child { border-bottom: none; }
.service-item label { display: flex; align-items: center; cursor: pointer; flex-grow: 1; }
.service-item input[type="checkbox"] { margin-right: 10px; width: auto; transform: scale(1.2); }
.service-item .price { font-weight: bold; color: var(--primary-color); margin-left: 10px; white-space: nowrap; }
#total-cost-container { text-align: right; font-size: 1.4em; font-weight: bold; color: var(--header-color); margin: 20px 0; padding-top: 15px; border-top: 2px solid var(--primary-color); }

/* --- 4. АДАПТИВНОСТЬ (MEDIA QUERIES) --- */
@media (max-width: 992px) {
    .book-promo-wrapper { flex-direction: column; }
    .book-image-placeholder { width: 100%; flex-basis: auto; height: 300px; }
}
@media (max-width: 768px) {
    .header h1 { font-size: 2em; }
    .hero h2 { font-size: 2.2em; }
    .section-title { font-size: 2em; }
    .modal-overlay.active { display: block; overflow-y: auto; padding: 20px 10px; -webkit-overflow-scrolling: touch; }
    .modal-content { margin: 0 auto; transform: none !important; padding: 30px 20px; }
    .modal-content h3 { font-size: 1.5em; }
}

/* --- Стили для подсветки полей с ошибками --- */
.input-error {
    border-color: #e74c3c !important; /* Ярко-красный цвет для рамки */
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5); /* Легкая тень для акцента */
}