/* 頂部搜尋：產品建議下拉（search.js） */
.header .htop .hsearch {
    position: relative;
}

.search-wrap {
    position: relative;
    width: 100%;
}

/* 比搜尋框（約 360px）更寬：右對齊輸入框，向左展開 */
.search-suggestions {
    position: absolute;
    left: auto;
    right: 0;
    top: 100%;
    width: min(620px, calc(100vw - 32px));
    min-width: 100%;
    margin-top: 6px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    max-height: min(70vh, 480px);
    overflow: auto;
    text-align: left;
    box-sizing: border-box;
}

.search-suggestions .loading {
    padding: 16px 20px;
    color: #666;
    font-size: 14px;
}

.s-grid {
    padding: 12px 0;
}

.s-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.s-head .title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.s-head .title .q {
    color: #025b09;
    font-weight: 600;
}

.s-head .more a.see-more {
    font-size: 13px;
    color: #025b09;
    text-decoration: none;
}

.s-head .more a.see-more:hover {
    text-decoration: underline;
}

.p-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 0 12px 8px;
    align-content: flex-start;
}

.search-suggestions .s-empty {
    width: 100%;
    padding: 28px 16px;
    text-align: center;
    color: #888;
    font-size: 15px;
    line-height: 1.5;
}

.prod-item.s-item {
    width: calc(50% - 6px);
    min-width: 140px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.prod-item.s-item:hover {
    background: #f7faf7;
    border-color: #e0ebe0;
}

.prod-item .thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
}

.prod-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prod-item .pname {
    margin-top: 6px;
    font-size: 13px;
    color: #222;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prod-item .ptag {
    font-size: 12px;
    color: #888;
}

.prod-item .psub {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media screen and (max-width: 980px) {
    .search-suggestions {
        display: none !important;
    }
}
