/* Переменные для легкой смены цветов */
:root {
    --bg-color: #F9F6F0;       /* Нежный бежевый фон */
    --emerald: #14532D;        /* Благородный изумрудный */
    --dark-grey: #333333;      /* Темно-серый для текста */
    --fuchsia: #CC9999;        /* Яркая фуксия для акцентов D946EF*/
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color); /* Теперь бежевый фон заливает абсолютно весь экран компьютера */
    color: var(--dark-grey);
    display: flex;
    justify-content: center;
}

/* Ограничение ширины контента: центрирует элементы на ПК */
.site-container {
    width: 100%;
    max-width: 650px;
    background-color: transparent; /* Убираем границы подложки, делая её невидимой */
    min-height: 100vh;
    padding: 30px 20px;
}

/* Красивые курсивные заголовки */
.section-title {
   font-family: "Comic Sans MS", "Chalkboard SE", "Comic Neue", sans-serif;
font-size: 2.1rem;
    color: var(--emerald);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.block {
    margin-bottom: 45px;
}

/* Стили Блока 1: Логотип */
.logo-block {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.main-logo {
    display: block;
    max-width: 100%;
    height: auto;
    //border-radius: 50%; /* Сделает логотип круглым, если он квадратный */
}

/* Стили Блока 2: Кнопки-ссылки */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-link {
    display: block;
    text-align: center;
    padding: 14px 20px;
    background-color: var(--white);
    color: var(--emerald);
    text-decoration: none;
    border: 2px solid var(--emerald);
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

/* Эффект при наведении (акцент фуксией) */
.btn-link:hover {
    background-color: var(--fuchsia);
    color: var(--white);
    border-color: var(--fuchsia);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(217, 70, 239, 0.2);
}
/* Стили Блока 3: Рукоделие и Блока 4: Объявления */
.products-grid, .ads-grid {
    display: flex;
    justify-content: space-between; /* Идеально равные промежутки между элементами */
    gap: 15px;
    margin-top: 15px;
    width: 100%;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto; /* Запрещаем карточкам сжиматься и ломать структуру */
}

/* Увеличиваем контейнер картинок до 150х112 */
.product-image-container {
    position: relative;
    width: 150px;
    height: 112px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    background-color: var(--white);
}

.product-thumb, .ad-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Затемняющая шторка для появления текста по центру */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 83, 45, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 8px;
}

.overlay-text {
    color: var(--white);
    font-size: 0.75rem; /* Чуть увеличили шрифт, так как сама картинка стала больше */
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
}

.product-image-container:hover .product-overlay,
.product-image-container:active .product-overlay {
    opacity: 1;
}

.product-price {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--emerald);
}

/* Стили Блока 4: Ссылки-Объявления */
.ad-link {
    width: 150px;  /* Точно такой же размер, как у рукоделия */
    height: 112px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 0 auto;
}

.ad-link:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 12px rgba(217, 70, 239, 0.15);
}

/* Адаптивность: перестраиваем сетку для мобильных телефонов (экраны меньше 550px) */
@media (max-width: 550px) {
    .products-grid, .ads-grid {
        flex-direction: column; /* Карточки встают друг под другом */
        align-items: center;    /* Центрируются по экрану */
        gap: 25px;              /* Делаем уютные отступы между ними по вертикали */
    }

    /* На телефоне картинки становятся крупными и адаптивными */
    .product-image-container, .ad-link {
        width: 100%;            /* Растягиваются на всю доступную ширину */
        max-width: 280px;       /* Но не крупнее 280px, чтобы не выглядеть огромными */
        height: auto;
        aspect-ratio: 4 / 3;    /* Идеально сохраняют красивую пропорцию */
    }

    .overlay-text {
        font-size: 0.85rem;     /* На телефоне текст внутри картинки теперь будет хорошо читаться */
    }
    
    .product-card {
        width: 100%;            /* Карточка занимает всю ширину для точного центрирования */
    }
}

/* Изменения размеров для ПК (экраны больше 550px) */
@media (min-width: 551px) {
    .product-image-container, .ad-link {
        width: 180px;           /* Увеличили размер на компьютерах до 180px */
        height: 135px;          /* Пропорционально увеличили высоту */
    }
    
    .overlay-text {
        font-size: 0.8rem;      /* Тексту теперь просторнее внутри картинки */
    }
}
/* Стили для конфетки */
.candy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    border: 1px dashed var(--emerald);
}

.candy-hint {
    font-size: 0.85rem;
    text-align: center;
    color: var(--dark-grey);
    margin-bottom: 20px;
}

/* Рисуем конфетку на чистом CSS */
.candy-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
    margin: 15px 0;
}

.candy-wrapper:hover {
    transform: scale(1.1) rotate(2deg);
}

.candy-wrapper:active {
    transform: scale(0.95);
}

.candy-body {
    width: 70px;
    height: 40px;
    background-color: var(--fuchsia);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Полоски на конфетке */
.candy-pattern {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    background: linear-gradient(45deg, 
        transparent 45%, 
        rgba(255,255,255,0.4) 45%, 
        rgba(255,255,255,0.4) 55%, 
        transparent 55%
    );
    background-size: 15px 15px;
}

.candy-bow {
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

.candy-bow.left {
    border-left: 20px solid var(--fuchsia);
    margin-right: -2px;
}

.candy-bow.right {
    border-right: 20px solid var(--fuchsia);
    margin-left: -2px;
}

/* Окно с текстом предсказания */
.prediction-box {
    margin-top: 20px;
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: var(--emerald);
    text-align: center;
    min-height: 40px;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.prediction-active {
    animation: popIn 0.4s ease-out forwards;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Стили подвала (Футер) */
.site-footer {
    border-top: 1px solid rgba(20, 83, 45, 0.1);
    padding-top: 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.legal-link {
    font-size: 0.75rem;
    color: var(--emerald);
    text-decoration: underline;
    cursor: pointer;
}

.legal-link:hover {
    color: var(--fuchsia);
}

.copyright {
    font-size: 0.75rem;
    color: #888888;
}

/* Стили всплывающего (модального) окна документов */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 2px solid var(--emerald);
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--emerald);
}

.close-modal:hover {
    color: var(--fuchsia);
}

.modal-title {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: var(--emerald);
    margin-bottom: 15px;
}

.modal-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--dark-grey);
    text-align: left;
}