/* --- ОСНОВНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    --primary: #2563eb;       /* Насыщенный синий */
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;            /* Светло-серый фон */
    --card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;        /* Красный для удаления */
    --success: #10b981;       /* Зеленый */
    --radius: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* --- ШАПКА (Glassmorphism) --- */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 8%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

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

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

#cart-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* --- КОНТЕЙНЕРЫ --- */
.container, .cart-container, .account-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
}

/* --- СТИЛИ КОРЗИНЫ --- */
.cart-items {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr auto;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item:last-child { border-bottom: none; }

.cart-item h3 { font-size: 1.1rem; color: var(--text-dark); }

.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-item button {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.cart-item button:hover { background: #e2e8f0; }

.btn-remove {
    background: #fee2e2 !important;
    color: var(--danger);
    padding: 8px 16px;
    width: auto !important;
    height: auto !important;
    font-size: 0.85rem;
}

.cart-total {
    text-align: right;
    margin: 30px 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

.cart-button {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.cart-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

/* --- СТИЛИ ЛИЧНОГО КАБИНЕТА (ФОРМЫ) --- */
.account-container {
    max-width: 500px;
}

#accountForm {
    background: var(--card);
    padding: 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#accountForm input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

#accountForm input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

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

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-info h3 {
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.footer-info a, .footer-info p {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1e293b;
    color: #64748b;
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
    header { padding: 15px 20px; flex-direction: column; gap: 10px; }
    header nav a { margin: 0 10px; font-size: 0.85rem; }

    .cart-item {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .cart-item h3 { grid-column: span 2; }
    .btn-remove { grid-column: span 2; }
}


:root {
    --primary: #2563eb;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --radius: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

/* --- КОРЗИНА --- */
.cart-container {
    max-width: 900px;
    margin: 40px auto;
    background: var(--card);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 20px;
}

.cart-item h3 { flex: 2; font-size: 1rem; margin: 0; }
.qty-controls { flex: 1; display: flex; align-items: center; gap: 10px; }

/* СТИЛЬНЫЕ КНОПКИ +/- */
.qty-controls button, .btn-remove {
    border: none;
    background: #f1f5f9;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.qty-controls button:hover { background: #e2e8f0; transform: scale(1.1); }

.btn-remove {
    background: #fee2e2;
    color: #ef4444;
}

.btn-remove:hover { background: #fecaca; }

/* --- РЕКОМЕНДАЦИИ (СЕТКА) --- */
.recommendations {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
}

.products-grid {
    display: grid;
    /* КЛЮЧЕВОЕ: выстраиваем в ряд по 4 штуки или меньше */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

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

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: contain; /* Чтобы фото не тянулось */
    margin-bottom: 15px;
}

.product-card h3 { font-size: 0.95rem; height: 40px; overflow: hidden; margin-bottom: 10px; }

.price { font-weight: 800; color: var(--primary); font-size: 1.2rem; margin-bottom: 15px; }

/* ГЛАВНАЯ КНОПКА ЗАКАЗА */
.cart-button, .product-card button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.cart-button:hover, .product-card button:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cart-button { width: 100%; font-size: 1.1rem; margin-top: 20px; }

/* Адаптивность для мобилок */
@media (max-width: 600px) {
    .cart-item { flex-direction: column; text-align: center; }
    .products-grid { grid-template-columns: 1fr 1fr; } /* 2 в ряд на мобилках */
}
/* --- ЦВЕТОВЫЕ АКЦЕНТЫ ДЛЯ КНОПОК --- */

/* Синие кнопки +/- */
.qty-controls button {
    background: var(--primary) !important; /* Принудительно синий */
    color: white !important;               /* Белый текст */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border-radius: 8px;
    transition: transform 0.2s, opacity 0.2s;
}

.qty-controls button:hover {
    opacity: 0.9;
    transform: scale(1.1);
    background: var(--primary-hover) !important;
}

.qty-controls span {
    font-weight: 800;
    font-size: 1.1rem;
    min-width: 25px;
    text-align: center;
}

/* Кнопка Удалить (вместо крестика или серой кнопки) */
.cart-item button:last-child, .btn-remove {
    background: #fee2e2 !important; /* Светло-красный фон */
    color: var(--danger) !important; /* Ярко-красный текст */
    border: 1px solid #fecaca !important;
    padding: 8px 16px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 10px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.3s !important;
}

.cart-item button:last-child:hover, .btn-remove:hover {
    background: var(--danger) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Фикс сетки, чтобы "Удалить" не наезжала на цену */
.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* Название | Кол-во | Цена | Удалить */
    gap: 15px;
    align-items: center;
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 1fr 1fr;
    }
    .cart-item h3 { grid-column: span 2; }
    .cart-item button:last-child { grid-column: span 2; width: 100% !important; }
}



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

.cart-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: flex-start;
}

/* Левая часть */
.cart-main {
    flex: 1 1 600px; /* Тянется, но не меньше 600px на десктопе */
}

.modern-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 30px;
}

/* Правая часть (сайдбар) */
.cart-sidebar {
    flex: 0 0 380px; /* Жесткая ширина для рекламы */
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: sticky; /* Липнет при скролле */
    top: 20px;
}

/* Карточка оформления заказа */
.checkout-card {
    background: #fff;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    margin: 20px 0;
}

.total-line strong {
    font-size: 24px;
    color: #4f46e5;
}

.cart-button-modern {
    width: 100%;
    padding: 18px;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.cart-button-modern:hover { background: #1e293b; transform: scale(1.02); }

/* Прячем мобильный блок на десктопе */
.cart-summary-mobile { display: none; }

/* Адаптация под мобилки */
@media (max-width: 1000px) {
    .cart-layout { flex-direction: column; }
    .cart-sidebar { width: 100%; flex: none; position: static; }
    .cart-main { width: 100%; flex: none; }
    .checkout-card { display: none; } /* Прячем десктопный итог */
    .cart-summary-mobile {
        display: block;
        margin-top: 30px;
        background: #fff;
        padding: 20px;
        border-radius: 20px;
    }
}

/* Стили рекламы из прошлого шага (кратко) */
.modern-banner {
    display: block; text-decoration: none; position: relative;
    border-radius: 28px; overflow: hidden; background: #000;
    transition: 0.4s;
}
.banner-image { height: 400px; position: relative; }
.banner-image img { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9)); }
.banner-content { position: absolute; bottom: 0; padding: 25px; color: #fff; }
.tag { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 100px; font-size: 12px; margin-bottom: 10px; display: inline-block; }
.banner-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.go-button { width: 40px; height: 40px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; }

/* 1. Эффект левитации всего блока */
.modern-banner {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 2. Стеклянный блик (Shimmer), который пробегает по картинке */
.shimmer {
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transform: skewX(-25deg);
    transition: 0.7s;
    z-index: 2;
}

/* Запускаем блик каждые 4 секунды или при наведении */
.modern-banner:hover .shimmer {
    left: 150%;
    transition: 0.7s;
}

/* 3. Пульсирующее свечение под баннером */
.modern-banner::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #6366f1, #a855f7, #6366f1);
    z-index: -1;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.5s;
    border-radius: 28px;
}

.modern-banner:hover::after {
    opacity: 0.6;
}

/* 4. Анимация стрелочки в кнопке */
.go-button {
    animation: pulseArrow 2s infinite;
}

@keyframes pulseArrow {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Базовое состояние баннера */
.modern-banner {
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Эффект подсветки при наведении */
.modern-banner:hover {
    /* 1. Основная тень + Цветное свечение */
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),            /* Глубокая тень для объема */
        0 0 20px rgba(99, 102, 241, 0.4),         /* Мягкое внутреннее свечение */
        0 0 40px rgba(99, 102, 241, 0.2);         /* Широкий ореол */

    transform: translateY(-12px) scale(1.03);     /* Чуть сильнее приподнимаем */
}

/* Дополнительный "световой контур" по краям (Border Glow) */
.modern-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px; /* Толщина свечения */
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.modern-banner:hover::before {
    opacity: 1;
}

/* Подсветка текста и кнопки внутри при наведении на баннер */
.modern-banner:hover .banner-content h2 span {
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
    transition: 0.3s;
}

.modern-banner:hover .go-button {
    background: #6366f1;
    color: #fff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}




