/* Современный выпадающий список каталога */
.catalog-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Кнопка каталога */
.catalog-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.9375rem rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.catalog-button:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.5625rem rgba(59, 130, 246, 0.4);
}

.catalog-button.active {
    transform: translateY(-0.0625rem);
    box-shadow: 0 0.375rem 1.25rem rgba(59, 130, 246, 0.5);
}

.catalog-button-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.catalog-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2.5;
}

.catalog-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.catalog-chevron {
    width: 1rem;
    height: 1rem;
    transition: transform 0.3s ease;
}

.catalog-button.active .catalog-chevron {
    transform: rotate(180deg);
}

/* Выпадающий список */
.catalog-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.15);
    border: 0.0625rem solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    min-width: 50rem;
    max-width: 62.5rem;
    opacity: 0;
    transform: translateY(-0.625rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    backdrop-filter: blur(0.625rem);
}

.catalog-dropdown.show {
    opacity: 1;
    transform: translateY(0);
}

.catalog-dropdown-content {
    padding: 1.5rem;
    max-height: 37.5rem;
    overflow: hidden;
}

/* Состояние загрузки */
.catalog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.75rem 2.5rem;
    gap: 1rem;
    color: #6b7280;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 0.1875rem solid #f3f4f6;
    border-top: 0.1875rem solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Основной контент */
.catalog-main-content {
    display: grid;
    grid-template-columns: 18.75rem 1fr;
    grid-template-rows: 1fr auto;
    gap: 1.5rem;
    height: 31.25rem;
}

/* Левая панель с категориями */
.catalog-categories-panel {
    display: flex;
    flex-direction: column;
    border-right: 0.0625rem solid #e5e7eb;
    padding-right: 1.5rem;
}

.catalog-categories-header {
    margin-bottom: 1.25rem;
}

.catalog-categories-header h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.catalog-search-mini {
    position: relative;
    margin-bottom: 1rem;
}

.catalog-search-mini input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.catalog-search-mini input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.catalog-search-mini svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

.catalog-categories-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Кастомный скроллбар */
.catalog-categories-list::-webkit-scrollbar {
    width: 0.25rem;
}

.catalog-categories-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0.125rem;
}

.catalog-categories-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 0.125rem;
}

.catalog-categories-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Элементы категорий */
.catalog-category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    border: 0.0625rem solid transparent;
}

.catalog-category-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #e2e8f0;
    transform: translateX(0.25rem);
}

.catalog-category-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateX(0.25rem);
    box-shadow: 0 0.25rem 0.75rem rgba(59, 130, 246, 0.3);
}

.catalog-category-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: #f3f4f6;
    flex-shrink: 0;
}

.catalog-category-item.active .catalog-category-icon {
    background: rgba(255, 255, 255, 0.2);
}

.catalog-category-icon img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.catalog-category-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #6b7280;
}

.catalog-category-item.active .catalog-category-icon svg {
    color: white;
}

.catalog-category-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.catalog-category-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1f2937;
}

.catalog-category-item.active .catalog-category-name {
    color: white;
}

.catalog-category-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.catalog-category-item.active .catalog-category-count {
    color: rgba(255, 255, 255, 0.8);
}

.catalog-category-arrow {
    width: 1rem;
    height: 1rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.catalog-category-item.active .catalog-category-arrow {
    color: white;
}

/* Правая панель с подкатегориями */
.catalog-subcategories-panel {
    display: flex;
    flex-direction: column;
}

.catalog-subcategories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 0.0625rem solid #e5e7eb;
}

.catalog-subcategories-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.catalog-subcategories-count {
    font-size: 0.875rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
}

.catalog-subcategories-grid {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Приветственное сообщение */
.catalog-welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 18.75rem;
    text-align: center;
    color: #6b7280;
    gap: 1rem;
}

.catalog-welcome-message svg {
    width: 3rem;
    height: 3rem;
    color: #d1d5db;
}

.catalog-welcome-message p {
    margin: 0;
    font-size: 1rem;
    max-width: 17.5rem;
}

/* Элементы подкатегорий */
.catalog-subcategory-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    border: 0.0625rem solid #f3f4f6;
    background: #fafbfc;
}

.catalog-subcategory-item:hover {
    background: white;
    border-color: #3b82f6;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.1);
}

.catalog-subcategory-image {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 0.625rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.catalog-subcategory-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.catalog-subcategory-placeholder svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #9ca3af;
}

.catalog-subcategory-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.catalog-subcategory-info h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.catalog-subcategory-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-subcategory-count {
    font-size: 0.75rem;
    color: #3b82f6;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Отсутствие подкатегорий */
.catalog-no-subcategories {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 18.75rem;
    text-align: center;
    gap: 1rem;
}

.catalog-no-subcategories svg {
    width: 3rem;
    height: 3rem;
    color: #d1d5db;
}

.catalog-no-subcategories p {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
}

.view-category-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-category-btn:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.5625rem rgba(59, 130, 246, 0.3);
}

/* Популярные категории */
.catalog-popular-section {
    grid-column: 1 / -1;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

.catalog-popular-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.catalog-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.catalog-popular-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fafbfc;
    border: 1px solid #f3f4f6;
}

.catalog-popular-item:hover {
    background: white;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.catalog-popular-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-popular-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.catalog-popular-icon svg {
    width: 20px;
    height: 20px;
    color: #6b7280;
}

.catalog-popular-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.catalog-popular-count {
    font-size: 12px;
    color: #6b7280;
}

/* Состояние ошибки */
.catalog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    gap: 16px;
    text-align: center;
}

.catalog-error svg {
    width: 48px;
    height: 48px;
    color: #ef4444;
}

.catalog-error p {
    margin: 0;
    color: #6b7280;
    font-size: 16px;
}

.retry-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .catalog-dropdown {
        min-width: 700px;
        max-width: 800px;
    }
    
    .catalog-main-content {
        grid-template-columns: 250px 1fr;
        height: 450px;
    }
}

@media (max-width: 768px) {
    .catalog-dropdown {
        min-width: 90vw;
        max-width: 90vw;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
    }
    
    .catalog-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .catalog-main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: 70vh;
        max-height: 500px;
    }
    
    .catalog-categories-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-right: 0;
        padding-bottom: 20px;
        max-height: 200px;
    }
    
    .catalog-subcategories-panel {
        padding-top: 20px;
    }
    
    .catalog-popular-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .catalog-dropdown-content {
        padding: 16px;
    }
    
    .catalog-button-content {
        padding: 10px 14px;
        gap: 6px;
    }
    
    .catalog-text {
        font-size: 13px;
    }
    
    .catalog-icon {
        width: 18px;
        height: 18px;
    }
} 