:root {
    --primary: #2c3e50;
    --accent: #e74c3c;
    --bg: #f0f2f5;
    /* Светло-серый фон для эффекта глубины */
    --white: #ffffff;
    --text: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* HEADER */
header {
    background: var(--white);
    height: 80px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.navbar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon-wrap {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--primary);
    transition: 0.3s;
}

.cart-icon-wrap:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-close-btn {
    display: none;
}

/* HERO */
.hero {
    height: 75vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://img1.akspic.ru/crops/4/0/7/7/87704/87704-nebo-gorodskoj_pejzazh-noch-neboskreb-liniya_gorizonta-1920x1080.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

.hero-content h1 {
    font-size: 3.5rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    line-height: 1.2;
}

#typewriter {
    border-right: 4px solid var(--accent);
    padding-right: 5px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.btn {
    padding: 12px 35px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.btn:hover {
    background: #c0392b;
    transform: translateY(-3px);
}

.full-width {
    width: 100%;
}

/* КАРТОЧКИ (Тот самый стиль "Глубокая ниша") */
.container {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary);
    font-weight: 800;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;

    /* Свойства для анимации перехода */
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Плавная кривая скорости */
}

.grid-hidden {
    opacity: 0;
    transform: scale(0.98) translateY(20px);
    /* Чуть уменьшается и сдвигается вниз */
    filter: blur(10px);
    /* Эффект "исчезновения в туман" */
}

.product-card {
    background: #f0f2f5;
    /* Цвет фона для слияния */
    border-radius: 0px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.03);

    /* Эффект глубокой вдавленности */
    box-shadow: inset 8px 8px 16px rgba(0, 0, 0, 0.15), inset -8px -8px 16px rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 2px;
    filter: brightness(0.95);
    /* Чуть темнее внутри "ямы" */
    transition: transform 0.4s ease;
}

.product-details {
    margin-top: 15px;
    padding: 0 5px;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary);
    font-weight: 700;
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

/* Эффект вылета при наведении */
.product-card:hover {
    background: white;
    transform: translateY(-15px) scale(1.02);
    /* Убираем inset, делаем сильную внешнюю тень */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
    border-color: transparent;
}

.product-card:hover .product-img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.add-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.add-btn:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

/* ФУТЕР (ВЕРНУЛ СТИЛИ) */
.footer {
    background-color: var(--primary);
    color: #ecf0f1;
    padding: 4rem 0 0 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent);
}

.store {
    margin-bottom: 160px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
}

.social-icons a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    background: #1a252f;
    padding: 1.5rem;
    text-align: center;
    color: #7f8c8d;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* КОРЗИНА И МОДАЛКИ (ВЕРНУЛ КРАСОТУ) */
.modal-overlay,
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: none;
    z-index: 2000;
}

.open {
    display: flex !important;
}

/* Сайдбар корзины */
.modal-overlay {
    justify-content: flex-end;
}

.cart-sidebar {
    width: 400px;
    max-width: 85%;
    background: white;
    height: 100%;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.close-cart {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-cart:hover {
    color: var(--accent);
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 10px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.remove-item {
    margin-left: auto;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.remove-item:hover {
    color: var(--accent);
}

.total-row {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

/* Окно товара */
.product-modal-overlay {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.product-modal-content {
    background: white;
    width: 850px;
    max-width: 100%;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.product-modal-body {
    display: flex;
    gap: 30px;
}

.modal-img-wrap {
    flex: 1;
}

.modal-img-wrap img {
    width: 100%;
    border-radius: 15px;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.modal-bottom {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* Форма заказа */
.order-modal-width {
    max-width: 500px;
}

.order-form input,
.order-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background: #fdfdfd;
}

.order-form input:focus {
    border-color: var(--accent);
    outline: none;
}

.form-row {
    display: flex;
    gap: 10px;
}

.hidden {
    display: none;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Прижимаем влево */
    gap: 10px;
    /* Отступ между галочкой и текстом */
    margin: 15px 0;
    width: 100%;
    cursor: pointer;
}

/* Стили для самого квадратика */
.checkbox-wrapper input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
    /* Галочка будет красной под цвет сайта */
}

/* Стили для текста */
.checkbox-wrapper label {
    font-size: 0.95rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.order-total-line {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 15px 0;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.text-center {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}

.close-product-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    /* Задаем область клика */
    height: 40px;
    /* Задаем область клика */
    background-color: #fff;
    /* Белый фон, чтобы не сливался */
    border-radius: 50%;
    /* Делаем круглым */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Тень для объема */
    display: flex;
    /* Центрируем крестик внутри круга */
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* Размер самого символа */
    color: #333;
    cursor: pointer;
    /* Курсор-рука */
    z-index: 9999;
    /* Самый важный слой поверх всего */
    transition: all 0.3s ease;
}

.close-product-modal:hover {
    background-color: var(--accent);
    /* Красный фон при наведении */
    color: white;
    /* Белый крестик */
    transform: rotate(90deg);
    /* Анимация поворота */
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* --- СТИЛИ ДЛЯ ОКНА ОФОРМЛЕНИЯ --- */
.order-modal-width {
    max-width: 450px;
    border-top: 5px solid var(--accent);
    /* Красивая шапка */
}

.order-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed #ccc;
}

.order-summary span:first-child {
    color: #7f8c8d;
    font-weight: 600;
}

#order-total-display {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

/* --- Настройки темы --- */
:root {
    --neon-cyan: #00ffea;
    /* Основной цвет будущего (циан) */
    --neon-purple: #ff00ff;
    /* Второй цвет (маджента) */
    --bg-dark: #050a14;
    /* Очень темный фон космоса/киберпространства */
}

/* --- Основной контейнер прелоадера --- */
#future-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    background-image:
        /* Добавляем легкую цифровую сетку на фон */
        linear-gradient(rgba(0, 255, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 234, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s;
}

/* Контейнер для колец */
.loader-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

/* --- Общие стили колец --- */
.ring {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    background: transparent;
}

/* --- Внешнее кольцо (Циан) --- */
.ring-1 {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Делаем обводку прерывистой */
    border-width: 4px;
    border-color: var(--neon-cyan) transparent transparent var(--neon-cyan);
    /* Добавляем мощное неоновое свечение */
    box-shadow: 0 0 15px var(--neon-cyan), inset 0 0 15px var(--neon-cyan);
    animation: spin-right 2s linear infinite;
}

/* --- Внутреннее кольцо (Фиолетовое) --- */
.ring-2 {
    top: 15px;
    left: 15px;
    width: 90px;
    height: 90px;
    border-width: 4px;
    border-color: transparent var(--neon-purple) var(--neon-purple) transparent;
    box-shadow: 0 0 15px var(--neon-purple), inset 0 0 15px var(--neon-purple);
    /* Вращается в обратную сторону и быстрее */
    animation: spin-left 1.5s linear infinite;
}

/* --- Центральное ядро --- */
.core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px 5px white, 0 0 50px var(--neon-cyan);
    animation: pulse 1s ease-in-out infinite alternate;
}

/* --- Текст загрузки --- */
.loading-text {
    font-family: 'Courier New', Courier, monospace;
    /* Моноширинный шрифт как в терминале */
    color: var(--neon-cyan);
    font-size: 16px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Мигающий курсор в конце текста */
.blink {
    animation: blink-animation 0.8s steps(2, start) infinite;
}

/* --- Анимации (Ключевые кадры) --- */

/* Вращение по часовой */
@keyframes spin-right {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Вращение против часовой */
@keyframes spin-left {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

/* Пульсация ядра */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Мигание курсора */
@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

/* --- Класс для скрытия (добавляется JS) --- */
.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* МОБИЛЬНАЯ АДАПТАЦИЯ (ИСПРАВЛЕННАЯ) */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: white;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1500;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .nav-link {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
    }

    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 3rem;
        cursor: pointer;
        color: var(--primary);
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    /* РОВНАЯ СЕТКА 2 ТОВАРА */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .container {
        padding: 0 10px;
    }

    .product-card {
        padding: 8px;
        border-radius: 0px;
    }

    .product-img {
        height: 150px;
        border-radius: 0px;
    }

    .product-title {
        font-size: 0.9rem;
        margin: 5px 0;
        height: 2.4em;
        overflow: hidden;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .product-modal-body {
        flex-direction: column;
        gap: 15px;
    }

    .modal-img-wrap img {
        max-height: 250px;
        object-fit: contain;
    }

    .footer-container {
        gap: 2rem;
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links a,
    .social-icons {
        justify-content: center;
    }
}

.close-product-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 3rem;
    /* Сделали крупным */
    color: #bdc3c7;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 100;
}