/* Стили для страницы конструктора сборок */

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: 16px;
}

.page-header h1 {
    font-size: 36px;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-header p {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Конструктор сборок */
.assembly-builder {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-bottom: 50px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
}

/* Левая панель - категории компонентов */
.assembly-sidebar {
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    padding: 25px 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.assembly-sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.assembly-sidebar-header h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.assembly-sidebar-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Категории компонентов */
.components-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.components-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
}

.components-category:hover {
    border-color: var(--yellow-secondary);
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.components-category.active {
    background: var(--yellow-gradient);
    border-color: transparent;
    color: #333;
    font-weight: 600;
}

.components-category i:first-child {
    font-size: 18px;
    width: 24px;
    color: var(--yellow-secondary);
}

.components-category.active i:first-child {
    color: #333;
}

.components-category i:last-child {
    font-size: 14px;
    opacity: 0.7;
}

/* Основная область */
.assembly-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 25px;
}

/* Текущая сборка */
.current-assembly {
    background: #f9fafb;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e7eb;
}

.current-assembly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.current-assembly-header h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-clear-assembly {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-clear-assembly:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* Предпросмотр сборки */
.assembly-preview {
    margin-bottom: 25px;
}

.assembly-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.assembly-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

.assembly-empty p {
    font-size: 16px;
    margin: 0;
}

/* Блок «Ваша сборка»: слева корпус крупнее, справа остальные компоненты сверху вниз */
.assembly-preview-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.assembly-case-preview {
    flex: 0 0 auto;
    min-width: 280px;
    max-width: 360px;
}

.assembly-case-preview .assembly-case-card,
.assembly-case-preview .assembly-case-placeholder {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fafafa;
    text-align: center;
}

.assembly-case-preview .assembly-case-card .component-image,
.assembly-case-preview .assembly-case-placeholder .component-image {
    width: 220px;
    height: 220px;
    min-width: 220px;
    min-height: 220px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.assembly-case-preview .assembly-case-card .component-image img,
.assembly-case-preview .assembly-case-placeholder .component-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.assembly-case-preview .assembly-case-card .component-image i,
.assembly-case-preview .assembly-case-placeholder .component-image i {
    font-size: 64px;
    color: #c4b5a5;
}

.assembly-case-preview .assembly-case-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.assembly-case-preview .assembly-case-placeholder i {
    font-size: 64px;
    color: #c4b5a5;
}

.assembly-case-preview .assembly-case-placeholder p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.assembly-case-preview .component-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.assembly-case-preview .component-price {
    font-size: 18px;
    color: var(--yellow-secondary, #c4a035);
}

.selected-components-list {
    flex: 1;
    min-width: 0;
}

/* Справа: остальные компоненты колонкой сверху вниз */
.selected-components {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.selected-components .selected-component {
    aspect-ratio: auto;
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
}

.selected-components .selected-component .component-info {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.selected-components .selected-component .component-image {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    flex-shrink: 0;
}

.selected-components .selected-component .component-details {
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    text-align: left;
}

@media (max-width: 768px) {
    .assembly-preview-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .assembly-case-preview {
        min-width: 0;
        max-width: none;
    }
    .assembly-case-preview .assembly-case-card,
    .assembly-case-preview .assembly-case-placeholder {
        padding: 8px;
    }
    .assembly-case-preview .assembly-case-card .component-image,
    .assembly-case-preview .assembly-case-placeholder .component-image {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        margin: 0 auto 6px;
    }
    .assembly-case-preview .assembly-case-card .component-image i,
    .assembly-case-preview .assembly-case-placeholder .component-image i,
    .assembly-case-preview .assembly-case-placeholder i {
        font-size: 18px;
    }
    .assembly-case-preview .assembly-case-placeholder p {
        font-size: 11px;
    }
    .assembly-case-preview .component-name {
        font-size: 11px;
        margin-bottom: 4px;
    }
    .assembly-case-preview .component-price {
        font-size: 12px;
    }
    .selected-components-list {
        display: contents;
    }
    .selected-components {
        display: contents;
    }
    .selected-components .selected-component {
        flex-direction: column;
        aspect-ratio: 1;
        min-height: 0;
    }
    .selected-components .selected-component .component-info {
        flex-direction: column;
    }
    .selected-components .selected-component .component-image {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    .selected-components .selected-component .component-details {
        align-items: center;
        text-align: center;
    }
    .selected-component {
        padding: 8px;
    }
    .selected-component .component-image,
    .component-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        font-size: 18px;
    }
    .component-name {
        font-size: 11px;
    }
    .selected-component .component-price {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .assembly-preview-content {
        gap: 6px;
    }
    .assembly-case-preview .assembly-case-card,
    .assembly-case-preview .assembly-case-placeholder {
        padding: 6px;
    }
    .assembly-case-preview .assembly-case-card .component-image,
    .assembly-case-preview .assembly-case-placeholder .component-image {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        margin: 0 auto 4px;
    }
    .assembly-case-preview .assembly-case-card .component-image i,
    .assembly-case-preview .assembly-case-placeholder .component-image i,
    .assembly-case-preview .assembly-case-placeholder i {
        font-size: 14px;
    }
    .assembly-case-preview .assembly-case-placeholder p {
        font-size: 10px;
    }
    .assembly-case-preview .component-name {
        font-size: 10px;
    }
    .assembly-case-preview .component-price {
        font-size: 10px;
    }
    .selected-components .selected-component .component-image {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    .selected-component {
        padding: 6px;
    }
    .selected-component .component-image,
    .component-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
    }
    .component-name {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }
    .selected-component .component-price {
        font-size: 10px;
    }
    .selected-component .component-actions {
        top: 4px;
        right: 4px;
    }
    .selected-component .component-actions .btn-remove-component {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

.selected-component {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s;
    position: relative;
}

.selected-component:hover {
    border-color: var(--yellow-secondary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.selected-component .component-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.component-icon,
.selected-component .component-image {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 22px;
    overflow: hidden;
}

.selected-component .component-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.selected-component .component-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

.component-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.selected-component .component-actions {
    position: absolute;
    top: 8px;
    right: 8px;
}

.component-specs {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.component-price {
    font-weight: 600;
    color: var(--yellow-secondary);
    font-size: 16px;
}

.component-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-remove-component {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-remove-component:hover {
    background: #ef4444;
    color: white;
}

/* Итоговая информация */
.assembly-summary {
    background: white;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e5e7eb;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item span:first-child {
    color: #666;
}

.summary-item span:last-child {
    font-weight: 600;
    color: #333;
}

.total-price {
    font-size: 24px;
    color: var(--yellow-secondary) !important;
}

.compatibility .compatibility-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #10b981 !important;
}

.compatibility .compatibility-status i {
    font-size: 18px;
}

/* Кнопки действий */
.assembly-actions {
    display: flex;
    gap: 15px;
}

.btn-save-assembly,
.btn-add-to-cart-assembly {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-save-assembly {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-save-assembly:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-add-to-cart-assembly {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
}

.btn-add-to-cart-assembly:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-save-assembly:disabled,
.btn-add-to-cart-assembly:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Сетка компонентов (используется в модальном окне) */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.components-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.components-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

.components-empty p {
    font-size: 16px;
    margin: 0;
}

.component-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.component-card:hover {
    border-color: var(--yellow-secondary);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.component-card.selected {
    border-color: var(--yellow-secondary);
    background: rgba(255, 193, 7, 0.05);
}

.component-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--yellow-gradient);
}

.component-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.component-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
}

.component-image i {
    font-size: 48px;
    color: var(--yellow-secondary);
}

.component-info-card {
    text-align: center;
}

.component-name-card {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.component-specs-card {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
}

.component-price-card {
    font-weight: 700;
    color: var(--yellow-secondary);
    font-size: 18px;
    margin-bottom: 15px;
}

.btn-select-component {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--yellow-gradient);
    color: #333;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-select-component:hover {
    background: var(--yellow-gradient-dark);
}

.btn-select-component.selected {
    background: #10b981;
    color: white;
}

.btn-select-component.selected:hover {
    background: #059669;
}

/* Популярные сборки */
.popular-assemblies-section {
    margin: 60px 0;
}

.popular-assemblies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.popular-assembly-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.popular-assembly-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.popular-assembly-image {
    height: 140px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.popular-assembly-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s;
}

.popular-assembly-card:hover .popular-assembly-image img {
    transform: scale(1.03);
}

.popular-assembly-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.popular-assembly-image .no-image i {
    font-size: 60px;
    color: #667eea;
    opacity: 0.7;
}

.popular-assembly-info {
    padding: 25px;
}

.popular-assembly-info h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.popular-assembly-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.popular-assembly-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 16px;
}

.popular-assembly-price span:first-child {
    color: #666;
}

.popular-assembly-price .price {
    font-size: 22px;
    font-weight: 700;
    color: var(--yellow-secondary);
}

.popular-assembly-actions {
    display: flex;
    gap: 10px;
}

.popular-assembly-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.popular-assembly-actions .btn-add-to-cart {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
}

.popular-assembly-actions .btn-add-to-cart:hover {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.popular-assembly-actions .btn-use-as-template {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.popular-assembly-actions .btn-use-as-template:hover {
    background: #e9e9e9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Советы по сборке */
.assembly-tips-section {
    margin: 60px 0;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.tip-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.tip-card:hover {
    border-color: var(--yellow-secondary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tip-icon {
    width: 70px;
    height: 70px;
    background: var(--yellow-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #333;
}

.tip-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.tip-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .assembly-builder {
        grid-template-columns: 1fr;
    }

    .assembly-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .popular-assemblies-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 28px;
    }

    .page-header p {
        font-size: 16px;
    }

    .assembly-main {
        padding: 20px;
    }

    .current-assembly {
        padding: 20px;
    }

    .assembly-actions {
        flex-direction: column;
    }

    .components-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .popular-assemblies-grid {
        grid-template-columns: 1fr;
    }

    .popular-assembly-actions {
        flex-direction: column;
    }

    .tips-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .components-grid {
        grid-template-columns: 1fr;
    }

    .component-card {
        padding: 15px;
    }

    .component-image {
        height: 100px;
    }

    .component-name-card {
        height: auto;
        -webkit-line-clamp: 3;
    }
}

/* Модальное окно выбора компонентов (при клике на категорию в сайдбаре) */
#componentsModal.modal-overlay.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content-components {
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Строка поиска в модалке — в стиле проекта (форма, жёлтый фокус) */
.components-modal-search {
    flex-shrink: 0;
    padding: 12px 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.components-modal-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FFC107' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 14px center;
    background-size: 18px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.components-modal-search-input::placeholder {
    color: #9ca3af;
}

.components-modal-search-input:hover {
    border-color: #d1d5db;
}

.components-modal-search-input:focus {
    outline: none;
    border-color: var(--yellow-secondary, #FFC107);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.components-modal-filters {
    display: none;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 20px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.components-modal-filters.visible {
    display: flex !important;
}

.components-modal-filters-caption {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.components-modal-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.components-modal-filters .filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.components-modal-filters .filter-select {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    min-width: 100px;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.components-modal-filters .filter-select:hover {
    border-color: #cbd5e1;
}

.components-modal-filters .filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

@media (max-width: 768px) {
    .components-modal-filters {
        gap: 8px 12px;
        padding: 10px 16px;
    }
    .components-modal-filters-caption {
        flex-basis: 100%;
    }
    .components-modal-filters .filter-select {
        min-width: 90px;
    }
}

.modal-content-components .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

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

.components-modal-grid .component-card {
    margin: 0;
}

.components-modal-grid .components-empty {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .components-modal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .components-modal-grid {
        gap: 8px;
    }
}