:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --dark: #0f172a;
    --gray: #f8fafc;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--gray);
}

header {
    background: #fff;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo { font-size: 1.6rem; font-weight: 900; color: var(--primary); letter-spacing: -1px; }

header nav a {
    text-decoration: none;
    color: var(--dark);
    margin-left: 25px;
    font-weight: 600;
    transition: 0.3s;
}

header nav a:hover { color: var(--primary); }

#cart-count { color: var(--primary); font-weight: 800; }

/* СЛАЙДЕР АКЦИЙ */
.slider-container {
    position: relative;
    max-width: 1200px;
    margin: 40px auto;
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active { opacity: 1; }

.slide img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.85); }

.slide-content {
    position: absolute;
    bottom: 60px;
    left: 60px;
    max-width: 500px;
    color: white;
    z-index: 2;
}

.slide-content h2 { font-size: 2.8rem; margin-bottom: 15px; font-weight: 800; line-height: 1.1; }
.slide-content p { font-size: 1.1rem; margin-bottom: 25px; opacity: 0.9; }

.btn-promo {
    display: inline-block;
    padding: 15px 35px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.3s;
}

.btn-promo:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* КНОПКИ СЛАЙДЕРА */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}
.prev:hover, .next:hover { background: var(--primary); }
.prev { left: 25px; }
.next { right: 25px; }

/* КАТЕГОРИИ */
.home-categories { max-width: 1200px; margin: 80px auto; padding: 0 20px; }
.home-categories h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; font-weight: 800; }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.cat-card {
    background: var(--white);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    transition: 0.4s;
    border: 1px solid #f1f5f9;
}

.cat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.cat-card img { width: 100px; height: 100px; object-fit: contain; margin-bottom: 20px; }
.cat-card h3 { font-size: 1.3rem; font-weight: 700; color: var(--dark); }

/* ФУТЕР */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 80px 8% 40px;
    margin-top: 100px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-info h3 {
    color: #94a3b8;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.footer-info a, .footer-info p {
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
    transition: 0.3s;
}

.footer-info a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #1e293b;
    color: #64748b;
    font-size: 0.9rem;
}

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 768px) {
    .slider-container { height: 400px; border-radius: 0; margin: 0; }
    .slide-content { left: 30px; bottom: 30px; }
    .slide-content h2 { font-size: 1.8rem; }
    header { padding: 15px 5%; flex-direction: column; gap: 15px; }
}

/* Контейнер ссылки */
.cart-link {
    text-decoration: none;
    display: inline-block;
    padding: 10px;
}

/* Обертка для иконки и счетчика */
.cart-wrapper {
    position: relative; /* Чтобы счетчик позиционировался относительно иконки */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Размер самой иконки */
.cart-icon {
    font-size: 1.5rem; /* Размер эмодзи */
    transition: transform 0.2s ease;
}

/* Эффект при наведении */
.cart-link:hover .cart-icon {
    transform: scale(1.1);
}

/* Красный кружок со счетчиком */
.cart-badge {
    position: absolute;
    top: -8px;      /* Смещаем вверх */
    right: -10px;   /* Смещаем вправо */
    background-color: #ef4444; /* Ярко-красный */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%; /* Делаем круглым */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid #fff;
}

/* Если корзина пуста, можно скрывать счетчик через JS или оставить 0 */
#cart-count:empty {
    display: none;
}

.burger {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
}

/* Мобильная версия */
@media (max-width: 768px) {

    header {
        flex-direction: row;
        justify-content: space-between;
    }

    .burger {
        display: block;
    }

    header nav {
        position: absolute;
        top: 70px;
        right: 0;
        background: white;
        width: 100%;
        display: none;
        flex-direction: column;
        padding: 20px;
    }

    header nav a {
        margin: 10px 0;
    }

    header nav.active {
        display: flex;
    }
}


@media (max-width: 768px) {

    .cat-grid {
        display: flex;
        overflow-x: auto;
        gap: 15px;
        padding-bottom: 10px;
    }

    .cat-card {
        min-width: 180px;
        flex: 0 0 auto;
        padding: 20px;
    }
}

@media (max-width: 768px) {

    .footer-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer {
        padding: 40px 20px;
    }
}

.bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        display: flex;
        justify-content: space-around;
        align-items: flex-end; /* Выравнивание по нижней линии */
        padding: 10px 5px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
        z-index: 1000;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .nav-item {
        text-decoration: none;
        color: #666;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 1;
        transition: all 0.2s ease;
    }

    /* Стиль "Стикера" */
    .nav-sticker {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        font-size: 20px;
        margin-bottom: 6px;
        position: relative;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        transition: transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
    }

    /* Цвета для разных разделов */
    .blue   { background: linear-gradient(135deg, #60a5fa, #3b82f6); color: white; }
    .yellow { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
    .orange { background: linear-gradient(135deg, #fb923c, #f97316); color: white; }
    .cyan   { background: linear-gradient(135deg, #22d3ee, #0891b2); color: white; }
    .purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: white; }

    /* Эффект нажатия (стикер сжимается) */
    .nav-item:active .nav-sticker {
        transform: scale(0.85) translateY(2px);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .nav-label {
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Бейдж корзины на стикере */
    .cart-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #ef4444;
        color: white;
        font-size: 10px;
        padding: 2px 5px;
        border-radius: 8px;
        border: 2px solid white;
        font-weight: bold;
    }

    body {
        padding-bottom: 85px;
    }
}

/* Автосвет: если на телефоне темная тема */
@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: #1a1a1a;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
    }
    .nav-label { color: #999; }
    .cart-badge { border-color: #1a1a1a; }
}

/* Состояние активной ссылки */
.nav-item.active .nav-sticker {
    transform: scale(1.15) translateY(-5px); /* Стикер "всплывает" */
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    outline: 3px solid rgba(255, 255, 255, 0.5); /* Ободок */
}

.nav-item.active .nav-label {
    color: #000; /* Делаем текст активным */
    font-weight: 900;
}

/* Для темной темы */
@media (prefers-color-scheme: dark) {
    .nav-item.active .nav-label { color: #fff; }
}



header {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    header.hide {
        transform: translateY(-100%);
    }
}

