@import url("shop_part2.css?v=150070");

/* ========================================================================
   🛰️ S.H.A.G. AUTO: OMNI-SHOP CSS ENGINE (ЧАСТЬ 1 ИЗ 2 — РАЗДЕЛЫ 1..7)
   Файл: assets/css/shop.css (автоматически подключает shop_part2.css)
   Версия: V150070.ULTIMATE_PRODUCTION_CORE.APEX (100% ZERO-NBSP & FULL DOM SYNC)
   ======================================================================== */

:root {
    color-scheme: dark;
    --app-height: var(--tg-viewport-stable-height, 100dvh);
    --header-sticky-offset: 0px;
    --search-actions-width: 124px;

    /* S.H.A.G. AUTO AliExpress Black Luxury Palette */
    --tg-bg-color: #050507;
    --bg-dark: #050507;
    --surface-solid: #101016;
    --surface-card: #13131b;
    --surface-elevated: #191924;
    --tg-secondary-bg-color: #121218;
    --tg-text-color: #ffffff;
    --tg-hint-color: #9ca3af;
    --tg-button-color: #7000ff;
    --tg-button-text-color: #ffffff;

    /* Semantic Tokens */
    --success: #32d74b;
    --pos-color: #32d74b;
    --danger: #ff453a;
    --danger-color: #ff453a;
    --danger-glow: rgba(255, 69, 58, 0.4);
    --warning-color: #ff9f0a;
    --text-muted: var(--tg-hint-color);
    --text-main: var(--tg-text-color);

    /* Luxury Accents */
    --gold-main: #D4AF37;
    --gold-light: #F9E596;
    --gold-dark: #AA771C;
    --gold-glow: rgba(212, 175, 55, 0.42);
    --cyan-main: #00ffd0;
    --cyan-light: #66ffea;
    --cyan-dark: #008cff;
    --cyan-glow: rgba(0, 255, 208, 0.42);
    --ai-color: #bf5af2;
    --uzum-purple: #7f00ff;
    --uzum-purple-light: #9d4edd;

    /* Liquid Gradients */
    --vip-grad: linear-gradient(135deg, #FBF5B7 0%, #D4AF37 50%, #AA771C 100%);
    --cyan-grad: linear-gradient(135deg, #66ffea 0%, #00ffd0 50%, #008cff 100%);
    --ai-grad: linear-gradient(135deg, #d884ff 0%, #bf5af2 50%, #4b0082 100%);
    --uzum-grad: linear-gradient(135deg, #7f00ff 0%, #9d4edd 100%);
    --pos-grad: linear-gradient(135deg, #32d74b 0%, #28a745 100%);

    /* Deep Glassmorphism */
    --glass-bg: rgba(12, 12, 18, 0.92);
    --glass-sheet: #101016;
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);

    /* Shadows & Physics Transitions */
    --shadow-float: 0 28px 60px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-inner: inset 0 2px 8px rgba(0, 0, 0, 0.55);
    --shadow-light: 0 10px 26px rgba(0, 0, 0, 0.55);
    --transition-smooth: all 0.24s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-spring: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.24s ease, filter 0.24s ease;
    --modal-spring: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.26s ease, visibility 0.26s;

    /* Z-Index Matrix */
    --z-bg: -2;
    --z-base: 10;
    --z-nav: 100;
    --z-fab: 850;
    --z-overlay: 10000;
    --z-modal: 10001;
    --z-confirm: 10010;
    --z-scanner: 10015;
    --z-toast: 99999;
}

/* ========================================================================
   1. GLOBAL RESETS, FONT AWESOME SHIELD & STRICT MOBILE ANTI-OVERFLOW
   ======================================================================== */
*, *::before, *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent !important;
    outline: none;
}

/* Защита от квадратиков: точная привязка глифов Font Awesome 6 Free и Brands */
.fas, .fa-solid, .fas::before, .fa-solid::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

.far, .fa-regular, .far::before, .fa-regular::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

.fab, .fa-brands, .fab::before, .fa-brands::before {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    overscroll-behavior-x: none !important;
}

html {
    background-color: var(--bg-dark) !important;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body {
    position: relative;
    margin: 0 auto;
    max-width: 600px;
    min-height: 100%;
    min-height: var(--app-height);
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.95);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body.modal-open {
    overflow: hidden !important;
}

/* ========================================================================
   2. TYPOGRAPHY, SCROLLBARS & PAGE SECTIONS
   ======================================================================== */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@media (min-width: 600px) {
    .page-section::-webkit-scrollbar,
    .bottom-sheet::-webkit-scrollbar,
    .ai-chat-messages::-webkit-scrollbar,
    .seller-toolbar::-webkit-scrollbar,
    .log-box::-webkit-scrollbar {
        display: block;
        width: 5px;
        height: 5px;
    }
    ::-webkit-scrollbar-track {
        background: transparent;
    }
    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.16);
        border-radius: 10px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--gold-main);
    }
}

button, input, textarea, select, a {
    -webkit-appearance: none !important;
    appearance: none !important;
    touch-action: manipulation;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

select option {
    background-color: var(--surface-solid);
    color: #ffffff;
}

:focus-visible {
    outline: 2px solid var(--gold-main);
    outline-offset: 2px;
    border-radius: 10px;
}

::selection {
    background: var(--gold-main);
    color: #000000;
    text-shadow: none;
}

h1, h2, .sheet-title {
    font-size: clamp(18px, 4.5vw, 22px);
    letter-spacing: -0.3px;
    text-wrap: balance;
}

.hidden {
    display: none !important;
}

mark {
    background: rgba(212, 175, 55, 0.35);
    color: #ffffff;
    border-radius: 5px;
    padding: 1px 5px;
    font-weight: 800;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.page-section {
    display: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 20px));
}

.page-section.active {
    display: block !important;
    animation: fadeIn 0.28s ease both;
}

/* ========================================================================
   3. ZERO-CPU AMBIENT BACKGROUND & FORM INPUTS
   ======================================================================== */
.bg-grid {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: var(--z-bg);
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 5%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 95%, rgba(0, 255, 208, 0.05) 0%, transparent 45%),
        #050507;
    transform: translateZ(0);
}

input, textarea, select {
    -webkit-user-select: auto !important;
    user-select: auto !important;
    font-size: 16px !important;
    max-width: 100%;
    caret-color: var(--gold-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

::placeholder, ::-webkit-input-placeholder {
    color: var(--tg-hint-color);
    opacity: 0.55;
    font-weight: 400;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--surface-solid) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-group {
    margin-bottom: 16px;
    position: relative;
    width: 100%;
}

.input-group label, .dash-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--tg-hint-color);
    margin-bottom: 7px;
    padding-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 16px;
    background: rgba(24, 24, 34, 0.92);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-inner);
}

.form-input:focus {
    border-color: var(--gold-main);
    background: rgba(30, 30, 42, 0.98);
    box-shadow: var(--shadow-inner), 0 0 0 3px rgba(212, 175, 55, 0.18);
}

@keyframes errorShake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20%, 60% { transform: translate3d(-5px, 0, 0); }
    40%, 80% { transform: translate3d(5px, 0, 0); }
}

.error-shake {
    animation: errorShake 0.4s ease !important;
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 15px var(--danger-glow) !important;
}

.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 16px;
    width: 100%;
}

.input-with-btn .form-input {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select,
.select-wrapper .form-input {
    padding-right: 40px !important;
}

.select-wrapper::after {
    content: '\f107';
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--tg-hint-color);
    pointer-events: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.select-wrapper:focus-within::after {
    color: var(--gold-main);
    transform: translateY(-50%) rotate(180deg);
}

/* Luxury Switcher */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 34px;
    border: 1px solid var(--glass-border);
}

.slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
    background-color: var(--pos-color);
    border-color: var(--pos-color);
    box-shadow: 0 0 12px rgba(50, 215, 75, 0.4);
}

input:checked + .slider::before {
    transform: translateX(22px);
}

/* ========================================================================
   4. HEADER, SURGICAL SEARCH BAR & COMPACT CIS GEO-BAR
   ======================================================================== */
.glass-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    width: 100%;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, var(--glass-bg) 100%);
    backdrop-filter: saturate(190%) blur(26px);
    -webkit-backdrop-filter: saturate(190%) blur(26px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    transform: translateZ(0);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

header h1 {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: clamp(16px, 4.4vw, 20px);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.header-actions #btn-stats {
    color: var(--gold-main);
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--gold-glow);
}

/* Умная строка поиска с точной геометрией отступов без перекрытия кнопки «✕» */
.search-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.search-container input,
#search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 13px calc(var(--search-actions-width, 124px) + 44px) 13px 42px !important;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background-color: rgba(22, 22, 30, 0.94);
    color: var(--tg-text-color);
    font-weight: 600;
    font-size: 15px !important;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    transition: var(--transition-smooth);
}

.search-container input::-webkit-search-decoration,
.search-container input::-webkit-search-cancel-button,
.search-container input::-webkit-search-results-button,
.search-container input::-webkit-search-results-decoration {
    display: none;
}

.search-container input:focus {
    border-color: var(--gold-main);
    background-color: rgba(28, 28, 38, 0.98);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.22);
}

#btn-clear-search {
    position: absolute !important;
    right: calc(var(--search-actions-width, 124px) + 10px) !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 12px !important;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12;
    transition: var(--transition-smooth);
}

#btn-clear-search:active {
    transform: translateY(-50%) scale(0.88) !important;
    background: rgba(255, 69, 58, 0.28) !important;
    color: var(--danger-color) !important;
}

.search-actions-right {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
    z-index: var(--z-base);
}

.btn-voice, .btn-scan-main, .btn-scan-input {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-spring);
    border-radius: 50%;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-voice.listening {
    color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    background: rgba(255, 69, 58, 0.18) !important;
    animation: pulseListening 1.2s infinite;
}

@keyframes pulseListening {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.btn-scan-main, .btn-scan-input {
    color: var(--gold-main);
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.42);
}

.btn-scan-main:active, .btn-voice:active, .btn-scan-input:active {
    transform: scale(0.86);
}

/* Компактная панель СНГ («Сначала рядом»), курса $1 USD и Арены */
.cis-geo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cis-geo-bar::-webkit-scrollbar {
    display: none;
}

.cis-geo-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    padding: 7px 11px;
    color: #f3f4f6;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 0;
    flex-shrink: 0;
}

.cis-geo-chip:active {
    transform: scale(0.95);
}

.cis-geo-chip.active-geo {
    border-color: rgba(0, 255, 208, 0.42);
    background: rgba(0, 255, 208, 0.1);
    color: var(--cyan-main);
    flex: 1 1 auto;
    max-width: 100%;
    overflow: hidden;
}

.cis-geo-chip.active-geo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cis-geo-chip.currency-chip {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold-main);
    font-family: 'JetBrains Mono', monospace;
}

.cis-geo-chip.arena-chip {
    border-color: rgba(191, 90, 242, 0.45);
    background: rgba(191, 90, 242, 0.15);
    color: #e0b0ff;
}

/* Панель инструментов склада продавца (учитывает высоту шапки при sticky) */
.seller-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(10, 10, 14, 0.92);
    position: sticky;
    top: var(--header-sticky-offset, 0px);
    z-index: 45;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 10px;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.seller-toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 11px 16px;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    font-weight: 800;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-spring);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.toolbar-btn:active {
    transform: scale(0.93);
}

.toolbar-btn.add {
    background: var(--vip-grad);
    color: #000000;
    border: none;
    box-shadow: 0 6px 18px var(--gold-glow);
}

.toolbar-btn.ad-btn {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-main);
    border-color: rgba(212, 175, 55, 0.45);
}

.toolbar-btn.pos-open-btn {
    background: rgba(50, 215, 75, 0.16);
    color: var(--success);
    border-color: rgba(50, 215, 75, 0.45);
}

/* ========================================================================
   5. FLOATING AI BUTTON & LUXURY ISLAND TAB BAR
   ======================================================================== */
.fab-ai {
    position: fixed;
    bottom: calc(96px + env(safe-area-inset-bottom, 14px));
    right: 16px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--ai-grad);
    border: 2px solid rgba(191, 90, 242, 0.55);
    color: #ffffff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(138, 43, 226, 0.55);
    z-index: var(--z-fab);
    cursor: pointer;
    transition: var(--transition-spring);
    transform: translateZ(0);
}

@media (min-width: 600px) {
    .fab-ai {
        right: max(16px, calc(50% - 284px));
    }
}

.fab-ai:active {
    transform: scale(0.86);
}

.tab-bar {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom, 12px));
    left: 0;
    right: 0;
    margin: 0 auto;
    transform: translateZ(0);
    width: calc(100% - 24px);
    max-width: 480px;
    height: 66px;
    border-radius: 33px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    z-index: var(--z-nav);
    background: rgba(16, 16, 22, 0.94);
    backdrop-filter: saturate(200%) blur(28px);
    -webkit-backdrop-filter: saturate(200%) blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: var(--shadow-float);
}

.tab-item {
    flex: 1 1 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--tg-hint-color);
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    transition: color 0.25s ease;
    padding: 0 2px;
    min-width: 0;
}

.tab-item span {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.tab-item.active {
    color: var(--gold-main);
}

.tab-icon {
    font-size: 19px;
    transition: var(--transition-spring);
}

.tab-item.active .tab-icon {
    transform: translateY(-2px) scale(1.14);
    filter: drop-shadow(0 4px 10px var(--gold-glow));
}

.cart-badge {
    position: absolute;
    top: 4px;
    right: 14%;
    background: var(--danger-color);
    color: #ffffff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 3px 8px var(--danger-glow);
    z-index: var(--z-base);
    border: 1px solid rgba(255, 255, 255, 0.22);
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* ========================================================================
   6. AD BANNER CAROUSEL & CATEGORY PILLS (INCLUDING #8 AGRO & QUARRIES)
   ======================================================================== */
.ad-carousel-wrap {
    position: relative;
    margin: 0 14px 14px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.ad-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ad-carousel::-webkit-scrollbar {
    display: none;
}

.ad-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    background: #121218;
    aspect-ratio: 21 / 9;
    max-height: 145px;
    overflow: hidden;
}

.ad-slide img,
.ad-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 12px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    pointer-events: none;
}

.ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gold-main);
    color: #000000;
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    z-index: 2;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-indicators {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    z-index: 2;
    pointer-events: none;
}

.ad-dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    transition: 0.3s ease;
}

.ad-dot.active {
    width: 14px;
    background: var(--gold-main);
    box-shadow: 0 0 6px var(--gold-glow);
}

.categories-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 0 14px 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 4px;
    touch-action: pan-x;
}

.categories-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.categories-track {
    display: flex;
    gap: 8px;
    width: max-content;
}

.cat-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #9ca3af;
    padding: 9px 15px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
    white-space: nowrap;
    transform: translateZ(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.cat-pill.agro-cat {
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.09);
}

.cat-pill.active {
    background: var(--vip-grad);
    color: #000000;
    border-color: var(--gold-main);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.38);
}

.cat-pill:active {
    transform: scale(0.94) translateZ(0);
}

/* ========================================================================
   7. PRODUCTS GRID & ALIEXPRESS LUXURY CARDS (STRICT ANTI-OVERFLOW)
   ======================================================================== */
.active-car-badge {
    margin: 8px 14px 4px;
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.42);
    color: var(--gold-main);
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-spring);
    display: inline-block;
    max-width: calc(100% - 28px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 12px var(--gold-glow);
}

.active-car-badge:active {
    transform: scale(0.95);
}

.section-title {
    font-size: 17px;
    font-weight: 900;
    margin: 12px 14px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    background: var(--cyan-main);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan-glow);
    animation: pulseDot 2s infinite;
    flex-shrink: 0;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.28); box-shadow: 0 0 16px var(--cyan-main); }
}

/* Строгая 2-колоночная матрица с minmax(0, 1fr) против растягивания экрана */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 20px;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 520px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.card, .product-card {
    animation: slideUpCard 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
    background: linear-gradient(165deg, #14141d 0%, #0c0c12 100%);
    border-radius: 20px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), var(--glass-highlight);
    height: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    transform: translateZ(0);
    contain: layout style;
}

@keyframes slideUpCard {
    from { opacity: 0; transform: translate3d(0, 22px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.fav-btn-card {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
}

.fav-btn-card.active {
    color: #ff453a;
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.5);
    box-shadow: 0 4px 12px rgba(255, 69, 58, 0.35);
}

.img-wrapper {
    position: relative;
    width: 100%;
    border-radius: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    background-color: #08080c;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 2;
    border-radius: 14px;
}

.img-wrapper img.loaded {
    opacity: 1;
}

/* Бейджи класса качества детали (поддержка .oem-tier-badge и .shag-quality-pill) */
.oem-tier-badge,
.shag-quality-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oem-tier-original,
.quality-original,
.quality-original_oem {
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: var(--gold-light);
}

.oem-tier-premium,
.quality-oem_brand {
    background: rgba(0, 255, 208, 0.12);
    border: 1px solid rgba(0, 255, 208, 0.38);
    color: var(--cyan-main);
}

.oem-tier-aftermarket,
.quality-aftermarket {
    background: rgba(191, 90, 242, 0.12);
    border: 1px solid rgba(191, 90, 242, 0.38);
    color: #e9d5ff;
}

.fits-car-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    background: rgba(50, 215, 75, 0.14);
    border: 1px solid rgba(50, 215, 75, 0.4);
    color: var(--success);
    margin-bottom: 5px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wholesale-pill,
.shelf-badge,
.cross-oem-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    margin-bottom: 4px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wholesale-pill {
    background: rgba(50, 215, 75, 0.12);
    border: 1px solid rgba(50, 215, 75, 0.35);
    color: var(--success);
}

.shelf-badge {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-main);
}

.cross-oem-badge {
    background: rgba(0, 255, 208, 0.08);
    border: 1px solid rgba(0, 255, 208, 0.28);
    color: var(--cyan-main);
}

.card-car {
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    color: var(--tg-hint-color);
    margin-bottom: 6px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 7px;
    border: 1px solid var(--glass-border);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.card-title {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    color: #f3f4f6;
}

/* S.H.A.G. AUTO Disintermediation Shield & Seller Geo Badge */
.shag-seller-badge {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.24);
    padding: 4px 7px;
    border-radius: 9px;
    font-weight: 700;
    min-width: 0;
    max-width: 100%;
}

.shag-seller-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shag-seller-badge i {
    color: var(--gold-main);
    flex-shrink: 0;
}

.geo-distance-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 800;
    color: var(--success);
    background: rgba(50, 215, 75, 0.12);
    border: 1px solid rgba(50, 215, 75, 0.32);
    padding: 2px 6px;
    border-radius: 6px;
    margin-bottom: 6px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-bottom {
    margin-top: auto;
    display: block;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
}

.card-price {
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 900;
    color: var(--gold-main);
    letter-spacing: -0.3px;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
    line-height: 1.3;
    word-break: break-word;
}

.card-price span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
}

.usd-equiv-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: var(--cyan-main) !important;
    background: rgba(0, 255, 208, 0.1);
    border: 1px solid rgba(0, 255, 208, 0.26);
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 3px;
}

/* Бейдж рассрочки на 6 месяцев (Uzum / Payme Nasiya стиль) */
.installment-pill {
    display: block;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 800;
    color: #e9d5ff;
    background: rgba(127, 0, 255, 0.14);
    border: 1px solid rgba(157, 78, 221, 0.35);
    padding: 3px 6px;
    border-radius: 7px;
    margin-bottom: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ask-part-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 6px;
    padding: 9px 6px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 208, 0.32);
    background: rgba(0, 255, 208, 0.08);
    color: var(--cyan-main);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition-smooth);
}

.ask-part-btn:active {
    transform: scale(0.96);
    background: rgba(0, 255, 208, 0.18);
}
