/* Переменные для легкой настройки */
:root {
    --primary-color: #A0522D; /* Древесный коричневый акцент */
    --secondary-color: #333; /* Темный текст */
    --background-color: #f7f7f7; /* Светлый фон */
    --white-color: #ffffff;
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Общие стили и сброс */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

/* --- Header / Навигация --- */
.header {
    background-color: var(--white-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.contact-nav {
    display: flex;
    gap: 15px;
}

.nav-btn {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s;
    border: none; /* Для единообразия кнопок */
    cursor: pointer; /* Для единообразия кнопок */
}

.telegram-btn {
    background-color: #0088cc;
    color: var(--white-color);
}

.whatsapp-btn {
    background-color: #25D366;
    color: var(--white-color);
}
/* --- Стили для Кнопки Viber --- */

.viber-btn {
    /* Фиолетовый цвет Viber */
    background-color: #7360F2; 
    color: var(--white-color);
}

.viber-btn:hover {
    /* Немного затемняем при наведении */
    background-color: #6350E2; 
    opacity: 1;
}

/* ПРИМЕЧАНИЕ: 
   Иконка Viber (fab fa-viber) уже подключена через вашу библиотеку Font Awesome.
*/
.nav-btn:hover {
    opacity: 0.9;
}


/* --- Стили для Кнопки Корзины в Шапке --- */
.cart-btn {
    position: relative;
    background-color: #f0f0f0; 
    color: var(--secondary-color);
    padding: 8px 15px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.cart-btn:hover {
    background-color: #e0e0e0;
}

.cart-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
}


/* --- Главный экран (Hero) --- */
.hero-section {
    width: 1200px;
    background-image: url('img/header_bg.jpg'); /* Убедитесь, что изображение существует! */
    color: var(--white-color);
    padding: 100px 0;
    text-align: center;
    border-radius: 20px;
    margin: 0 auto;
    margin-top: 10px;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content .subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    background-color: #FFC300; /* Яркий акцентный цвет */
    color: var(--secondary-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 20px;
}

.cta-button:hover {
    background-color: #EAC117;
    transform: translateY(-2px);
}

/* --- НОВЫЙ БЛОК: Преимущества под Hero (hero-features-standalone) --- */
.hero-features-standalone {
    max-width: 1200px;
    padding: 30px 0; /* Меньше отступ, чтобы блок был сразу заметен */
    background-color: var(--white-color); /* Светлый фон */
    box-shadow: 0 5px 10px rgba(0,0,0,0.05); /* Легкая тень */
    margin: 30px auto 30px auto;
    border-radius: 20px;
}

.hero-features {
    max-width: 1100px; /* Увеличим ширину для списка */
    margin: 0 auto;
    padding: 10px 0;
}

.hero-features ul {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Адаптивная сетка */
    gap: 15px 30px;
    text-align: center;
}

.hero-features ul li {
    position: relative;
    padding-left: 0;
    color: var(--secondary-color); /* Темный текст */
    font-weight: 600;
    display: flex; /* Для выравнивания иконки и текста */
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: var(--background-color);
}

/* Стили для иконок в новом блоке */
.hero-features ul li i {
    color: #FFC300; /* Желтый акцент */
    font-size: 1.3rem;
    margin-right: 5px;
}

/* Удаляем старый псевдоэлемент ::before */
.hero-features ul li::before {
    content: none;
}


/* --- Стили для Галереи --- */
/* --- Стили для Галереи --- */
.gallery-section {
    background-color: var(--background-color); 
    padding: 60px 0;
    text-align: center;
}

.gallery-section h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
}

.photo-grid {
    display: grid;
    /* Устанавливаем 3 колонки */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
}

.gallery-item {
    height: 250px; /* Увеличенная высота для более крупных фото */
    border-radius: 8px;
    overflow: hidden; /* Обрезает все, что выходит за рамки */
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* Стили для самого изображения внутри контейнера */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Изображение покрывает контейнер, обрезая лишнее */
    display: block;
    transition: transform 0.4s ease-in-out; /* Плавный переход для анимации */
}

/* Эффект при наведении: плавное увеличение */
.gallery-item:hover img {
    transform: scale(1.1); 
}

/* --- Адаптивность для Галереи --- */

/* На средних экранах (планшеты) */
@media (max-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr); /* Меняем на 2 фото в ряд */
        gap: 15px;
    }
    .gallery-item {
        height: 200px;
    }
}

/* На мобильных */
@media (max-width: 500px) {
    .photo-grid {
        grid-template-columns: 1fr; /* Одно фото в ряд */
    }
    .gallery-item {
        height: 220px;
    }
}
/* --- Каталог --- */
.catalog-section {
    background-color: var(--white-color);
    text-align: center;
}

.catalog-section h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.puzzle-card {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.puzzle-image {
    background-color: #ccc; /* Заглушка для изображения */
    width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
}
/* --- Стили для Цены в Карточке Товара --- */

.price-info {
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: 1rem;
    color: #666;
}

.price-value {
    font-size: 1.5rem; /* Делаем цену крупнее */
    font-weight: bold;
    color: var(--primary-color); /* Используем ваш коричневый акцентный цвет */
}
/* --- Стили для элементов управления в каталоге --- */
.order-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.puzzle-quantity {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-grow: 1; 
}

.add-to-cart-btn:hover {
    background-color: #8B4513;
}


/* --- Особенности деревянных пазлов (features-block) --- */
.features-block {
    background-color: var(--white-color);
    padding: 60px 0;
    text-align: center;
}

.features-block h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 50px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-item {
    padding: 30px 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.feature-item p {
    font-size: 1rem;
    color: #666;
}

/* --- Украсьте ваш интерьер (decor-block) --- */
.decor-block {
    background-color: var(--background-color); 
    padding: 60px 0;
}

.decor-block h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
    text-align: center;
}

.decor-content {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 50px;
    align-items: center;
}

.decor-text p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.decor-text .highlight {
    font-weight: bold;
    color: var(--primary-color);
    padding: 10px;
    border-left: 3px solid var(--primary-color);
}

.decor-image-placeholder {
    background-color: #ddd; 
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- Отзывы партнеров (testimonials-section) --- */
.testimonials-section {
    background-color: var(--white-color);
    padding: 60px 0;
    text-align: center;
}

.testimonials-section h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: #f8f8f8; 
    padding: 25px;
    border-radius: 8px;
    text-align: left;
    border-top: 4px solid #FFC300; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.testimonial-card .quote {
    font-style: italic;
    color: #444;
    margin-bottom: 15px;
    line-height: 1.5;
}

.testimonial-card .author {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.95rem;
}

/* --- Условия --- */
.conditions-section {
    background-color: #E8E8E8;
}

.conditions-section h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

.conditions-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.conditions-list li {
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    background-color: var(--white-color);
    border-radius: 4px;
}


/* --- Доставка --- */
.delivery-section {
    background-color: var(--background-color);
    text-align: center;
}

.delivery-section h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--secondary-color);
}

.delivery-content {
    max-width: 800px;
    margin: 0 auto;
}

.delivery-partner {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-top: 5px solid var(--primary-color);
}

.delivery-partner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.delivery-partner h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.delivery-partner ul {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
    text-align: left;
    display: inline-block;
}

.delivery-partner ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.delivery-partner ul li::before {
    content: '\2713'; 
    position: absolute;
    left: 0;
    color: #25D366; 
    font-weight: bold;
}

/* --- Форма заявки --- */
.form-section {
    text-align: center;
    background-color: var(--white-color);
    padding-bottom: 100px;
}

.application-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.application-form input, 
.application-form textarea {
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.application-form textarea[readonly] {
    background-color: #f0f0f0; /* Выделяем поле, которое заполняет JS */
    color: #555;
    min-height: 100px;
    cursor: default;
}


.submit-button {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* --- Стили для сообщений формы --- */
.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    min-height: 40px; /* Чтобы не скакало при пустом сообщении */
    transition: opacity 0.3s ease;
    opacity: 0; /* Изначально скрыто */
}

/* Стили для сообщения об успешной отправке */
.form-message.success {
    background-color: #d4edda; /* Светло-зеленый фон */
    color: #155724; /* Темно-зеленый текст */
    border: 1px solid #c3e6cb;
    opacity: 1;
}

/* Стили для сообщения об ошибке */
.form-message.error {
    background-color: #f8d7da; /* Светло-красный фон */
    color: #721c24; /* Темно-красный текст */
    border: 1px solid #f5c6cb;
    opacity: 1;
}

/* --- Footer --- */
.footer {
    background-color: var(--secondary-color);
    color: #ddd;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: #ddd;
    margin-left: 15px;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- Стили для Модального окна Корзины --- */
.modal {
    display: none; /* Скрыть по умолчанию */
    position: fixed; 
    z-index: 1000; /* Поверх всего */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); /* Полупрозрачный фон */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Отступ сверху и по центру */
    padding: 30px;
    border: 1px solid #888;
    width: 90%; 
    max-width: 500px; /* Ограничиваем ширину */
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #333;
    text-decoration: none;
}

.modal-content h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-cart-list {
    list-style: none;
    padding-left: 0;
    margin: 15px 0 20px 0;
}

.modal-cart-list li {
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.modal-cart-total-info {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.modal-checkout-btn {
    width: 100%;
    margin-top: 20px !important;
}

/* Стили управления в модальном окне */
.modal-cart-list .cart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Чтобы контролы не сжимались */
}

.modal-cart-list .cart-quantity-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.modal-cart-list .remove-item-btn {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-size: 1.1rem;
}

.modal-cart-list .empty-cart-message {
    font-style: italic;
    color: #666;
    border-bottom: none !important;
    text-align: center;
}


/* --- Адаптивность --- */
@media (max-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    .contact-nav {
        width: 100%;
        justify-content: center;
    }
    .hero-content h2 {
        font-size: 2rem;
    }
    
    /* Обновленная адаптивность для hero-features-standalone */
    .hero-features ul {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .hero-features ul li {
        justify-content: flex-start;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .puzzle-grid {
        grid-template-columns: 1fr; 
    }
    .decor-content {
        grid-template-columns: 1fr;
    }
    .decor-image-placeholder {
        order: -1; 
    }
    .img_decor{
        width:100%;
    }
    .feature-grid, .testimonial-grid, .conditions-list {
        grid-template-columns: 1fr; 
    }
    .footer .container {
        flex-direction: column;
        gap: 10px;
    }
    .hero-section {
        width: auto; /* Для адаптивности на экранах < 1200px */
        border-radius: 0;
    }
}

@media (max-width: 500px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
    .order-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .puzzle-quantity {
        width: 100%;
    }
    .modal-content {
        margin: 5% auto;
    }
}