/* ===== Catalog Search ===== */
.catalog-search {
    margin-bottom: 24px;
    width: 100%;
    max-width: 720px;
}

.catalog-search-form {
    position: relative;
    width: 100%;
}

.catalog-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.catalog-search-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #6b7280;
    pointer-events: none;
    transition: color 0.2s;
}

.catalog-search-wrapper:focus-within .catalog-search-icon {
    color: #298CFF;
}

.catalog-search-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: #1a1f2e;
    border: 2px solid #2a2f3e;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.catalog-search-wrapper input::placeholder {
    color: #6b7280;
}

.catalog-search-wrapper input:focus {
    border-color: #298CFF;
    box-shadow: 0 0 0 4px rgba(41, 140, 255, 0.15);
}

.catalog-search-clear {
    position: absolute;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2f3e;
    border: none;
    border-radius: 50%;
    color: #888;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.catalog-search-clear:hover {
    background: #ff4757;
    color: #fff;
}

/* Autocomplete dropdown */
.catalog-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #1a1f2e;
    border: 1px solid #2a2f3e;
    border-radius: 14px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.catalog-search-results::-webkit-scrollbar {
    width: 6px;
}

.catalog-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.catalog-search-results::-webkit-scrollbar-thumb {
    background: #2a2f3e;
    border-radius: 3px;
}

.catalog-search-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(42, 47, 62, 0.5);
}

.catalog-search-result:last-child {
    border-bottom: none;
}

.catalog-search-result:hover {
    background: rgba(41, 140, 255, 0.08);
}

.catalog-search-result img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.catalog-search-result-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.catalog-search-result-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.catalog-search-result-meta {
    font-size: 12px;
    color: #6b7280;
}

.catalog-search-empty {
    padding: 24px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* ===== Sort Bar ===== */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(36, 45, 64, 0.6) 0%, rgba(32, 37, 53, 0.8) 100%);
    border: 1px solid rgba(41, 140, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.sort-bar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sort-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: #8b9dc3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sort-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(41, 140, 255, 0.08);
    border: 1px solid rgba(41, 140, 255, 0.2);
    border-radius: 10px;
    color: #8b9dc3;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.sort-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(41, 140, 255, 0.15) 0%, rgba(41, 140, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.sort-btn:hover {
    background: rgba(41, 140, 255, 0.15);
    border-color: rgba(41, 140, 255, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 140, 255, 0.2);
}

.sort-btn:hover::before {
    opacity: 1;
}

.sort-btn.active {
    background: linear-gradient(135deg, rgba(41, 140, 255, 0.25) 0%, rgba(41, 140, 255, 0.15) 100%);
    border-color: #298CFF;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(41, 140, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sort-btn.active::before {
    opacity: 1;
}

.sort-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #298CFF, transparent);
    border-radius: 1px;
}

.sort-btn-icon {
    font-size: 15px;
    line-height: 1;
    filter: saturate(0.8);
    transition: all 0.25s ease;
}

.sort-btn:hover .sort-btn-icon {
    filter: saturate(1.2);
    transform: scale(1.1);
}

.sort-btn.active .sort-btn-icon {
    filter: saturate(1.5);
}

.sort-btn-label {
    position: relative;
    z-index: 1;
}

/* Mobile */
@media (max-width: 860px) {
    .sort-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
        margin-bottom: 16px;
    }

    .sort-bar-left {
        justify-content: flex-start;
    }

    .sort-bar-right {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .sort-bar-right::-webkit-scrollbar {
        display: none;
    }

    .sort-btn {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .sort-btn-icon {
        font-size: 14px;
    }
}
    .catalog-search {
        margin-bottom: 16px;
        max-width: 100%;
    }

    .catalog-search-wrapper input {
        padding: 12px 44px 12px 44px;
        font-size: 14px;
        border-radius: 12px;
    }

    .catalog-search-icon {
        left: 14px;
        width: 18px;
        height: 18px;
    }

    .catalog-search-result img {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }
}
