/* Модальное окно поиска */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.search-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.search-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.search-modal__header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.search-modal__input-wrapper {
    position: relative;
    flex: 1;
    margin-right: 20px;
}

.search-modal__input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-modal__input:focus {
    border-color: #007bff;
}

.search-modal__icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: #999;
}

.search-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.search-modal__close:hover {
    opacity: 0.7;
}

.search-modal__close .icon {
    width: 24px;
    height: 24px;
    fill: #666;
}

/* Контейнер результатов */
.search-modal__results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.search-modal__loading,
.search-modal__error,
.search-modal__empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.search-modal__error {
    color: #dc3545;
}

/* Группы результатов */
.search-modal__groups {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-modal__group {
    border-bottom: 1px solid #eee;
    padding: 0;
}

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

.search-modal__group-title {
    margin: 0;
    padding: 15px 20px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Товары */
.search-modal__products {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.search-modal__product {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

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

.search-modal__product:hover {
    background-color: #f8f9fa;
}

.search-modal__product-image {
    width: 70px;
    height: 70px;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-modal__product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-modal__product-info {
    flex: 1;
    min-width: 0;
}

.search-modal__product-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.search-modal__product-sku {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #999;
}

.search-modal__product-price {
    margin: 0 0 5px 0;
    color: #007bff;
    font-weight: 600;
    font-size: 16px;
}

.search-modal__product-manufacturer {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Общие элементы (категории, производители, страницы) */
.search-modal__items {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.search-modal__item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

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

.search-modal__item:hover {
    background-color: #f8f9fa;
}

.search-modal__item-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
}

.search-modal__item-icon .icon {
    width: 20px;
    height: 20px;
    fill: #666;
}

.search-modal__item-logo {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 5px;
}

.search-modal__item-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-modal__item-image {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-modal__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-modal__item-info {
    flex: 1;
    min-width: 0;
}

.search-modal__item-name {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.search-modal__item-meta {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.search-modal__item-excerpt {
    margin: 5px 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Футер */
.search-modal__footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
}

.search-modal__footer-text {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.search-modal__footer .btn {
    display: inline-block;
    padding: 12px 35px;
    text-decoration: none;
    background: #007bff;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.search-modal__footer .btn:hover {
    background: #0056b3;
}

/* Адаптивность */
@media (max-width: 768px) {
    .search-modal__content {
        width: 95%;
        max-width: none;
        top: 10px;
        bottom: 10px;
        transform: translateX(-50%);
        max-height: none;
        height: calc(100vh - 20px);
    }
    
    .search-modal__header {
        padding: 15px;
    }
    
    .search-modal__input {
        padding: 10px 40px 10px 12px;
        font-size: 16px;
    }
    
    .search-modal__group-title {
        padding: 12px 15px 8px;
        font-size: 13px;
    }
    
    .search-modal__product {
        padding: 12px 15px;
    }
    
    .search-modal__product-image {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }
    
    .search-modal__product-name {
        font-size: 15px;
    }
    
    .search-modal__product-price {
        font-size: 15px;
    }
    
    .search-modal__item {
        padding: 10px 15px;
    }
    
    .search-modal__item-logo,
    .search-modal__item-image {
        width: 45px;
        height: 45px;
    }
    
    .search-modal__item-icon {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .search-modal__content {
        width: 100%;
        top: 0;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .search-modal__header {
        padding: 12px;
    }
    
    .search-modal__input-wrapper {
        margin-right: 10px;
    }
    
    .search-modal__input {
        padding: 10px 35px 10px 10px;
        font-size: 16px;
    }
}

/* Скроллбар */
.search-modal__results::-webkit-scrollbar {
    width: 6px;
}

.search-modal__results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-modal__results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.search-modal__results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Стили для страницы поиска */
.search-results {
    margin-top: 30px;
}

.search-results__input {
    position: relative;
    margin-bottom: 30px;
}

.search-results__input form {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-results__input-field {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e1e3e5;
    border-radius: 8px;
    font-size: 16px;
    font-family: "Inter", sans-serif;
    color: #3c3c3c;
    outline: none;
    transition: border-color 0.3s;
}

.search-results__input-field:focus {
    border-color: #5b4868;
}

.search-results__input-field::placeholder {
    color: rgba(60, 60, 60, 0.5);
}

.search-results__text {
    font-size: 14px;
    color: #3c3c3c;
    margin-bottom: 30px;
}

.search-results__content {
    margin-top: 30px;
}

.search-results__loading,
.search-results__error,
.search-results__empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

.search-results__error {
    color: #dc3545;
}

/* Группы результатов */
.search-results__groups {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-results__group {
    margin-bottom: 40px;
    border-bottom: 1px solid #e1e3e5;
    padding-bottom: 30px;
}

.search-results__group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.search-results__group-title {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 20px;
    font-weight: 500;
    color: #3c3c3c;
    text-transform: none;
    letter-spacing: -0.4px;
}

/* Товары */
.search-results__products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 767px) {
    .search-results__products {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.search-results__product {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border: 1px solid #e1e3e5;
    border-radius: 8px;
    background: #fff;
}

.search-results__product:hover {
    background-color: #f8f8f8;
    border-color: #5b4868;
}

.search-results__product-image {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-results__product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-results__product-info {
    flex: 1;
    min-width: 0;
}

.search-results__product-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
    color: #3c3c3c;
    line-height: 1.4;
}

.search-results__product-name mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
}

.search-results__product-sku {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #999;
}

.search-results__product-sku mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
}

.search-results__product-price {
    margin: 0 0 5px 0;
    color: #5b4868;
    font-weight: 600;
    font-size: 16px;
}

.search-results__product-manufacturer {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Общие элементы (категории, производители, коллекции, блог) */
.search-results__items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.search-results__item {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

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

.search-results__item:hover {
    background-color: #f8f8f8;
}

.search-results__item-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
}

.search-results__item-icon .icon {
    width: 20px;
    height: 20px;
    fill: #666;
}

.search-results__item-logo {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 5px;
}

.search-results__item-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-results__item-image {
    width: 60px;
    height: 60px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-results__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-results__item-info {
    flex: 1;
    min-width: 0;
}

.search-results__item-name {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 500;
    color: #3c3c3c;
    line-height: 1.4;
}

.search-results__item-name mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
}

.search-results__item-meta {
    margin: 0;
    font-size: 13px;
    color: #999;
}

.search-results__item-excerpt {
    margin: 5px 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Футер */
.search-results__footer {
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #e1e3e5;
    margin-top: 30px;
}

.search-results__footer-text {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 767px) {
    .search-results {
        margin-top: 20px;
    }
    
    .search-results__input {
        margin-bottom: 20px;
    }
    
    .search-results__input form {
        max-width: 100%;
    }
    
    .search-results__input-field {
        padding: 10px 40px 10px 12px;
        font-size: 16px;
    }
    
    .search-results__group {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }
    
    .search-results__group-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .search-results__product {
        padding: 12px;
    }
    
    .search-results__product-image {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }
    
    .search-results__product-name {
        font-size: 15px;
    }
    
    .search-results__product-price {
        font-size: 15px;
    }
    
    .search-results__item {
        padding: 12px;
    }
    
    .search-results__item-logo,
    .search-results__item-image {
        width: 45px;
        height: 45px;
    }
    
    .search-results__item-icon {
        width: 35px;
        height: 35px;
    }
}
item-logo,
    .search-results__item-image {
        width: 45px;
        height: 45px;
    }
    
    .search-results__item-icon {
        width: 35px;
        height: 35px;
    }
}
