/* Базовые настройки и цвета */
:root {
    --primary: #ff8fb3;
    --secondary: #90d4f7;
    --accent: #b39ddb;
    --bg: #fffafb;
    --text: #4a4a4a;
    --white: #ffffff;
}

/* --- Анимация "Шарик на ветру" --- */
@keyframes balloonWind {
    0% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-5px) rotate(1.5deg); }
    100% { transform: translateY(0) rotate(-1.5deg); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Добавляем фон для всего документа */
html {
    background-color: #f8f4f6; 
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: transparent; /* Делаем body прозрачным, чтобы видеть частицы */
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100vw;
    max-width: 100%;
}

/* Шапка сайта */
header {
    background: var(--white);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: inline-block;
    animation: balloonWind 3s ease-in-out infinite;
    transform-origin: center bottom;
    cursor: default;
}

nav a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover, nav a.active { color: var(--primary); }

.cart-link {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--primary);
}

/* Главный баннер */
.hero {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #ff8fb388, #90d4f788), url('https://www.transparenttextures.com/patterns/stardust.png');
    background-color: var(--primary);
    color: var(--white);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}

.hero h1 { font-size: clamp(1.8rem, 6vw, 3rem); margin-bottom: 1rem; white-space: nowrap; }
.hero p { font-size: clamp(0.9rem, 3.5vw, 1.2rem); margin-bottom: 2rem; white-space: nowrap; }

.btn-main {
    display: inline-block;
    background: var(--white);
    color: var(--primary);
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255, 143, 179, 0.4);
    transition: transform 0.2s;
    cursor: pointer;
}

.btn-main:hover { transform: translateY(-3px); }

/* Плавающие секции (Card UI) */
section {
    background: var(--white);
    padding: 3rem 5%;
    max-width: 1200px;
    margin: 2.5rem auto;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 1px solid rgba(255, 143, 179, 0.1);
}

/* ЗАГОЛОВКИ СЕКЦИЙ (Остаются в одну строчку без переносов) */
section h2 {
    text-align: center;
    font-size: clamp(1rem, 5vw, 2.2rem); 
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 2rem;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 1px;
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* --- СТИЛИ ДЛЯ ПАПОК --- */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.category-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 250px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 0;
}
.category-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.category-bg { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; }
.category-content {
    position: relative; z-index: 2; background: rgba(0, 0, 0, 0.4); height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; text-align: center; padding: 20px; transition: background 0.3s;
}
.category-card:hover .category-content { background: rgba(0, 0, 0, 0.2); }

.category-content h3 { 
    font-size: clamp(1.1rem, 4vw, 1.8rem); 
    margin-bottom: 5px; 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5); 
    white-space: normal; 
    word-wrap: break-word;
    max-width: 95%;
    line-height: 1.2;
}
.category-content p { 
    font-size: clamp(0.75rem, 3vw, 1rem); 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5); 
    white-space: normal; 
    word-wrap: break-word;
    max-width: 95%;
    line-height: 1.2;
}

/* --- СЛАЙДЕР ПОПУЛЯРНОГО --- */
.slider-container { display: flex; overflow-x: auto; scroll-behavior: smooth; gap: 20px; padding: 10px 5px 20px 5px; }
.slider-container::-webkit-scrollbar { display: none; }
.slider-container { -ms-overflow-style: none; scrollbar-width: none; }
.slider-container .category-card { 
    min-width: 250px; 
    max-width: 85vw;  
    flex-shrink: 0; 
}
.slider-container::after {
    content: ''; 
    min-width: 1px;
}

/* --- СЕТКА ТОВАРОВ (ХИТЫ ПРОДАЖ) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0; 
}
.product-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

.product-image { 
    width: 100%; height: 250px; object-fit: cover; border-radius: 15px; margin-bottom: 1rem; 
    background-color: #f0f0f0; cursor: pointer; transition: transform 0.2s; 
}
.product-image:hover { transform: scale(1.02); }

.product-title { 
    font-size: 1.1rem; 
    margin-bottom: 0.5rem; 
    white-space: normal; 
    word-wrap: break-word;
    line-height: 1.3;
}

.product-desc { 
    font-size: 0.85rem; 
    color: #777; 
    flex-grow: 1; 
    margin-bottom: 1rem; 
    line-height: 1.4; 
    white-space: normal; 
    word-wrap: break-word;
}

.product-price { font-size: 1.5rem; font-weight: bold; color: var(--text); margin-bottom: 1rem; }

.buy-btn {
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: background 0.3s;
    width: 100%;
}
.buy-btn:hover { background: #7bc5eb; }

/* ОГРАНИЧЕНИЕ: ТОЛЬКО 4 КАРТОЧКИ В ХИТАХ ПРОДАЖ */
#popularProductGrid .product-card:nth-child(n+5) { display: none !important; }

/* --- КОРЗИНА И ЕЁ ЭЛЕМЕНТЫ --- */
.cart-container { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; border: none; box-shadow: none; background: transparent; }
.cart-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-top: 1.5rem; width: 100%; }
.cart-items { background: white; padding: 1.5rem; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); height: fit-content; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid #eee; }
.cart-item:last-child { border-bottom: none; }

.cart-item-wrapper { display: flex; align-items: center; }
.cart-item-image { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; margin-right: 15px; cursor: pointer; border: 1px solid #eee; transition: transform 0.2s; }
.cart-item-image:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.item-info { font-size: 1.1rem; }
.item-actions { display: flex; align-items: center; gap: 1.5rem; font-weight: bold; }
.remove-btn { background: none; border: none; color: #ff4d4d; cursor: pointer; font-size: 1.2rem; transition: transform 0.2s; }
.remove-btn:hover { transform: scale(1.2); }

.cart-summary { background: white; padding: 2rem; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); height: fit-content; position: sticky; top: 100px; }
.total-price { font-size: 2.5rem; font-weight: bold; color: var(--primary); margin: 1rem 0; text-align: center; }

/* --- ФОРМА ОФОРМЛЕНИЯ В КОРЗИНЕ --- */
.checkout-form { margin-top: 1.5rem; width: 100%; overflow: hidden; }
.checkout-form .form-group { margin-bottom: 1.2rem; text-align: left; width: 100%; }
.checkout-form label { display: block; font-size: 0.9rem; color: var(--text); margin-bottom: 0.4rem; font-weight: 600; }

.checkout-form input, .checkout-form select, .checkout-form textarea {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important; 
    padding: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px !important; 
    background: var(--white);
    transition: border-color 0.3s;
    -webkit-appearance: none; 
    appearance: none;
}
.checkout-form input:focus, .checkout-form select:focus, .checkout-form textarea:focus { border-color: var(--primary); outline: none; }

.address-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.date-time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 1.2rem;
    width: 100%;
}

.whatsapp-btn {
    width: 100%; background: #25D366; color: white; padding: 1.2rem; font-size: 1.2rem; border: none; border-radius: 12px;
    margin-top: 1rem; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: background 0.3s, transform 0.2s;
}
.whatsapp-btn:hover { background: #1ebc59; transform: translateY(-2px); }

/* БЛОК ИНФОРМАЦИИ В КОРЗИНЕ */
.cart-info-block { margin-top: 1.5rem; background: #fdfbfb; border-left: 4px solid var(--primary); padding: 15px; border-radius: 8px; font-size: 0.9rem; color: #555; box-shadow: inset 0 0 5px rgba(0,0,0,0.02); }
.cart-info-block h4 { margin-top: 0; margin-bottom: 10px; color: var(--text); font-size: 1rem; }
.cart-info-block p { margin-bottom: 5px; line-height: 1.4; white-space: normal; }
.cart-info-block p:last-child { margin-bottom: 0; }

/* --- МОДАЛЬНОЕ ОКНО --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.modal.hidden { display: none; }
.image-modal-content { position: relative; max-width: 90vw; max-height: 90vh; text-align: center; }
.image-modal-content img { max-width: 100%; max-height: 85vh; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); object-fit: contain; }
.image-modal-content .close-modal { position: absolute; top: -40px; right: 0; color: white; font-size: 2.5rem; cursor: pointer; transition: color 0.2s; line-height: 1; }
.image-modal-content .close-modal:hover { color: var(--primary); }

/* Подвал */
footer { background: var(--white); padding: 3rem 5%; text-align: center; border-top: 2px dashed var(--primary); }
.footer-content h3 { color: var(--primary); margin-bottom: 1rem; }
.social-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin-top: 1.5rem; }
.social-btn { display: flex; align-items: center; gap: 8px; padding: 12px 25px; border-radius: 30px; color: white; text-decoration: none; font-weight: bold; font-size: 1rem; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: transform 0.3s, box-shadow 0.3s; }
.social-btn:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.social-btn.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-btn.whatsapp { background: #25D366; }

/* АНИМАЦИЯ ШАРИКОВ */
.mini-balloon { position: absolute; width: 15px; height: 20px; background: var(--primary); border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; pointer-events: none; animation: floatUp 1s ease-out forwards; z-index: 50; box-shadow: inset -3px -3px 5px rgba(0,0,0,0.1); }
.mini-balloon::after { content: ''; position: absolute; bottom: -4px; left: 5.5px; border-width: 4px 2px 0; border-style: solid; border-color: inherit transparent; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-120px) scale(1.5); } }

/* ПРАЗДНИЧНЫЙ БАННЕР */
#holidayBannerSection { padding: 1rem 5%; margin-top: 2rem; }
.holiday-banner { position: relative; border-radius: 25px; padding: 2.5rem 2rem; text-align: center; overflow: hidden; box-shadow: 0 15px 35px rgba(0,0,0,0.1); transition: transform 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.holiday-banner:hover { transform: scale(1.02); }
.holiday-content { position: relative; z-index: 10; }
.holiday-badge { display: inline-block; background: rgba(255,255,255,0.9); padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }

.holiday-banner h2 { font-size: clamp(1.4rem, 6vw, 2.5rem); margin-bottom: 10px; color: inherit; text-shadow: 2px 2px 4px rgba(255,255,255,0.5); white-space: nowrap; }
.holiday-banner p { font-size: clamp(0.85rem, 3.5vw, 1.1rem); margin-bottom: 20px; max-width: 500px; white-space: nowrap; }
.holiday-btn { box-shadow: 0 5px 15px rgba(0,0,0,0.2); border: none; padding: 0.8rem 2rem; }

.holiday-decor { position: absolute; width: 100px; height: 100px; background-size: contain; background-repeat: no-repeat; z-index: 1; opacity: 0.8; }
.decor-1 { top: -20px; left: -20px; }
.decor-2 { bottom: -20px; right: -20px; }
.theme-nauryz { background: linear-gradient(135deg, #dcedc8 0%, #aed581 100%); color: #33691e; border: 3px dashed #7cb342; }
.theme-nauryz .holiday-badge { color: #558b2f; }
.theme-nauryz .holiday-btn { background: #558b2f; color: white; }
.theme-nauryz .decor-1 { background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="%23FFD54F" d="M50 0 L55 35 L90 50 L55 65 L50 100 L45 65 L10 50 L45 35 Z"/><circle cx="50" cy="50" r="20" fill="%23FFC107"/></svg>'); animation: spinSlow 10s linear infinite; }
.theme-nauryz .decor-2 { background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="%2381C784" d="M50 100 Q 50 50 20 20 Q 50 10 50 40 Q 50 10 80 20 Q 50 50 50 100 Z"/></svg>'); animation: floatUpAndDown 3s ease-in-out infinite; }
.theme-8march { background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%); color: #880e4f; border: 3px double #f06292; }
.theme-8march .holiday-badge { color: #d81b60; }
.theme-8march .holiday-btn { background: #d81b60; color: white; }
.theme-8march .decor-1, .theme-8march .decor-2 { background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="%23EC407A" d="M50 90 C 20 60 10 40 10 25 C 10 10 25 5 35 15 C 50 30 50 30 50 30 C 50 30 50 30 65 15 C 75 5 90 10 90 25 C 90 40 80 60 50 90 Z"/></svg>'); animation: pulseHeart 2s infinite; }
.theme-newyear { background: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%); color: #0d47a1; border: 3px solid #64b5f6; }
.theme-newyear .holiday-badge { color: #1565c0; }
.theme-newyear .holiday-btn { background: #1565c0; color: white; }
.theme-newyear .decor-1, .theme-newyear .decor-2 { background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path stroke="%23FFFFFF" stroke-width="4" d="M50 10 L50 90 M10 50 L90 50 M20 20 L80 80 M20 80 L80 20"/></svg>'); animation: spinSlow 8s linear infinite; }
.theme-love { background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%); color: #b71c1c; border: 3px dashed #e53935; }
.theme-love .holiday-badge { color: #d32f2f; }
.theme-love .holiday-btn { background: #d32f2f; color: white; }
.theme-love .decor-1, .theme-love .decor-2 { background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path fill="%23F44336" d="M50 90 C 20 60 10 40 10 25 C 10 10 25 5 35 15 C 50 30 50 30 50 30 C 50 30 50 30 65 15 C 75 5 90 10 90 25 C 90 40 80 60 50 90 Z"/></svg>'); animation: floatUpAndDown 2s ease-in-out infinite; }
@keyframes spinSlow { 100% { transform: rotate(360deg); } }
@keyframes floatUpAndDown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes pulseHeart { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ==========================================================
   АДАПТИВНОСТЬ (ПЛАНШЕТЫ)
   ========================================================== */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* ==========================================================
   АДАПТИВНОСТЬ (МОБИЛЬНАЯ ВЕРСИЯ)
   ========================================================== */
@media (max-width: 768px) {
    header { flex-direction: column; gap: 0.6rem; padding: 0.8rem 2%; text-align: center; }
    .logo { font-size: 1.5rem; margin-bottom: 2px; }
    nav { display: flex; justify-content: center; align-items: center; gap: 5px; width: 100%; }
    nav a { margin-left: 0 !important; font-size: 0.85rem; padding: 5px 8px; }
    .cart-link { padding: 5px 12px; white-space: nowrap; border-radius: 15px; }
    
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .category-card { height: 140px; border-radius: 15px; }
    .category-content { padding: 10px; }
    
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    }
    .product-card { padding: 0.8rem; border-radius: 15px; }
    .product-image { height: 120px; margin-bottom: 0.5rem; }
    
    .product-title { font-size: 0.95rem; }
    .product-desc { font-size: 0.8rem; }
    .product-price { font-size: 1.1rem; margin-bottom: 0.8rem; }
    
    .buy-btn { padding: 0.6rem 1rem; font-size: 0.85rem; width: 100%; }

    .cart-container { padding: 0 10px; margin: 1.5rem auto; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; padding: 1.5rem 1rem; }
    
    .cart-item { flex-direction: column; gap: 10px; align-items: flex-start; }
    .item-actions { width: 100%; justify-content: space-between; }
    .cart-item-image { width: 80px; height: 80px; }

    .holiday-banner { padding: 1.5rem 1rem; }
    .holiday-decor { width: 60px; height: 60px; }

    .date-time-row { 
        display: flex;
        flex-direction: column; 
        gap: 10px; 
    }
}

@media (max-width: 576px) {
    .address-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   ПРАЗДНИЧНЫЕ ЧАСТИЦЫ (Снег, лепестки, сердечки)
   ========================================================== */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; 
    z-index: -1; /* Опускаем частицы на самый задний план */
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -10vh; 
    user-select: none;
    pointer-events: none;
    animation: chaoticFall var(--duration) ease-in-out var(--delay) infinite;
    opacity: 0;
    filter: drop-shadow(0px 0px 5px rgba(255, 255, 255, 0.6));
    will-change: transform; 
}

@keyframes chaoticFall {
    0% { 
        transform: translate3d(var(--startX), 0, 0) rotate(0deg) scale(var(--scale)); 
        opacity: 0; 
    }
    10% { 
        opacity: var(--opacity); 
    }
    33% { 
        transform: translate3d(calc(var(--startX) + var(--sway)), 33vh, 0) rotate(calc(var(--rot) / 3)) scale(var(--scale)); 
    }
    66% { 
        transform: translate3d(calc(var(--startX) - var(--sway)), 66vh, 0) rotate(calc(var(--rot) / 1.5)) scale(var(--scale)); 
    }
    90% { 
        opacity: var(--opacity); 
    }
    100% { 
        transform: translate3d(calc(var(--startX) + var(--sway) / 2), 110vh, 0) rotate(var(--rot)) scale(var(--scale)); 
        opacity: 0; 
    }
}