/* Styles extracted from shop.html */

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background-image: url('/images/shop-bg.jpg');
            background-repeat: no-repeat;
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            min-height: 100vh;
            padding: 20px;
            color: #ffffff;
        }

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

        .header {
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 20px 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
            border: 1px solid rgba(255, 68, 68, 0.3);
        }

        .logo {
            font-size: 24px;
            font-weight: bold;
            color: #ff4444;
            text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
        }

        .nav-links {
            display: flex;
            gap: 20px;
            align-items: center;
        }

        .nav-links a {
            color: #ff4444;
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            padding: 8px 16px;
            border-radius: 10px;
            transition: all 0.3s ease;
            background: transparent;
            border: 1px solid #ff4444;
        }

        .nav-links a:hover {
            background: rgba(255, 68, 68, 0.1);
            transform: translateY(-2px);
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .points-display {
            background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: bold;
            box-shadow: 0 2px 10px rgba(255, 68, 68, 0.3);
        }

        .logout-btn {
            background: transparent;
            color: #ff4444;
            border: 1px solid #ff4444;
            padding: 8px 16px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .logout-btn:hover {
            background: rgba(255, 68, 68, 0.1);
            transform: translateY(-2px);
        }

        .shop-card {
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 68, 68, 0.3);
            animation: slideUp 0.5s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .shop-title {
            font-size: 28px;
            color: #ff4444;
            margin-bottom: 10px;
            text-align: center;
            text-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
        }

        .shop-subtitle {
            text-align: center;
            color: #cccccc;
            margin-bottom: 30px;
            font-size: 14px;
        }

        .balance-card {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 15px;
            padding: 20px;
            margin-bottom: 30px;
            text-align: center;
            border-left: 4px solid #ff4444;
            border-right: 4px solid #ff4444;
        }

        .balance-card h3 {
            color: #ff8888;
            font-size: 18px;
            margin-bottom: 10px;
        }

        .balance-amount {
            font-size: 48px;
            font-weight: bold;
            color: #ff4444;
            text-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
        }

        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 25px;
            margin-bottom: 30px;
        }

        .product-card {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 25px;
            text-align: center;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 68, 68, 0.2);
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .product-card:hover {
            transform: translateY(-5px);
            border-color: #ff4444;
            box-shadow: 0 10px 25px rgba(255, 68, 68, 0.2);
            background: rgba(255, 255, 255, 0.08);
        }

        .product-card.selected {
            border: 2px solid #ff4444;
            background: rgba(255, 68, 68, 0.1);
            box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
        }

        .product-card.disabled {
            opacity: 0.5;
            cursor: not-allowed;
            filter: grayscale(0.3);
        }

        .product-image {
            width: 120px;
            height: 120px;
            margin: 0 auto 15px;
            border-radius: 15px;
            overflow: hidden;
            background: rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .product-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .product-image-placeholder {
            font-size: 48px;
        }

        .product-name {
            font-size: 22px;
            font-weight: bold;
            color: #ff8888;
            margin-bottom: 10px;
        }

        .product-price {
            font-size: 28px;
            font-weight: bold;
            color: #ff4444;
            margin: 15px 0;
        }

        .product-price span {
            font-size: 14px;
            color: #cccccc;
        }

        .product-description {
            color: #aaaaaa;
            font-size: 13px;
            margin-bottom: 20px;
            line-height: 1.4;
        }

        .product-stock {
            color: #ff8888;
            font-size: 12px;
            margin-top: 10px;
        }

        .select-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: #ff4444;
            color: white;
            padding: 4px 8px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: bold;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .product-card.selected .select-badge {
            opacity: 1;
        }

        .purchase-section {
            text-align: center;
            margin-top: 20px;
        }

/* Базовый стиль для всех кнопок */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
    user-select: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Первичная кнопка (подтвердить) */
.btn-primary {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    border-color: rgba(255,68,68,0.9);
    box-shadow: 0 8px 24px rgba(204, 0, 0, 0.28), inset 0 -2px 6px rgba(0,0,0,0.2);
}

/* Эффект при наведении */
.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(204, 0, 0, 0.32), inset 0 -2px 6px rgba(0,0,0,0.18);
}

/* Эффект при нажатии */
.btn-primary:active:not(:disabled) {
    transform: translateY(-1px) scale(0.995);
    box-shadow: 0 6px 16px rgba(204, 0, 0, 0.24), inset 0 2px 6px rgba(255,255,255,0.03);
}

/* Неактивное состояние */
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Второстепенная кнопка (отмена) — прозрачная с рамкой */
.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    color: #ff8888;
    border: 1px solid rgba(255,68,68,0.18);
    box-shadow: 0 6px 18px rgba(255,68,68,0.06);
}

/* Наведение/нажатие для вторичной */
.btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 68, 68, 0.06);
    box-shadow: 0 10px 24px rgba(255,68,68,0.08);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.997);
}

/* Маленькие варианты (если понадобятся) */
.btn-sm {
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 10px;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 18px;
    border-radius: 14px;
}

/* Иконки внутри кнопок — чтобы они не съезжали */
.btn svg,
.btn img {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* Вспомогательный класс для контрастности на очень тёмном фоне в модальном окне */
.modal .btn {
    min-width: 120px;
}

/* Немного отступа между кнопками в модальном окне */
.modal-buttons .btn {
    min-width: 120px;
}

/* Пример: красная обводка при выделении (focus) */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255,68,68,0.12), 0 8px 24px rgba(0,0,0,0.4);
}

/* Сброс стилей нативного focus для кнопок в Safari */
.btn::-moz-focus-inner {
    border: 0;
    padding: 0;
}

        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid #f3f3f3;
            border-top: 2px solid #ff4444;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 8px;
            vertical-align: middle;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .message {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 15px 20px;
            border-radius: 10px;
            color: white;
            font-size: 14px;
            z-index: 1000;
            animation: slideInRight 0.3s ease;
            max-width: 350px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(10px);
            border: 1px solid #ff4444;
        }

        .message.success {
            border-color: #4caf50;
            color: #4caf50;
        }

        .message.error {
            border-color: #ff4444;
            color: #ff8888;
        }

        .message.info {
            border-color: #2196f3;
            color: #64b5f6;
        }

        @keyframes slideInRight {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            text-align: center;
            border: 1px solid rgba(255, 68, 68, 0.3);
        }

        .modal-content h3 {
            color: #ff4444;
            margin-bottom: 15px;
        }

        .modal-content p {
            color: #cccccc;
            margin-bottom: 20px;
        }

        .modal-buttons {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            justify-content: center;
        }



        @media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100%;
    }

    .header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 14px;
    }

    /* Лого — компактнее */
    .logo {
        font-size: 18px;
        font-weight: 800;
        color: #ff4444;
        text-shadow: 0 0 8px rgba(255,68,68,0.35);
        flex: 0 0 auto;
    }

    /* Ссылки: прячем текст и показываем только значки или сокращаем;
       здесь вариант — превращаем в компактное выпадающее меню (горизонтальная прокрутка) */
    .nav-links {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    .nav-links::-webkit-scrollbar { display: none; }

    .nav-links a {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 10px;
        white-space: nowrap;
    }

    /* Альтернатива: скрыть часть ссылок за хаббургером (простая версия: скрываем все и показываем 1) */
    /* .nav-links { display: none; } */

    .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .points-display {
        padding: 6px 10px;
        border-radius: 16px;
        font-size: 13px;
        font-weight: 700;
        box-shadow: 0 6px 18px rgba(255,68,68,0.06);
    }

    /* Если нужно — перенос элементов в несколько строк */
    .header.wrap {
        flex-wrap: wrap;
        gap: 8px;
    }

            .shop-card {
                padding: 25px;
            }
            
            .shop-title {
                font-size: 24px;
            }
            
            .header {
                flex-direction: column;
                text-align: center;
            }
            
            .products-grid {
                grid-template-columns: 1fr;
            }
            
            .balance-amount {
                font-size: 36px;
            }
            .modal {
            align-items: flex-end; /* модал снизу, как bottom sheet */
            padding: 12px;
            background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.6));
            }
            .modal.active {
            display: flex;
            }
            .modal-content {
            width: 100%;
            max-width: 100%;
            border-radius: 16px 16px 8px 8px;
            padding: 18px;
            max-height: 92vh;
            overflow: auto;
            box-shadow: 0 -8px 24px rgba(0,0,0,0.6);
            border: 1px solid rgba(255,68,68,0.18);
            transform: translateY(0);
            }
            .modal-content h3 {
            font-size: 18px;
            margin-bottom: 10px;
            }
            .modal-content p {
            font-size: 14px;
            margin-bottom: 14px;
            }
            .modal-buttons {
            flex-direction: column-reverse; /* кнопки одна под другой, primary сверху */
            gap: 10px;
            margin-top: 12px;
            }
            .modal-buttons .btn {
            width: 100%;
            min-width: 0;
            padding: 12px 16px;
            font-size: 16px;
            border-radius: 12px;
            }
            .modal-buttons .btn.btn-primary {
            order: -1; /* первичная кнопка выше при column-reverse */
            }
    /* Удобный close area: клик по затемнению закроет (если реализовано) */
            .modal::before {
            content: "";
            position: absolute;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 36px;
            height: 4px;
            background: rgba(255,255,255,0.06);
            border-radius: 4px;
            }
        }
    
