.custom-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.custom-search__form {
    width: 100%;
}

.custom-search__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
	border-right: 1px solid #e7e1db;
}

.custom-search__input {
    width: 500px;
    padding: 20px 56px 20px 16px;
    border: 0;
    font-family: 'Styrene A Web', sans-serif;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.64px;
    box-shadow: 0 1px 0 0 #e7e1db;   
}

.custom-search__input:focus {
    border-color: #3b82f6;
}

.custom-search__submit {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
    z-index: 2;
}

.custom-search__submit:hover {
    color: #3b82f6;
}

.custom-search__suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

/* Стили для десктопной версии (по умолчанию) */
.search-suggestions__section {
    border-bottom: 1px solid #f3f4f6;
    padding: 8px 0;
}

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

.search-suggestions__title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-suggestions__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.search-suggestions__item:hover {
    background-color: #f9fafb;
}

.search-suggestions__text {
    flex: 1;
    color: #374151;
}

.search-suggestions__count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: 8px;
}

.search-suggestions__item--product {
    align-items: flex-start;
    gap: 12px;
}

.search-suggestions__product-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

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

.search-suggestions__product-name {
    font-size: 12px;
	color: #939393;
}

.search-suggestions__product-price {
    font-family: "Styrene A Web", sans-serif;
    font-size: 1.2rem;
    letter-spacing: -0.24px;
}

.search-suggestions__product-brand {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}
.search-suggestions__product-info {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
/* Стили для тегов */
.search-suggestions__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 8px;
}

.search-suggestions__tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.search-suggestions__tag:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Анимация загрузки */
.search-suggestions__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-suggestions__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
}

.search-suggestions__error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #ef4444;
}

.search-suggestions__error-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* ==================== */
/* МОБИЛЬНАЯ АДАПТАЦИЯ */
/* ==================== */

@media (max-width: 768px) {
    .custom-search {
        position: relative;
        max-width: 100%;
        margin: 0;
    }
    
    .custom-search__input {
        font-size: 16px;
        padding: 14px 50px 14px 16px;
        border-radius: 8px;
    }
    
    .custom-search__suggestions {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: none;
        height: 100vh;
        margin-top: 0;
        border-radius: 0;
        border: none;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.98);
        display: none;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .custom-search__suggestions.active {
        display: flex;
        transform: translateY(0);
    }
	
    /*.custom-search__suggestions::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.1);
        z-index: -1;
    }*/
    
    .search-suggestions__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        background: white;
        position: sticky;
        top: 0;
        z-index: 1;
        min-height: 60px;
        box-sizing: border-box;
    }
	
    .search-suggestions__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        background: white;
        position: sticky;
        top: 0;
        z-index: 1;
        min-height: 60px;
        box-sizing: border-box;
    }
    
    .search-suggestions__search-box {
        flex: 1;
        margin-right: 16px;
    }
    
    .search-suggestions__search-input {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        font-size: 16px;
        outline: none;
        box-sizing: border-box;
    }
    
    .search-suggestions__search-input:focus {
        border-color: #3b82f6;
    }
    
    .search-suggestions__close {
        background: none;
        border: none;
        font-size: 24px;
        color: #6b7280;
        cursor: pointer;
        padding: 4px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .search-suggestions__content {
        flex: 1;
        overflow-y: auto;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    .search-suggestions__section {
        padding: 0;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .search-suggestions__title {
        padding: 12px 16px 8px;
        font-size: 13px;
        background: #f9fafb;
        margin: 0;
    }
    
    .search-suggestions__item {
        padding: 14px 16px;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .search-suggestions__item:last-child {
        border-bottom: none;
    }
    
    .search-suggestions__item--product {
        padding: 12px 16px;
    }
    
    .search-suggestions__product-image {
        width: 50px;
        height: 50px;
    }
    
    .search-suggestions__product-name {
        -webkit-line-clamp: 2;
        font-size: 15px;
    }
    
    .search-suggestions__tags {
        padding: 8px 16px 12px;
        gap: 6px;
    }
    
    .search-suggestions__tag {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .search-suggestions__loading,
    .search-suggestions__error {
        padding: 40px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .custom-search {
        max-width: 100%;
    }
    
    .search-suggestions__header {
        padding: 12px;
        min-height: 56px;
    }
    
    .search-suggestions__search-box {
        margin-right: 12px;
    }
    
    .search-suggestions__search-input {
        padding: 10px 14px;
    }
    
    .search-suggestions__item {
        padding: 12px 16px;
    }
    
    .search-suggestions__product-image {
        width: 45px;
        height: 45px;
    }
    
    .search-suggestions__product-name {
        font-size: 14px;
    }
    
    .search-suggestions__tags {
        padding: 8px 12px 12px;
    }
    
    .search-suggestions__tag {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Для очень высоких устройств */
@media (max-width: 768px) and (max-height: 600px) {
    .custom-search__suggestions {
        height: 100vh;
    }
}

/* Безопасные области для iPhone X и новее */
@supports(padding: max(0px)) {
    @media (max-width: 768px) {
        .search-suggestions__header {
            padding-top: max(16px, env(safe-area-inset-top));
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
        }
        
        .search-suggestions__content {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
}

@media screen and (max-width: 768px) {
    .custom-search__input-wrapper input {
        display: none !important;
    }
}
