/* grid */
#product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* 📱 Mobile (ค่าเริ่มต้น) */
.product-card {
    width: 45%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    transition: 0.2s;
}

/* 📱 Tablet (≥576px) */
@media (min-width: 576px) {
    .product-card {
        width: 45%;
    }
}

/* 💻 Desktop (≥992px) */
@media (min-width: 992px) {
    .product-card {
        width: 23%;
    }
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* image */
.product-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img {
    max-height: 140px;
    max-width: 100%;
}

/* title */
.product-title {
    font-size: 14px;
    height: 40px;
    overflow: hidden;
    margin: 5px 0;
}

/* loading */
#loading {
    width: 100%;
    text-align: center;
    padding: 20px;
}

/* stock label */
.stock-label {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
}

.in-stock {
    background: #28a745;
}

.out-stock {
    background: #dc3545;
}

/* mpn */
.product-mpn {
    font-size: 12px;
    color: #888;
}

/* price */
.product-price {
    font-weight: bold;
    color: #e60023;
    margin-top: 5px;
}

/* skeleton */
.skeleton {
    animation: pulse 1.5s infinite;
    background: #eee;
    border-radius: 8px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.loading-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.skeleton-box {
    height: 220px;
    background: #eee;
    border-radius: 10px;
    animation: pulse 1.2s infinite;
}

.hl {
    background: yellow;
}

.no-result {
    text-align: center;
    padding: 40px;
}

.error-box {
    text-align: center;
    color: red;
    padding: 20px;
}
    
.search-box {
    position: relative;
}

#suggest-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: none;
    z-index: 999;
}

.suggest-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggest-item:hover {
    background: #f5f5f5;
}