/* 자동완성 박스 스타일 */
.search-box {
    position: relative;
}

.search-box-component {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    max-height: 560px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.search-box-component ul {
    list-style: none;
    padding: 8px;
    margin: 0;
}

/* 키보드로 선택된 항목 스타일 */
.autocomplete-item.selected {
    background-color: #f0f0f0;
    cursor: pointer;
}

/* 자동완성 아이템 */
.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 4px;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.autocomplete-item:last-of-type {
    margin-bottom: 0;
}
/* 선택된 항목의 포커스 표시 */
.autocomplete-item.selected .content p {
    font-weight: 500;
}

/* 상품 이미지 */
.autocomplete-image {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    flex-shrink: 0;
    position: relative;
    background-color: #f5f5f5;
    border: 1px solid #efefef;
}

/* 할인율 뱃지 */
.autocomplete-image .sale-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

/* 상품 정보 */
.autocomplete-content {
    flex: 1;
    margin-left: 16px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    align-items: flex-start !important;
}

.autocomplete-title {
    margin: 0;
    font-weight: 500;
    color: #222;
    overflow: visible;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    letter-spacing: -0.02em;

}

.autocomplete-title .highlight {
    color: #007bff;
    font-weight: 700;
    border-radius: 3px;
    vertical-align: initial;
}

/* 가격 정보 */
.autocomplete-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.autocomplete-price strong {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.03em;
}

.autocomplete-price del {
    font-size: 14px;
    color: #aaa;
    font-weight: 400;
}

/* 전체 결과 보기 */
.autocomplete-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: pointer;
    background: linear-gradient(to bottom, transparent, #f8f9fa);
    transition: all 0.2s;
    gap: 10px;
    border-radius: 0 0 12px 12px;
    margin-top: 4px;
}

.autocomplete-view-all:hover {
    background: linear-gradient(to bottom, transparent, #e9ecef);
}

.autocomplete-view-all p {
    margin: 0;
    font-size: 15px;
    color: #495057;
    font-weight: 500;
}

.autocomplete-view-all strong {
    color: #007bff;
    font-weight: 700;
}

.autocomplete-view-all .material-symbols-rounded {
    font-size: 22px;
    color: #6c757d;
}

/* 스크롤바 스타일 */
.search-box-component::-webkit-scrollbar {
    width: 8px;
}

.search-box-component::-webkit-scrollbar-track {
    background: transparent;
}

.search-box-component::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.search-box-component::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #999;
    font-size: 14px;
    gap: 8px;
}
.smooth-dots {
    display: flex;
    gap: 8px;
}

.smooth-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #007bff;
    animation: smooth-pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.smooth-dots span:nth-child(1) { animation-delay: 0s; }
.smooth-dots span:nth-child(2) { animation-delay: 0.15s; }
.smooth-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes smooth-pulse {
    0%, 100% {
        transform: scale(0.7);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 결과 없음 */
.autocomplete-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #999;
    font-size: 14px;
}

.autocomplete-image {
    width: 60px;         /* 원하는 크기 */
    height: 60px;        /* 원하는 크기 */
    background-size: contain;   /* 이미지 비율 유지 + 잘리지 않음 */
    background-repeat: no-repeat;
    background-position: center;
    background-color: #fff;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .search-box-component {
        top: calc(100% + 2px);
        border-radius: 8px;
        max-height: 450px;
    }

    .autocomplete-item {
        padding: 12px;
    }

    .autocomplete-image {
        width: 70px;
        height: 70px;
    }

    .autocomplete-image .sale-badge {
        top: 4px;
        left: 4px;
        padding: 3px 6px;
        font-size: 11px;
    }

    .autocomplete-content {
        margin-left: 12px;
        gap: 6px;
    }

    .autocomplete-title {
        font-size: 14px;
        line-height: 1.4;
    }

    .autocomplete-price strong {
        font-size: 15px;
    }

    .autocomplete-price del {
        font-size: 13px;
    }

    .autocomplete-view-all {
        padding: 14px;
    }

    .autocomplete-view-all p {
        font-size: 14px;
    }
}

/* 태블릿 */
@media (max-width: 1024px) and (min-width: 769px) {
    .autocomplete-image {
        width: 75px;
        height: 75px;
    }

    .autocomplete-title {
        font-size: 14px;
    }

    .autocomplete-price strong {
        font-size: 16px;
    }
}

