/* Product Card Styles */

/* Product Grid with CSS Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

/* Responsive grid for different screen sizes */
@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Mobile optimization for 2 cards per row */
@media (max-width: 575px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-content {
        padding: 8px;
        gap: 4px;
    }
    
    .product-title {
        font-size: 12px;
        line-height: 1.2;
    }
    
    .product-badges {
        margin-bottom: 0;
    }
    
    .badge-item {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .price {
        font-size: 13px;
    }
    
    .old-price {
        font-size: 10px;
    }
    
    .add-to-cart {
        padding: 6px;
        font-size: 11px;
    }
}

/* Styling untuk card produk */
.product-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: fit-content;
    border: 1px solid #eee;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-img {
    position: relative;
    aspect-ratio: 1/1;
    background-color: #f8f8f8;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
    height: fit-content;
}

.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 2px;
}

.badge-item {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.badge-item.category {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-item.brand {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.product-title {
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
    font-weight: 500;
}

.product-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin: 4px 0;
}

.price {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.old-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-right: 6px;
}

.add-to-cart {
    background-color: #CF2028;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: auto;
}

.add-to-cart:hover {
    background-color: #333;
}

/* Product List View */
.product-list {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.product-list:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-list-wrapper {
    display: flex;
    flex-direction: row;
}

.product-list-img {
    width: 180px;
    height: 180px;
}

.product-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-list-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-list-title {
    font-size: 16px;
    margin: 0 0 8px 0;
}

.product-list-title a {
    color: #333;
    text-decoration: none;
}

.product-list-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-detail {
    padding: 8px 16px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-detail:hover {
    background-color: #e0e0e0;
}

.btn-cart {
    padding: 8px 16px;
    background-color: #CF2028;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-cart:hover {
    background-color: #333;
}

.product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}
