* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* УБИРАЕТ горизонтальный скролл */
    width: 100%;
}

:root {
    --blue: #2563eb;
    --dark: #0f172a;
    --gray: #f8fafc;
}

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.5rem; font-weight: bold; color: var(--blue); }
nav a { margin-left: 20px; text-decoration: none; color: var(--dark); font-weight: 500; }

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.categories button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.categories button.active, .categories button:hover {
    background: var(--blue);
    color: #white;
    border-color: var(--blue);
}

/* СЕТКА ТОВАРОВ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    justify-content: center;
}

.product-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card:hover { transform: translateY(-5px); }

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-card h3 { font-size: 1.1rem; height: 50px; overflow: hidden; margin: 10px 0; }
.product-card .price { font-size: 1.4rem; font-weight: bold; color: var(--blue); margin-bottom: 15px; }

.product-card button {
    background: var(--blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
}

.footer { background: var(--dark); color: white; padding: 40px 5%; margin-top: 50px; }
.footer-container { display: flex; justify-content: space-around; flex-wrap: wrap; }
.footer-bottom { text-align: center; margin-top: 30px; border-top: 1px solid #334155; padding-top: 20px; }


/* Детальное описание */
.full-description {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}
.full-description h3 { font-size: 1.2rem; color: #1e293b; margin-bottom: 10px; }
.full-description p { line-height: 1.6; color: #475569; }

/* Таблица характеристик */
.specs-block { margin-top: 30px; }
.specs-block h3 { font-size: 1.2rem; color: #1e293b; margin-bottom: 15px; }
.specs-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.specs-table tr { border-bottom: 1px dashed #e2e8f0; }
.specs-table td { padding: 10px 0; }
.spec-label { color: #64748b; width: 40%; }
.spec-value { color: #1e293b; font-weight: 500; }

/* Контейнер для цен */
.price-container {
    display: flex;
    flex-direction: column; /* Цена под ценой */
    gap: 5px;
    margin-bottom: 20px;
}

/* Старая цена (зачеркнутая) */
.old-price {
    font-size: 1.2rem;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 400;
}

/* Новая актуальная цена */
.current-price {
    font-size: 2.5rem;
    color: #ef4444; /* Красный цвет для привлечения внимания */
    font-weight: 800;
}


/* Контейнер ссылки */
.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;
}

const el = document.querySelector(".cart-icon");
el.style.transform = "scale(1.3)";
setTimeout(() => el.style.transform = "scale(1)", 200);


.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%);
    }
}

