/* Стили для поиска с автодополнением */

.header-catalog-search {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
    min-width: 18.75rem;
}

.catalog-button {
    flex-shrink: 0;
}

.search-container {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border: 0.0625rem solid #ddd;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #bf372b;
    box-shadow: 0 0 0 0.125rem rgba(191, 55, 43, 0.1);
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #666;
    transition: color 0.2s;
}

.search-button:hover {
    color: #bf372b;
}

/* Подсказки поиска */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 0.0625rem solid #ddd;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    max-height: 25rem;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    display: none;
}

/* Элементы подсказок */
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 0.0625rem solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f9f9f9;
}

.suggestion-image {
    width: 50px;
    height: 50px;
    border-radius: 0.25rem;
    object-fit: cover;
    flex-shrink: 0;
}

.suggestion-image-placeholder {
    background-color: #f0f0f0;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-category {
    font-size: 0.75rem;
    color: #666;
}

.suggestion-price {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.suggestion-price-old {
    font-size: 0.75rem;
    color: #666;
    text-decoration: line-through;
}

.suggestion-discount {
    font-size: 0.75rem;
    color: #bf372b;
    font-weight: 600;
}

.suggestion-price-current {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

.suggestion-show-all {
    display: block;
    padding: 0.75rem;
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
    color: #bf372b;
    text-decoration: none;
    transition: background-color 0.2s;
}

.suggestion-show-all:hover {
    background: #f3f4f6;
}

.search-suggestions.open {
    display: block;
}

.search-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 0.0625rem solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-suggestion:last-child {
    border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.selected {
    background-color: #f9f9f9;
}

.search-suggestion.selected {
    background-color: #f3edcb;
}

.search-suggestion-title {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.search-suggestion-category {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

.search-suggestion-empty {
    color: #666;
    text-align: center;
}

/* Мобильная версия */
.mobile-suggestions {
    position: static;
    max-height: 18.75rem;
    margin-top: 0.5rem;
}

/* Скрытие подсказок */
.search-suggestions.hidden {
    display: none !important;
}

/* Мобильные подсказки поиска */
.mobile-search-suggestions {
    position: fixed !important;
    top: 83px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    background: white !important;
    max-height: calc(100vh - 83px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e5e7eb;
}

.mobile-search-suggestions.open {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100px !important;
}

.mobile-search-suggestion {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    padding: 0.8rem 1rem !important;
    min-height: 60px !important;
    height: auto !important;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box !important;
    background: white !important;
}

.mobile-search-suggestion:hover,
.mobile-search-suggestion.selected {
    background: #f3f4f6 !important;
}

.mobile-search-suggestion-image {
    width: 50px !important;
    height: 50px !important;
    border-radius: 0.3rem;
    margin-right: 0.8rem !important;
    flex-shrink: 0;
    object-fit: cover;
    display: block !important;
}

.mobile-search-suggestion-content {
    flex: 1 !important;
    min-width: 0;
    overflow: hidden;
    display: block !important;
}

.mobile-search-suggestion-title {
    display: block !important;
    margin-bottom: 0.2rem;
    font-weight: 500;
    line-height: 1.3;
    font-size: 0.875rem;
}

.mobile-search-suggestion-category {
    display: block !important;
    font-size: 0.875rem;
    color: #6b7280;
    opacity: 0.8;
}

.mobile-search-suggestion-price {
    display: block !important;
    flex-shrink: 0;
}

.mobile-search-suggestion-price-current {
    font-weight: 500;
    color: var(--border-heading-color);
}

.mobile-search-suggestion-show-all {
    display: block !important;
    padding: 0.8rem;
    min-height: 40px !important;
    height: auto !important;
    box-sizing: border-box !important;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
}

.mobile-search-suggestion-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: #666;
}

.mobile-search-suggestion-empty svg {
    width: 3rem;
    height: 3rem;
    opacity: 0.5;
}
