/* ========================================================================= */
/* DEVISE DESIGN SYSTEM: DUAL-THEME (OBSIDIAN DARK & ALABASTER LIGHT)       */
/* Linear / Apple Store Aesthetic with Tabular Monospace Typography         */
/* ========================================================================= */

:root,
:root[data-theme="dark"] {
    /* Obsidian Dark Tokens (Linear / Raycast) */
    --bg-canvas: #08090C;
    --bg-surface: #0F1117;
    --bg-surface-hover: #151821;
    --bg-elevated: #1A1D27;
    --bg-glass: rgba(15, 17, 23, 0.78);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(255, 255, 255, 0.22);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #64748B;
    --accent: #5E6AD2;
    --accent-primary: #5E6AD2;
    --accent-hover: #6875E5;
    --price-best: #10B981;
    --price-best-bg: rgba(16, 185, 129, 0.10);
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Marketplaces & Semantic Accents */
    --accent-ozon: #005BFF;
    --accent-aliexpress: #FF4747;
    --accent-yandex: #FC3F1D;
    --accent-avito: #00AAFF;
    --accent-warning: #F59E0B;
    --accent-purple: #8B5CF6;

    /* Backward compatibility mappings */
    --bg-base: var(--bg-canvas);
    --border: var(--border-subtle);
    --border-color: var(--border-subtle);
    --text-main: var(--text-primary);
    --text-color: var(--text-primary);
    --primary: var(--accent);
    --primary-glow: rgba(94, 106, 210, 0.25);
    --accent-ali: var(--accent-aliexpress);
    --accent-ali-glow: rgba(255, 71, 71, 0.25);
    --accent-success: var(--price-best);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Chart specific */
    --chart-grid: rgba(255, 255, 255, 0.07);
    --chart-tick: #9CA3AF;
    --chart-legend: #F3F4F6;
    --chart-tooltip-bg: #1A1D27;

    color-scheme: dark;
}

:root[data-theme="light"] {
    /* Alabaster Light Tokens (Linear / Raycast) */
    --bg-canvas: #F7F8FA;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F3F4F6;
    --bg-elevated: #EDF0F5;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border-subtle: #E4E7EC;
    --border-strong: #CBD5E1;
    --border-focus: #94A3B8;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --accent: #4F46E5;
    --accent-primary: #4F46E5;
    --accent-hover: #4338CA;
    --price-best: #059669;
    --price-best-bg: #ECFDF5;
    --warning: #D97706;
    --danger: #DC2626;
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);

    /* Marketplaces & Semantic Accents */
    --accent-ozon: #005BFF;
    --accent-aliexpress: #EA3A3A;
    --accent-yandex: #E63517;
    --accent-avito: #0095E0;
    --accent-warning: #D97706;
    --accent-purple: #7C3AED;

    /* Backward compatibility mappings */
    --bg-base: var(--bg-canvas);
    --border: var(--border-subtle);
    --border-color: var(--border-subtle);
    --text-main: var(--text-primary);
    --text-color: var(--text-primary);
    --primary: var(--accent);
    --primary-glow: rgba(79, 70, 229, 0.18);
    --accent-ali: var(--accent-aliexpress);
    --accent-ali-glow: rgba(234, 58, 58, 0.15);
    --accent-success: var(--price-best);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Chart specific */
    --chart-grid: rgba(0, 0, 0, 0.06);
    --chart-tick: #475569;
    --chart-legend: #0F172A;
    --chart-tooltip-bg: #FFFFFF;

    color-scheme: light;
}

/* ========================================================================= */
/* BASE RESETS & TYPOGRAPHY                                                  */
/* ========================================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Tabular Monospace Numeric Styling */
.tabular-nums,
.price-main,
.price-old-striked,
.duty-tax-amount,
.metric-num,
.bento-spec-val,
.sku-code,
.badge-counter,
.tabular-code,
.sparkline-label {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Keyboard Shortcuts & Badges (<kbd>) */
kbd,
.kbd-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    box-shadow: 0 1px 0 var(--border-strong);
    user-select: none;
    letter-spacing: -0.01em;
}

/* Icon Helper */
.icon-svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-lg {
    width: 20px;
    height: 20px;
}

/* ========================================================================= */
/* TASK 18: FLOATING PILL HEADER & SEGMENTED SLIDING DOCK                   */
/* ========================================================================= */

.header-container {
    position: sticky;
    top: 12px;
    z-index: 50;
    padding: 0 16px;
    margin-bottom: 16px;
}

.floating-header {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-card);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    user-select: none;
}

.logo-badge {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.brand-text-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.brand-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.12);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

/* Center: Segmented Navigation Dock with Sliding Pill */
.segmented-nav {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
}

.nav-sliding-pill {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 1;
}

.segmented-nav-btn {
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
    user-select: none;
    white-space: nowrap;
}

.segmented-nav-btn:hover {
    color: var(--text-primary);
}

.segmented-nav-btn.active {
    color: #FFFFFF !important;
}

/* Badge counters */
.badge-counter {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    line-height: 1.3;
}

/* Header Right Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-icon-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.nav-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-btn-compact:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

/* Home Worker Pulsing Dot */
.worker-status-dot-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    cursor: pointer;
}

.home-worker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748B;
    transition: all 0.25s ease;
}

.home-worker-dot.online {
    background: #10B981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.85;
    }
}

/* Theme Toggle Button (Segmented Sun/Moon) */
.theme-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--accent-primary);
    border-color: var(--border-focus);
    transform: rotate(15deg);
}

/* Command Palette Trigger Button (Ctrl+K) */
.header-cmd-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    height: 32px;
}

.header-cmd-trigger:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.cmd-trigger-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================================================= */
/* RAYCAST-STYLE COMMAND PALETTE (TASK 17)                                   */
/* ========================================================================= */

.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
    z-index: 10000;
}

.cmd-palette-overlay.active {
    display: flex;
}

.cmd-palette-dialog {
    width: 100%;
    max-width: 620px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cmdPaletteIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdPaletteIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cmd-palette-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
    background: var(--bg-surface);
}

.cmd-palette-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.cmd-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
}

.cmd-palette-input::placeholder {
    color: var(--text-muted);
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
}

.cmd-section-header {
    padding: 8px 16px 4px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.1s ease;
    user-select: none;
}

.cmd-item:hover,
.cmd-item.active {
    background: var(--bg-surface-hover);
}

:root[data-theme="dark"] .cmd-item.active {
    background: rgba(94, 106, 210, 0.14);
}

:root[data-theme="light"] .cmd-item.active {
    background: rgba(79, 70, 229, 0.08);
}

.cmd-item-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cmd-item.active .cmd-item-icon {
    color: var(--accent);
    background: rgba(94, 106, 210, 0.18);
}

.cmd-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cmd-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.cmd-palette-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cmd-palette-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.cmd-palette-hints {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cmd-palette-hints span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cmd-palette-brand {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ========================================================================= */
/* MAIN APP LAYOUT                                                           */
/* ========================================================================= */

.app-body {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px 40px 16px;
    gap: 20px;
}

/* Sidebar */
.ozon-sidebar {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ========================================================================= */
/* CASCADING 4-LEVEL CATALOG DRILL-DOWN IN SIDEBAR (TASK 21)                 */
/* ========================================================================= */

.cascade-level {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInCascade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInCascade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cascade-cat-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cascade-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    user-select: none;
}

.cascade-cat-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.cascade-cat-item.active {
    background: var(--accent-subtle);
    color: var(--accent-primary);
    border-color: rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

.cascade-cat-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cascade-count-pill {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.cascade-cat-item.active .cascade-count-pill {
    background: var(--accent-primary);
    color: #FFFFFF;
}

.cascade-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.cascade-sub-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.cascade-back-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.cascade-models-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}

.cascade-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.cascade-model-item:hover {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    transform: translateX(2px);
}

.cascade-model-item.active {
    background: var(--accent-subtle);
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--accent-primary);
    font-weight: 600;
}

.cascade-model-year {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--border-subtle);
    color: var(--text-muted);
}

.cascade-model-item.active .cascade-model-year {
    background: var(--accent-primary);
    color: #FFFFFF;
}

.mobile-filter-trigger {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-filter-trigger:hover {
    background: var(--bg-elevated);
}

.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
}

.sidebar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.25s, border-color 0.25s;
}

.filter-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========================================================================= */
/* SEARCH & HEADER INPUTS                                                    */
/* ========================================================================= */

.search-hero-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: background 0.25s, border-color 0.25s;
}

.header-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 96px 10px 38px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.header-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-surface);
}

.search-icon-left {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 76px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, transform 0.15s;
}

.search-clear-btn:hover {
    color: #EF4444;
    transform: translateY(-50%) scale(1.15);
}

.header-search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    background: var(--accent-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, transform 0.15s;
}

.header-search-btn:hover {
    background: var(--accent-hover);
}

/* ========================================================================= */
/* TASK 18.3: INTERACTIVE CATEGORY RIBBON & SEGMENTED FILTER BAR            */
/* ========================================================================= */

.category-ribbon {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    user-select: none;
}

.category-ribbon::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-pill:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.category-pill.active {
    background: var(--accent-primary);
    color: #FFFFFF;
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Segmented Filter Bar */
.segmented-filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    transition: background 0.25s, border-color 0.25s;
}

.filter-bar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Segmented Group (Pills Container) */
.segmented-group {
    display: inline-flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
}

.segmented-chip {
    border: 1px solid transparent;
    background: transparent;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    user-select: none;
}

.segmented-chip:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

/* Marketplace Filter Buttons & State */
.mp-filter-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none;
    position: relative;
    z-index: 2;
}

/* Guarantee child elements inside filter buttons never intercept mouse clicks */
.mp-filter-btn *,
.segmented-chip * {
    pointer-events: none !important;
}

.mp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none !important;
}

.segmented-chip.active,
.segmented-chip.is-active,
.segmented-chip.selected,
.mp-filter-btn.active,
.mp-filter-btn.is-active,
.mp-filter-btn.selected {
    background: var(--accent) !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25) !important;
}

:root[data-theme="dark"] .segmented-chip.active,
:root[data-theme="dark"] .segmented-chip.is-active,
:root[data-theme="dark"] .segmented-chip.selected,
:root[data-theme="dark"] .mp-filter-btn.active,
:root[data-theme="dark"] .mp-filter-btn.is-active,
:root[data-theme="dark"] .mp-filter-btn.selected {
    background: var(--accent-primary) !important;
    color: #FFFFFF !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 2px 6px rgba(94, 106, 210, 0.35) !important;
}

/* iOS/Linear Style Switch */
.ios-switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.ios-switch {
    position: relative;
    width: 38px;
    height: 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    transition: background 0.2s, border-color 0.2s;
}

.ios-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

input:checked + .ios-switch {
    background: var(--price-best);
    border-color: var(--price-best);
}

input:checked + .ios-switch .ios-switch-thumb {
    transform: translateX(16px);
}

/* View Mode Toggle (TASK 18.1) */
.view-mode-toggle {
    display: inline-flex;
    align-items: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2px;
    gap: 2px;
}

.view-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-mode-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.view-mode-btn.active {
    background: var(--bg-surface);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .view-mode-btn.active {
    background: var(--bg-elevated);
    color: #FFFFFF;
    border: 1px solid var(--border-strong);
}

/* Collapsible Filter Drawer */
.collapsible-filters-drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.collapsible-filters-drawer.open {
    grid-template-rows: 1fr;
    margin-top: 4px;
}

.drawer-inner {
    min-height: 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.collapsible-filters-drawer.open .drawer-inner {
    padding: 16px;
}

/* Chips Cloud */
.chips-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-btn {
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chip-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.chip-btn.active,
.chip-btn.is-active {
    background: var(--accent) !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25) !important;
}

:root[data-theme="dark"] .chip-btn.active,
:root[data-theme="dark"] .chip-btn.is-active {
    background: var(--accent-primary) !important;
    color: #FFFFFF !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 2px 6px rgba(94, 106, 210, 0.35) !important;
}

/* ========================================================================= */
/* TASK 17: VECTOR MARKETPLACE BADGES                                        */
/* ========================================================================= */

.mp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
}

.mp-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mp-ozon {
    background: rgba(0, 91, 255, 0.10);
    color: #2563EB;
    border-color: rgba(0, 91, 255, 0.22);
}

.mp-aliexpress {
    background: rgba(255, 71, 71, 0.10);
    color: #EF4444;
    border-color: rgba(255, 71, 71, 0.22);
}

.mp-yandex {
    background: rgba(252, 63, 29, 0.10);
    color: #EA580C;
    border-color: rgba(252, 63, 29, 0.22);
}

.mp-avito {
    background: rgba(0, 170, 255, 0.10);
    color: #0284C7;
    border-color: rgba(0, 170, 255, 0.22);
}

.mp-generic {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

/* Warehouse Delivery Badges */
.badge-delivery-rf {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.10);
    color: var(--price-best);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-delivery-global {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.10);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

/* ========================================================================= */
/* TASK 19: PRODUCT CARDS ON SHOWCASE & MONITORING                           */
/* ========================================================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.product-card,
.product-card-ozon {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.product-card:hover,
.product-card-ozon:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Card Top Row */
.card-top-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-badges-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-sku-badge {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

/* Image Podium for Offer Card */
.card-thumb-wrap {
    height: 160px;
    background: var(--bg-surface-hover);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px;
    overflow: hidden;
}

:root[data-theme="light"] .card-thumb-wrap {
    background: #F1F3F6;
}

:root[data-theme="dark"] .card-thumb-wrap {
    background: #171A24;
}

.card-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.product-card:hover .card-thumb-img,
.product-card-ozon:hover .card-thumb-img {
    transform: scale(1.04);
}

/* Product Title */
.product-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 42px;
}

/* Price Block */
.price-block-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--border-subtle);
}

.price-main-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-final {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 22px;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.price-final.price-val-green {
    color: var(--price-best);
}

.price-old-striked {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.price-duty-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

.price-duty-subtitle b {
    color: var(--accent-warning);
}

/* Card Footer */
.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.card-store-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    flex-shrink: 1;
    min-width: 0;
}

.card-rating-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.card-rating-wrap .star-icon {
    color: #F59E0B;
}

.btn-direct-buy {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-direct-buy:hover {
    background: var(--accent-primary);
    color: #FFFFFF;
    border-color: var(--accent-primary);
}

/* ========================================================================= */
/* HIGH-DENSITY INTERACTIVE TABLE VIEW (TASK 18.2)                           */
/* Linear / Bloomberg Table with Inline Sparklines                           */
/* ========================================================================= */

.product-grid.mode-table {
    display: block !important;
}

.linear-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.linear-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-primary);
    text-align: left;
}

.linear-table thead th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    user-select: none;
}

.linear-table tbody tr.linear-table-row {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.12s ease;
}

.linear-table-row:last-child {
    border-bottom: none;
}

.linear-table-row:hover {
    background: var(--bg-surface-hover);
}

:root[data-theme="dark"] .linear-table-row.row-best {
    background: rgba(16, 185, 129, 0.06);
}

:root[data-theme="light"] .linear-table-row.row-best {
    background: #F0FDF4;
}

.linear-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.table-product-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.table-seller-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.table-store-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    color: #F59E0B;
}

.trust-badge-warn {
    display: inline-flex;
    align-items: center;
    color: var(--warning);
    margin-left: 2px;
}

.table-sku-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.table-spark-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.table-spark-meta {
    font-size: 10px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.table-base-price {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.table-price-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-price-wrap .price-final {
    font-size: 16px;
    font-weight: 700;
}

.badge-best-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    background: var(--price-best);
    color: #FFFFFF;
    letter-spacing: 0.04em;
    user-select: none;
}

.table-actions-group {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.nav-icon-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-focus);
    color: var(--text-primary);
}

.nav-icon-btn.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #FFFFFF;
}

.nav-icon-btn.primary:hover {
    background: var(--accent-hover);
}

/* ========================================================================= */
/* TASK 19.2: BENTO CATALOG CARDS                                            */
/* ========================================================================= */

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.catalog-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.catalog-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.catalog-card.in-compare {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

/* Image Podium */
.catalog-card-img-wrap {
    height: 180px;
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
    overflow: hidden;
    cursor: pointer;
}

:root[data-theme="light"] .catalog-card-img-wrap {
    background: #F1F3F6;
}

:root[data-theme="dark"] .catalog-card-img-wrap {
    background: #171A24;
}

.catalog-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.catalog-card-img-wrap:hover .catalog-card-img {
    transform: scale(1.05);
}

.catalog-badge-year {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--bg-glass);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-subtle);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.catalog-badge-subcat {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* Card Body */
.catalog-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.catalog-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Bento 2x2 Specs Grid */
.bento-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 4px 0;
}

.bento-spec-cell {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 7px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bento-spec-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bento-spec-val {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bento Actions */
.bento-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.btn-bento-search {
    flex: 1;
    background: var(--accent-primary);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.15s;
}

.btn-bento-search:hover {
    background: var(--accent-hover);
}

.btn-bento-compare {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-bento-compare:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.btn-bento-compare.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ========================================================================= */
/* TASK 19.3: FLOATING COMPARE DOCK                                          */
/* ========================================================================= */

.compare-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    max-width: 560px;
    width: calc(100% - 32px);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 90;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.compare-floating-bar.visible {
    transform: translateX(-50%) translateY(0);
}

.compare-bar-thumbs {
    display: flex;
    gap: 6px;
    align-items: center;
}

.compare-thumb-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-thumb-pill img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

/* ========================================================================= */
/* MODALS & FORMS                                                            */
/* ========================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    padding: 20px;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--text-primary);
    transition: background 0.25s, border-color 0.25s;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.form-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: normal;
}

.form-field input,
.form-field select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

:root[data-theme="dark"] select option {
    background-color: #12141C !important;
    color: #F3F4F6 !important;
    padding: 8px 12px;
}

:root[data-theme="light"] select option {
    background-color: #FFFFFF !important;
    color: #111827 !important;
    padding: 8px 12px;
}

/* Nav Button (Standard) */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    text-decoration: none;
}

.nav-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-focus);
}

.nav-btn.primary {
    background: var(--accent-primary);
    color: #FFFFFF;
    border-color: var(--accent-primary);
}

.nav-btn.primary:hover {
    background: var(--accent-hover);
}

/* ========================================================================= */
/* MONITORING SECTION & DEVICE CARDS                                         */
/* ========================================================================= */

.monitoring-section {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.device-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
}

/* Compare Matrix */
.compare-matrix-wrap {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    text-align: left;
}

.compare-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ========================================================================= */
/* RESPONSIVE DESIGN (TASK 23)                                               */
/* ========================================================================= */

/* Header compacting for intermediate desktop screens (1024px – 1360px) */
@media (min-width: 1024px) and (max-width: 1360px) {
    .floating-header {
        padding: 6px 12px;
        gap: 8px;
    }

    .header-cmd-trigger {
        max-width: 160px;
    }

    .cmd-trigger-text {
        display: none;
    }

    .segmented-nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Tablet & Mobile Slide-Over Drawer (< 1024px) */
@media (max-width: 1023px) {
    .app-body {
        flex-direction: column;
        padding: 0 14px 80px 14px;
        gap: 16px;
    }

    /* Slide-over Drawer for Sidebar */
    .ozon-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 310px !important;
        max-width: 86vw;
        height: 100vh;
        z-index: 1200;
        background: var(--bg-surface);
        box-shadow: none;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
        overflow-y: auto;
        padding: 20px 16px 80px 16px;
        border-right: 1px solid var(--border-subtle);
    }

    .ozon-sidebar.drawer-open {
        transform: translateX(0) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.65);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.drawer-backdrop-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-filter-trigger {
        display: inline-flex !important;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* Mobile Bottom Navigation Bar & Phone Layout (< 768px) */
.bottom-nav-bar {
    display: none;
}

@media (max-width: 767px) {
    .app-body {
        padding: 0 10px 96px 10px;
    }

    .floating-header {
        padding: 6px 10px;
        gap: 6px;
    }

    .floating-header nav.segmented-nav-group {
        display: none;
    }

    .header-cmd-trigger {
        display: none;
    }

    .brand-logo-text {
        font-size: 14px;
    }

    .bottom-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: rgba(18, 20, 29, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-subtle);
        z-index: 1000;
        align-items: center;
        justify-content: space-around;
        padding: 0 4px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    }

    :root[data-theme="light"] .bottom-nav-bar {
        background: rgba(255, 255, 255, 0.95);
        border-top: 1px solid #E2E8F0;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        flex: 1;
        height: 100%;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: color 0.15s ease, transform 0.15s ease;
        padding: 4px 0;
    }

    .bottom-nav-item:active {
        transform: scale(0.95);
    }

    .bottom-nav-item.active {
        color: var(--accent-primary);
        font-weight: 700;
    }

    .bottom-nav-item svg {
        width: 19px;
        height: 19px;
    }

    .compare-floating-bar {
        bottom: 66px;
        right: 12px;
        left: 12px;
        max-width: calc(100vw - 24px);
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hero-bar-inner {
        padding: 4px 8px;
    }

    .hero-search-input {
        font-size: 14px;
    }
}

