/* Catalog Pages - Dark Mode Support */

/* Stats Cards */
.catalog-stats-card {
    border: none !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.catalog-stats-icon {
    border-radius: 50%;
    padding: 0.75rem;
}

.catalog-stats-icon.blue {
    background-color: rgba(59, 130, 246, 0.1);
}

.catalog-stats-icon.green {
    background-color: rgba(34, 197, 94, 0.1);
}

.catalog-stats-icon.yellow {
    background-color: rgba(234, 179, 8, 0.1);
}

.catalog-stats-icon.pink {
    background-color: rgba(236, 72, 153, 0.1);
}

[data-bs-theme="dark"] .catalog-stats-icon.blue {
    background-color: rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] .catalog-stats-icon.green {
    background-color: rgba(34, 197, 94, 0.2);
}

[data-bs-theme="dark"] .catalog-stats-icon.yellow {
    background-color: rgba(234, 179, 8, 0.2);
}

[data-bs-theme="dark"] .catalog-stats-icon.pink {
    background-color: rgba(236, 72, 153, 0.2);
}

/* Text colors that adapt to theme */
.catalog-text-muted {
    color: #6c757d;
}

[data-bs-theme="dark"] .catalog-text-muted {
    color: #adb5bd;
}

.catalog-text-secondary {
    color: #6c757d;
}

[data-bs-theme="dark"] .catalog-text-secondary {
    color: #e9ecef;
}

/* Empty state icons */
.catalog-empty-icon {
    color: #d1d5db;
}

[data-bs-theme="dark"] .catalog-empty-icon {
    color: #6c757d;
}

/* Category Tree Styles */
.catalog-tree .category-header {
    background: var(--bs-light);
    border-left: 3px solid var(--bs-primary);
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

[data-bs-theme="dark"] .catalog-tree .category-header {
    background: rgba(255, 255, 255, 0.05);
}

.catalog-tree .category-header:hover {
    background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .catalog-tree .category-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.catalog-tree .category-header.collapsed {
    border-left-color: var(--bs-secondary);
}

.catalog-tree .subcategory {
    margin-left: 20px;
    margin-top: 8px;
}

.catalog-tree .item-row {
    padding: 8px 16px;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background 0.2s;
}

.catalog-tree .item-row:hover {
    background: var(--bs-secondary-bg);
}

.catalog-tree .item-row:last-child {
    border-bottom: none;
}

.catalog-tree .no-items {
    padding: 16px;
    font-style: italic;
}

/* Item row link color */
.catalog-item-link {
    color: var(--bs-body-color);
    text-decoration: none;
    font-weight: 600;
}

.catalog-item-link:hover {
    color: var(--bs-primary);
}

/* Search box styling */
.catalog-search-icon {
    background-color: var(--bs-body-bg) !important;
    border-right: 0 !important;
}

.catalog-search-input {
    border-left: 0 !important;
    border-right: 0 !important;
}

.catalog-card-header {
    background-color: var(--bs-body-bg) !important;
    border: 0 !important;
}

/* Price text */
.catalog-price {
    font-weight: 600;
}

[data-bs-theme="dark"] .catalog-price {
    color: #e9ecef;
}

/* Alert permanent (for filter info) */
.alert-permanent {
    margin-bottom: 1rem;
}

/* Item row — flex on all sizes, stacks on mobile */
.catalog-tree .item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.item-row-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Search inputs — fluid on mobile, capped on desktop */
.catalog-search-group {
    flex: 1 1 auto;
    min-width: 0;
}

.catalog-category-select {
    flex: 1 1 auto;
    min-width: 0;
}

@media (min-width: 992px) {
    .catalog-search-group  { max-width: 280px; }
    .catalog-category-select { max-width: 200px; }
}

/* On very small screens, stack name above meta */
@media (max-width: 480px) {
    .catalog-tree .item-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .item-row-name {
        white-space: normal;
        width: 100%;
    }

    .item-row-meta {
        width: 100%;
        justify-content: space-between;
    }

    .catalog-tree .subcategory {
        margin-left: 8px;
    }
}
