body {
    /* Простой фиолетовый фон для лучшей производительности */
    background-color: #12091a;
    background-image: linear-gradient(180deg, #12091a 0%, #0f0a1d 100%);
    font-family: 'Inter', Arial, sans-serif;
    position: relative;
    /* Оптимизация скролла на мобильных */
    -webkit-overflow-scrolling: touch;
}

/* Фон с дымом - фиксированный, не скроллится */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/static/uploads/smoke.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #12091a; /* Fallback цвет */
    z-index: -1;
    pointer-events: none;
}

/* Дым убран для улучшения производительности */
.product-card {
    border: 1px solid rgba(99, 102, 241, 0.5); /* indigo border */
    border-radius: 14px;
    background: linear-gradient(180deg,
        rgba(30, 27, 75, 0.92) 0%,      /* indigo-950 */
        rgba(49, 46, 129, 0.92) 55%,    /* indigo-800 */
        rgba(76, 29, 149, 0.92) 100%    /* violet-900 */
    );
    box-shadow:
        0 12px 30px rgba(99, 102, 241, 0.28),
        0 4px 14px rgba(76, 29, 149, 0.26),
        inset 0 0 0 1px rgba(236, 72, 153, 0.08);
    margin-bottom: 16px;
    overflow: hidden;
    width: 100%; /* Занимает всю ширину колонки */
    max-width: 100%; /* Не больше ширины колонки */
}

/* На больших экранах ограничиваем ширину карточек и центрируем */
@media (min-width: 768px) {
    .product-card {
        max-width: 280px; /* Максимальная ширина на десктопе */
    }
    
    /* Карточки по порядку слева на десктопе */
    #products-container .row {
        justify-content: flex-start !important;
        margin-left: -0.375rem !important;
        margin-right: -0.375rem !important;
    }
    
    #products-container .row > * {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* На десктопе ограничиваем ширину колонок до 50% для 2 колонок */
    #products-container .row > .col-6 {
        flex: 0 0 calc(50% - 0.75rem) !important;
        max-width: calc(50% - 0.75rem) !important;
        width: calc(50% - 0.75rem) !important;
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }
}
.card-img-top {
    height: 220px;
    object-fit: contain;
}
/* Improve readability on purple cards */
.product-card .card-body {
    color: #F5F3FF; /* near-white purple tint */
}
.product-card .card-title {
    color: #FAF5FF;
}
.product-card .card-text {
    color: #C4B5FD; /* soft violet for description */
}
/* Override Bootstrap's .text-muted inside product cards */
.product-card .card-text.text-muted,
.product-card .card-text.small.text-muted {
    color: #C4B5FD !important;
}
/* Price style inside product cards */
.product-card .text-primary {
    color: #FFFFFF !important;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* Category group headers (mt-3 mb-2 text-uppercase text-muted) → violet */
#products-container h6.text-uppercase {
    color: #FFFFFF !important;
    text-shadow: 0 2px 6px rgba(124, 58, 237, 0.45), 0 1px 2px rgba(0,0,0,0.35);
    letter-spacing: 0.5px;
}

/* Centered separator and purple-outlined text for category headers */
#products-container h6.text-uppercase.category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}
#products-container h6.text-uppercase.category-header::before,
#products-container h6.text-uppercase.category-header::after {
    content: "";
    height: 2px; /* make line more visible */
    flex: 1 1 auto;
    background: linear-gradient(90deg, rgba(139,92,246,0), rgba(139,92,246,0.85), rgba(139,92,246,0));
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.45); /* subtle glow to stand out */
}
#products-container h6.text-uppercase .category-label {
    padding: 3px 12px; /* like btn-sm */
    border-radius: 999px; /* fully rounded pill */
    background: linear-gradient(135deg, #8B5CF6, #7C3AED); /* btn-primary style */
    color: #FFFFFF !important;
    border: 1px solid rgba(139, 92, 246, 0.85);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
    font-weight: 700;
    letter-spacing: 0.6px;
}

/* Category bar buttons: distinct selected vs unselected */
#category-bar .btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED) !important; /* selected */
    color: #ffffff !important;
    border: 1px solid rgba(139, 92, 246, 0.55) !important;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}
#category-bar .btn-primary:hover {
    filter: brightness(1.07);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.42);
}
#category-bar .btn-outline-primary {
    background: rgba(124, 58, 237, 0.10) !important; /* unselected */
    color: #C4B5FD !important;
    border: 1px solid rgba(139, 92, 246, 0.55) !important;
    box-shadow: none;
}
#category-bar .btn-outline-primary:hover {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}
#category-bar .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.35) !important;
}
/* Force white text for common muted/spacing helpers inside any modal */
.modal .text-muted,
.modal .mb-0,
.modal .mx-2 {
    color: #FFFFFF !important;
}
/* Also ensure totals in modal footers are white */
.modal .modal-footer,
.modal .modal-footer * {
    color: #FFFFFF !important;
}
/* Form labels inside modals */
.modal .form-label {
    color: #FFFFFF !important;
}
/* Form check labels inside modals */
.modal .form-check-label {
    color: #FFFFFF !important;
}
/* Modal body base text color */
.modal .modal-body {
    color: #FFFFFF !important;
}
.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.25);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-success:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.32);
    transform: translateY(-1px);
}
/* Product card cart button: violet variant (different shade from header) */
/* Product card cart button: violet variant */
.product-card .btn-success {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
}
.product-card .btn-success .cart-icon { vertical-align: -2px; margin-right: 6px; }
/* Generic inline icon alignment */
.icon { vertical-align: -2px; margin-right: 6px; }
.modal .modal-title .icon { vertical-align: -3px; margin-right: 8px; }
.product-card .btn-success:hover {
    filter: brightness(1.07);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.42);
}
/* Modal primary actions (cart and checkout) in violet style */
.modal .btn-success {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.35);
}
.modal .btn-success:hover {
    filter: brightness(1.07);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.45);
}
/* remove default bootstrap bg-primary override (header uses .app-header) */
/* Footer */
.app-footer {
    margin-top: 24px;
    padding: 12px 0 28px;
    font-size: 14px;
    color: #9ca3af;
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.25);
}
.badge {
    font-size: 0.85em;
    padding: 0.45em 0.7em;
    border-radius: 999px;
}
.modal-content {
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.92) 0%, rgba(24, 24, 48, 0.92) 60%, rgba(30, 27, 75, 0.92) 100%);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.25), 0 8px 20px rgba(76, 29, 149, 0.22);
    backdrop-filter: blur(8px);
}
/* Modal header/footer text and close icon */
.modal-header .modal-title { color: #FFFFFF; }
.modal-header, .modal-footer { border-color: rgba(139, 92, 246, 0.25); }
.btn-close { filter: invert(1) brightness(1.2); opacity: 0.9; }
.btn-close:hover { opacity: 1; }
/* Age modal styling (match other modals) */
.age-modal {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.92) 0%, rgba(24, 24, 48, 0.92) 60%, rgba(30, 27, 75, 0.92) 100%);
}

/* Image modal styling */
#imageModal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#imageModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.85) !important;
}

#imageModal #modalImage {
    max-height: none;
    max-width: none;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    /* Показываем оригинальный размер, но ограничиваем экраном если слишком большое */
    max-height: 95vh;
    max-width: 95vw;
}

#imageModal .btn-close {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 1051 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50% !important;
    width: 1.75rem !important;
    height: 1.75rem !important;
    opacity: 1 !important;
    filter: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    border: none !important;
    padding: 0 !important;
    /* Скрываем стандартный крестик Bootstrap */
    background-image: none !important;
}

#imageModal .btn-close::before {
    content: '×';
    font-size: 1.25rem;
    line-height: 1;
    color: #fff;
    font-weight: normal;
    display: block;
}

#imageModal .btn-close:hover {
    background-color: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
}
.age-emoji {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
}
.form-control {
    border-radius: 12px;
    border: 1px solid #d7dbe3;
    background-color: #ffffff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15);
}
.alert {
    border-radius: 12px;
    border: none;
}
/* Card payment instructions themed for dark violet */
.modal #card-instructions,
.modal .alert-info#card-instructions {
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.9) 0%, rgba(49, 46, 129, 0.9) 60%, rgba(76, 29, 149, 0.9) 100%);
    color: #FFFFFF;
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
}
.modal #card-instructions .fw-bold { color: #FFFFFF; }
.modal #card-instructions .text-muted { color: #E9D5FF !important; }

/* Center banner style: flat top, rounded bottom corners */
.banner-center {
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.22);
    background: rgba(255, 255, 255, 0.98);
    color: #111827;
    padding: 8px 12px;
    font-size: 14px;
}
/* Оптимизация производительности для мобильных устройств */
@media (max-width: 768px) {
    * {
        transition: none !important;
        animation: none !important;
        will-change: auto !important; /* Отключаем will-change для экономии ресурсов */
    }
    
    /* Гарантируем два столбца на мобильных */
    #products-container .row > [class*="col-"] {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    
    /* Уменьшаем gap между карточками на мобильных */
    #products-container .row {
        margin-left: -4px !important;
        margin-right: -4px !important;
    }
    
    /* Ограничиваем ширину карточек на мобильных, чтобы не были вытянуты */
    .product-card {
        max-width: 180px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
    }
    
    /* Карточки по порядку слева на мобильных */
    #products-container .row {
        justify-content: flex-start !important;
    }
    
    /* Уменьшаем высоту изображений на мобильных */
    .product-card .card-img-top {
        height: 120px !important;
    }
    
    /* Компактные отступы на мобильных */
    .product-card .card-body {
        padding: 0.75rem !important;
    }
    
    /* Уменьшаем размер текста на мобильных */
    .product-card .card-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .product-card .card-text {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .product-card .btn {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
    }
    
    /* Уменьшаем размер цены на мобильных */
    .product-card .h6 {
        font-size: 0.85rem !important;
        font-weight: 700 !important;
    }
    
    /* Компактное расположение цены и кнопки */
    .product-card .d-flex.justify-content-between {
        gap: 0.25rem !important;
        flex-wrap: wrap !important;
    }
    
    /* Уменьшаем иконку в кнопке на мобильных */
    .product-card .btn .cart-icon {
        width: 12px !important;
        height: 12px !important;
        margin-right: 4px !important;
    }
    
    /* Упрощаем backdrop-filter на мобильных */
    .modal-content {
        backdrop-filter: none !important;
    }
    
    /* Убираем transform на hover для кнопок на мобильных */
    .btn-success:hover,
    .product-card .btn-success:hover {
        transform: none !important;
    }
}

/* Гарантируем правильное выравнивание цены и кнопки в карточке */
.product-card .card-body .d-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-card .btn {
    white-space: nowrap;
}

/* Универсальные стили кнопок для более современного вида */
.btn, button, [type="button"], [type="submit"] {
    border-radius: 999px;
}

/* Modern App Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px !important;
    padding-right: 12px !important;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.app-header h1 {
    letter-spacing: .2px;
}
.neon-title {
    color: #e5e7eb;
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.75),
        0 0 12px rgba(59, 130, 246, 0.65),
        0 0 22px rgba(168, 85, 247, 0.55);
}
.header-titles .header-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #cbd5e1;
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.25);
}
.neon-logo {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.8)) drop-shadow(0 0 14px rgba(168, 85, 247, 0.6));
}
/* Remove centered header layout helpers */

@media (max-width: 420px) {
    .brand-logo {
        width: 58px;
        height: 58px;
    }
    .neon-title {
        font-size: 1.25rem;
    }
}
.app-header .btn.btn-light.btn-sm {
    border-radius: 999px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #ffffff;
    border: 1px solid rgba(124, 58, 237, 0.45);
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.35);
}
.app-header .btn .badge {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #A78BFA, #8B5CF6) !important;
    color: #ffffff !important;
    border: 1px solid rgba(139, 92, 246, 0.5);
}


