/**
 * SMB Product Grid Styles
 */
.smb-product-grid {
    --smb-grid-gap: 10px;
    --smb-card-bg: #fff;
    --smb-card-border: 1px solid #e1e1e1;
    --smb-card-hover-border: 1px solid #dcbdf5; /* Light purple from screenshot */
    --smb-card-radius: 8px;
    --smb-text-color: #333;
    --smb-price-color: #000;
    --smb-sale-color: #fa592d; /* Orange-red like Shopee */
    --smb-meta-color: #999;
    
    display: grid;
    grid-template-columns: repeat(var(--wd-col-lg, 5), 1fr);
    gap: var(--smb-grid-gap);
}

.smb-product-grid-item {
    background: var(--smb-card-bg);
    border: var(--smb-card-border);
    border-radius: var(--smb-card-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.smb-product-grid-item:hover {
    border: var(--smb-card-hover-border);
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* Image Section */
.smb-pg-image {
    position: relative;
    padding-bottom: 100%; /* Square aspect ratio */
    overflow: hidden;
}

.smb-pg-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.smb-product-grid-item:hover .smb-pg-image img {
    transform: scale(1.05);
}

/* Badges on Image */
.smb-pg-badges {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    z-index: 2;
}

.smb-badge-img {
    height: 20px;
    width: auto;
    display: block;
}

.smb-badge-text {
    background: #00bfa5; /* Green like Tokopedia/Shopee free shipping */
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Content Section */
.smb-pg-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 4px;
}

.smb-pg-title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--smb-text-color);
    margin: 0 0 4px;
    font-weight: 400;
    
    /* 2 Line clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em; /* Fallback height */
}

.smb-pg-title a {
    color: inherit;
    text-decoration: none;
}

/* Price Block */
.smb-pg-price {
    margin-bottom: 4px;
}

.smb-pg-price-current {
    font-size: 16px;
    font-weight: 700;
    color: var(--smb-text-color);
}

.smb-pg-price-sale {
    font-size: 16px;
    font-weight: 700;
    color: var(--smb-text-color);
}

.smb-pg-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.smb-pg-price-old {
    font-size: 12px;
    color: var(--smb-meta-color);
    text-decoration: line-through;
}

.smb-pg-discount-badge {
    font-size: 10px;
    color: #fa592d;
    background: #fcdbd6;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
}

/* Vouchers / Extra Badges */
.smb-pg-vouchers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.smb-pg-voucher {
    border: 1px solid #fa592d;
    color: #fa592d;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
}

.smb-pg-voucher.green {
    border-color: #00bfa5;
    color: #00bfa5;
}

/* Countdown */
.smb-pg-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #fa592d;
    background: #fcdbd6;
    padding: 2px 4px;
    border-radius: 2px;
    margin-bottom: 4px;
    width: fit-content;
}

/* Meta: Rating & Sold */
.smb-pg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--smb-meta-color);
    margin-top: auto; /* Push to bottom of content if space */
}

.smb-pg-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #ffc107; /* Star yellow */
}

.smb-pg-rating .star-icon {
    fill: currentColor;
    width: 12px;
    height: 12px;
}

.smb-pg-rating span {
    color: var(--smb-meta-color);
}

.smb-pg-sold {
    color: var(--smb-meta-color);
}

/* Footer: Location */
.smb-pg-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--smb-meta-color);
    margin-top: 6px;
}

.smb-pg-location-icon {
    width: 12px;
    height: 12px;
    fill: #2196f3; /* Blue check/location */
}

/* Load More Button Styles */
.smb-load-more-container {
    margin-top: 30px !important;
    text-align: center;
}

.smb-load-more-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #fff !important;
    border: 1px solid #0071e3 !important;
    color: #0071e3 !important;
    padding: 12px 40px !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    min-width: 200px;
}

.smb-load-more-btn:hover,
.smb-load-more-btn:focus {
    background-color: #f5f9ff !important;
    border-color: #005bb5 !important;
    color: #005bb5 !important;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.15) !important;
    transform: translateY(-1px);
}

.smb-load-more-btn:active {
    transform: translateY(0);
    box-shadow: none !important;
}

.smb-load-more-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.smb-loader {
    margin-top: 15px;
}

/* Responsive Columns */
@media (max-width: 1024px) {
    .smb-product-grid {
        grid-template-columns: repeat(var(--wd-col-md, 3), 1fr);
    }
}

@media (max-width: 767px) {
    .smb-product-grid {
        grid-template-columns: repeat(var(--wd-col-sm, 2), 1fr);
    }
}
