/* Основные улучшения: 
   - Неоморфизм и стековая эстетика
   - Плавные микроанимации
   - Улучшенная визуальная иерархия
   - Темная тема
   - Расширенные эффекты частиц
*/

:root {
    --rm-primary: #6366f1;
    --rm-primary-dark: #4f46e5;
    --rm-primary-light: #a5b4fc;
    --rm-accent: #ec4899;
    --rm-accent-light: #f9a8d4;
    --rm-dark: #0f172a;
    --rm-light: #f8fafc;
    --rm-gray: #94a3b8;
    --rm-modal-bg: rgba(255, 255, 255, 0.95);
    --rm-modal-bg-dark: rgba(15, 23, 42, 0.95);
    --rm-modal-border: rgba(226, 232, 240, 0.3);
    --rm-accent-gradient: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-accent) 100%);
    --rm-hover-effect: rgba(99, 102, 241, 0.1);
    --rm-active-effect: rgba(99, 102, 241, 0.2);
    --rm-transition-speed: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --rm-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.15);
    --rm-elevated-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.3);
    --rm-border-radius: 16px;
    --rm-header-height: 70px;
    --rm-footer-height: 30px;
    --rm-footer-expanded-height: 260px;
    --rm-vertical-padding: 10px;
    --rm-glow: 0 0 10px rgba(99, 102, 241, 0.2);
    --rm-pulse: 0 0 0 0 rgba(99, 102, 241, 0.5);
    --rm-particle-color: rgba(99, 102, 241, 0.4);
    --rm-angle: 0deg;
    --rm-glass-bg: rgba(255, 255, 255, 0.7);
    --rm-glass-border: rgba(255, 255, 255, 0.3);
    --rm-glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --rm-text-primary: #1e293b;
    --rm-text-secondary: #64748b;
    --rm-pulse-modal: 0 0 0 0 rgba(99, 102, 241, 0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --rm-modal-bg: var(--rm-modal-bg-dark);
        --rm-text-primary: #f1f5f9;
        --rm-text-secondary: #cbd5e1;
        --rm-modal-border: rgba(30, 41, 59, 0.5);
        --rm-glass-bg: rgba(15, 23, 42, 0.7);
        --rm-glass-border: rgba(30, 41, 59, 0.4);
        --rm-glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        --rm-hover-effect: rgba(99, 102, 241, 0.15);
        --rm-active-effect: rgba(99, 102, 241, 0.25);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@property --rm-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.rm-category-modal {
    position: fixed;
    top: calc(var(--rm-header-height) + var(--rm-vertical-padding));
    right: 0;
    bottom: var(--rm-footer-height);
    width: 380px;
    z-index: 1100;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: bottom var(--rm-transition-speed), transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    transform: translateX(100%);
    animation: none;
}

/* Новый класс для развернутого состояния */
.rm-category-modal.rm-expanded {
    animation: rm-slideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes rm-slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.rm-category-modal__content {
    height: 100%;
    background: var(--rm-modal-bg);
    border-left: 1px solid var(--rm-modal-border);
    box-shadow: var(--rm-elevated-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--rm-border-radius) 0 0 var(--rm-border-radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--rm-glass-border);
    transition: all 0.4s ease;
    position: relative;
}

.rm-category-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.rm-category-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.rm-search-box {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--rm-glass-shadow);
    margin-top: 6px;
    background: var(--rm-glass-bg);
    transition: all 0.3s ease;
    z-index: 10;
    transform-style: preserve-3d;
    border: 1px solid var(--rm-glass-border);
}

.rm-search-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.rm-search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rm-text-secondary);
    font-size: 1.05rem;
    z-index: 2;
    transition: all 0.3s ease;
}

.rm-search-pulse {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rm-pulse);
    z-index: 1;
    animation: rm-pulse 2s infinite;
    opacity: 0;
}

@keyframes rm-pulse {
    0% {
        box-shadow: var(--rm-pulse);
        opacity: 0.5;
    }
    70% {
        box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
        opacity: 0;
    }
    100% {
        box-shadow: var(--rm-pulse);
        opacity: 0;
    }
}

.rm-search-input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 3.2rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border-radius: 14px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(4px);
    color: var(--rm-text-primary);
}

.rm-search-input::placeholder {
    color: var(--rm-text-secondary);
    opacity: 0.8;
}

.rm-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.rm-search-input:focus + .rm-search-pulse {
    animation: none;
    opacity: 0;
}

.rm-category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rm-category-tree__item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    transform-origin: top center;
    will-change: transform, box-shadow;
    perspective: 1000px;
    transform-style: preserve-3d;
    background: var(--rm-glass-bg);
    box-shadow: var(--rm-glass-shadow);
}

.rm-category-tree__item:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px) rotateX(1deg) rotateY(-1deg) !important;
}

.rm-category-tree__item.rm-active {
    border-color: var(--rm-primary);
    background: var(--rm-active-effect);
    box-shadow: var(--rm-glow);
    transform: translateY(-3px) rotateX(0.5deg) !important;
}

.rm-category-tree__item.rm-active > .rm-category-content .rm-category-tree__link {
    color: var(--rm-primary-dark);
    font-weight: 700;
}

.rm-category-tree__item.rm-active > .rm-category-content .rm-category-icon i {
    color: var(--rm-primary);
    transform: scale(1.1);
}

.rm-category-content {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.2rem;
    position: relative;
    cursor: pointer;
    gap: 12px;
    transition: all 0.3s ease;
    z-index: 1;
    transform-style: preserve-3d;
}

.rm-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.rm-icon-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.18);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.rm-category-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: conic-gradient(
        from var(--rm-angle),
        rgba(99, 102, 241, 0.7),
        rgba(236, 72, 153, 0.6),
        rgba(99, 102, 241, 0.7)
    );
    filter: blur(4px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
    animation: rm-hologram 6s linear infinite;
}

@keyframes rm-hologram {
    0% { filter: hue-rotate(0deg) blur(4px); }
    100% { filter: hue-rotate(360deg) blur(4px); }
}

.rm-category-icon i {
    color: var(--rm-primary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.rm-category-tree__link {
    flex: 1;
    color: var(--rm-text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    letter-spacing: -0.1px;
    transform: translateZ(10px);
}

.rm-category-tree__link:hover {
    color: var(--rm-primary);
}

.rm-category-expand {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--rm-text-secondary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.rm-category-expand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--rm-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    border-radius: 8px;
}

.rm-category-expand i {
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.rm-category-expand:hover {
    color: white;
    transform: scale(1.1) rotateY(10deg) !important;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.2);
}

.rm-category-expand:hover::before {
    opacity: 0.8;
}

.rm-category-tree__item.rm-expanded > .rm-category-content .rm-category-expand i {
    transform: rotate(180deg);
}

.rm-category-subtree {
    list-style: none;
    padding-left: 2.5rem;
    margin: 0.4rem 0 0.6rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    transform-origin: top;
}

.rm-category-tree__item.rm-expanded > .rm-category-subtree {
    max-height: 1000px;
    opacity: 1;
}

.rm-category-subtree__item {
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
    perspective: 800px;
    transform-style: preserve-3d;
    background: var(--rm-glass-bg);
    border-radius: 10px;
    margin-bottom: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.rm-category-subtree__item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 2px;
    background: var(--rm-primary-light);
    opacity: 0.5;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.rm-subcategory-content {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem 0.6rem 1rem;
    gap: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
}

.rm-subcategory-content:hover {
    background: var(--rm-hover-effect);
    padding-left: 1.2rem;
    transform: translateX(5px) rotateY(2deg) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.rm-subcategory-content:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--rm-primary);
    border-radius: 4px 0 0 4px;
}

.rm-subcategory-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    position: relative;
    transform-style: preserve-3d;
}

.rm-subcategory-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    background: conic-gradient(
        from var(--rm-angle),
        rgba(165, 180, 252, 0.6),
        rgba(249, 168, 212, 0.5),
        rgba(165, 180, 252, 0.6)
    );
    filter: blur(3px);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
    animation: rm-hologram 8s linear infinite;
}

.rm-subcategory-icon i {
    color: var(--rm-text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.rm-subcategory-content:hover .rm-subcategory-icon i {
    color: var(--rm-primary);
    transform: scale(1.15);
}

.rm-category-subtree__link {
    color: var(--rm-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    transform: translateZ(5px);
}

.rm-subcategory-content:hover .rm-category-subtree__link {
    color: var(--rm-text-primary);
    font-weight: 600;
}

.rm-category-tree__item.rm-active-parent {
    border-left: 4px solid var(--rm-primary);
    background: var(--rm-active-effect);
    box-shadow: var(--rm-glow);
}

.rm-category-tree__item.rm-active-parent > .rm-category-content .rm-category-tree__link {
    color: var(--rm-primary-dark);
    font-weight: 700;
}

.rm-category-tree__item.rm-active-parent > .rm-category-content .rm-category-icon i {
    color: var(--rm-primary);
    transform: scale(1.15);
}

.rm-category-tree__item.rm-active-parent > .rm-category-content .rm-icon-glow {
    opacity: 0.8;
}

.rm-category-tree__item.rm-active-parent > .rm-category-content .rm-category-icon::before {
    opacity: 0.5;
}

.rm-category-subtree__item.rm-active {
    background: var(--rm-active-effect);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.1);
}

.rm-category-subtree__item.rm-active .rm-subcategory-content {
    padding-left: 1.2rem;
    transform: translateX(5px) !important;
}

.rm-category-subtree__item.rm-active .rm-subcategory-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--rm-primary);
    border-radius: 4px 0 0 4px;
}

.rm-category-subtree__item.rm-active .rm-category-subtree__link {
    color: var(--rm-primary-dark);
    font-weight: 700;
}

.rm-category-subtree__item.rm-active .rm-subcategory-icon i {
    color: var(--rm-primary);
    transform: scale(1.15);
}

.rm-category-subtree__item.rm-active .rm-subcategory-icon::before {
    opacity: 0.5;
}

.rm-hidden {
    display: none !important;
}

.rm-expanded > .rm-category-subtree {
    display: block;
}

.rm-animating {
    animation: rm-selectionPulse 0.5s ease;
}

@keyframes rm-selectionPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.rm-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--rm-primary-light) transparent;
}

.rm-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.rm-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.rm-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--rm-primary-light);
    border-radius: 10px;
}

/* Анимация пульсации сердца */
@keyframes rm-heartbeat {
    0% { transform: translateY(-50%) scale(1); }
    14% { transform: translateY(-50%) scale(1.1); }
    28% { transform: translateY(-50%) scale(1); }
    42% { transform: translateY(-50%) scale(1.1); }
    70% { transform: translateY(-50%) scale(1); }
}

/* Стили для сворачивания */
.rm-category-modal.rm-home.rm-collapsed {
    transform: translateX(calc(100% - 40px));
    cursor: pointer;
    opacity: 0.95;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.rm-category-modal.rm-home.rm-collapsed .rm-collapse-indicator {
    animation: rm-heartbeat 1.5s infinite;
    background: var(--rm-accent-gradient);
    color: white;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

.rm-collapse-indicator {
    position: absolute;
    top: 50%;
    left: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: var(--rm-primary);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.rm-collapse-indicator:hover {
    background: var(--rm-primary-dark);
    transform: translateY(-50%) scale(1.05);
}

.rm-collapse-indicator i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .rm-category-modal {
        width: 320px;
        top: calc(var(--rm-header-height) + var(--rm-vertical-padding));
        bottom: 0;
    }
    .rm-category-modal__body {
        padding: 1rem;
    }
    .rm-category-modal.rm-home.rm-collapsed {
        transform: none;
    }
    .rm-collapse-indicator {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .rm-category-modal {
        top: var(--rm-header-height);
        bottom: 0;
        width: 100%;
        border-radius: 0;
    }
    .rm-category-modal__content {
        border-radius: 0;
    }
    .rm-category-modal__body {
        padding: 0.8rem;
    }
}

/* Добавляем стили для нового индикатора "КП" */
.rm-kp-indicator {
    position: absolute;
    top: calc(50% - 60px); /* Располагаем над сердечком */
    left: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rm-kp-indicator:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-50%) scale(1.05);
}

/* Обновляем позицию сердечка */
.rm-collapse-indicator {
    top: calc(50% + 20px); /* Смещаем сердечко ниже */
}

/* Анимация для нового индикатора */
.rm-category-modal.rm-home.rm-collapsed .rm-kp-indicator {
    animation: rm-heartbeat 1.5s infinite;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .rm-kp-indicator,
    .rm-collapse-indicator {
        display: none !important;
    }
}

/* Добавить в конец category_modal.css */
.rm-kp-indicator {
    position: absolute;
    top: calc(50% - 60px);
    left: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--medical-primary) 0%, var(--medical-accent) 100%);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    box-shadow: var(--medical-shadow);
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.rm-kp-indicator:hover {
    background: linear-gradient(135deg, var(--medical-primary-dark) 0%, #0891b2 100%);
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--medical-shadow-lg);
}

.rm-kp-indicator.rm-has-items::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--medical-error);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.rm-category-modal.rm-home.rm-collapsed .rm-kp-indicator {
    animation: rm-heartbeat 1.5s infinite;
}

@media (max-width: 768px) {
    .rm-kp-indicator {
        display: none !important;
    }
}
/* Стили для вкладки поиска товаров */
.rm-search-tab-indicator {
    position: absolute;
    top: calc(22% - 100px);
    left: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1201;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.rm-search-tab-indicator:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-50%) scale(1.05);
}

/* Панель поиска товаров */
.rm-product-search-panel {
    padding: 1.2rem;
    background: var(--rm-glass-bg);
    border-bottom: 1px solid var(--rm-glass-border);
}

.rm-product-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.rm-product-search-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 1px solid var(--rm-glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    color: var(--rm-text-primary);
    transition: all 0.3s ease;
}

.rm-product-search-input:focus {
    outline: none;
    border-color: var(--rm-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.rm-product-search-btn {
    padding: 0.9rem 1.5rem;
    background: var(--rm-primary);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rm-product-search-btn:hover {
    background: var(--rm-primary-dark);
    transform: scale(1.05);
}

/* Результаты поиска */
.rm-product-search-results {
    max-height: 300px;
    overflow-y: auto;
}

.rm-search-product-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--rm-glass-border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.rm-search-product-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rm-search-product-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 1rem;
}

.rm-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rm-search-product-info {
    flex: 1;
}

.rm-search-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--rm-text-primary);
}

.rm-search-product-sku {
    font-size: 0.8rem;
    color: var(--rm-text-secondary);
    margin-bottom: 0.3rem;
}

.rm-search-product-price {
    font-weight: 600;
    color: var(--rm-primary);
}

.rm-search-product-add {
    background: var(--rm-primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rm-search-product-add:hover {
    background: var(--rm-primary-dark);
    transform: scale(1.1);
}

.rm-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--rm-text-secondary);
    font-style: italic;
}

/* Стили для диаграммы (заменяем сердечко) */
.rm-collapse-indicator {
    position: absolute;
    top: calc(50% + 20px);
    left: -40px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 10px 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.rm-collapse-indicator:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-50%) scale(1.05);
}

/* Анимация для диаграммы */
@keyframes rm-chartPulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

.rm-category-modal.rm-home.rm-collapsed .rm-collapse-indicator {
    animation: rm-chartPulse 2s infinite;
}

/* Обновляем позиции индикаторов */
.rm-kp-indicator {
    top: calc(68% - 140px); /* Смещаем выше */
}

/* Адаптивность */
@media (max-width: 768px) {
    .rm-search-tab-indicator,
    .rm-collapse-indicator {
        display: none !important;
    }
    
    .rm-product-search-panel {
        padding: 1rem;
    }
}
/* Стили для состояния загрузки и ошибок */
.rm-search-loading, .rm-search-error, .rm-no-results, .rm-search-empty {
    text-align: center;
    padding: 2rem;
    color: var(--rm-text-secondary);
}

.rm-search-loading .rm-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rm-primary-light);
    border-top-color: var(--rm-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rm-search-error i, .rm-no-results i, .rm-search-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.rm-search-error {
    color: #ef4444;
}

.rm-search-empty {
    color: var(--rm-primary);
}

/* Улучшенные стили для товаров в поиске */
.rm-search-product-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--rm-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.rm-search-product-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--rm-primary-light);
}

.rm-search-product-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rm-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.rm-search-product-info {
    flex: 1;
    min-width: 0; /* Для корректного переноса текста */
}

.rm-search-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--rm-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rm-search-product-sku {
    font-size: 0.8rem;
    color: var(--rm-text-secondary);
    margin-bottom: 0.3rem;
}

.rm-search-product-price {
    font-weight: 600;
    color: var(--rm-primary);
    font-size: 0.95rem;
}

.rm-search-product-add {
    background: var(--rm-primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.rm-search-product-add:hover {
    background: var(--rm-primary-dark);
    transform: scale(1.1);
}

.rm-search-product-add:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Автодополнение */
.rm-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--rm-glass-border);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.rm-search-suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.rm-search-suggestion-item:hover {
    background: var(--rm-hover-effect);
}