
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
	display: flex;
    flex-direction: column;
	align-items: center;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    padding: 15px;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
}
.product-img {
    width: 100%;
    height: 250px; /* ارتفاع ثابت */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9; /* بک‌گراند خنثی برای تصاویر کوچکتر */
    border-radius: 8px;
    overflow: hidden;
}
.product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* تصویر کوچک یا بزرگ داخل باکس جا بشه بدون خراب کردن نسبت */
    border-radius: 8px;
}

.product-category {
    font-size: 12px;
    color: white;
    background: #388e3c;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 5px;
    margin-top: 10px;
}

.product-title {
    margin: 10px 0;
    font-size: 16px;
}

.product-price {
    color: #c62828;
    font-weight: bold;
    font-size: 18px;
    margin: 10px 0;
}

.buy-btn {
    background: #c62828;
    color: white;
    border: none;
	margin-top: 5px;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.buy-btn:hover {
    background: #a61d1d;
}



.product-detail {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-detail-img img {
    max-width: 350px;
    border-radius: 10px;
}

.product-detail-info {
    flex: 1;
}

.product-desc {
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.product-detail form {
    margin-top: 15px;
}



.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.cart-table th, .cart-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.cart-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.btn {
    padding: 8px 15px;
    border: none;
    background-color: #2c7;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
}

.btn-secondary {
    background-color: #555;
    color: #eee;
}

.btn-primary {
    background-color: #27a;
    color: white;
}



/* کنترل تعداد */
.qty-box{ 
	margin-top: 5px;    
	display: inline-flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background: white;}

.qty-btn {
    background: #f7f7f7;
    border: none;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: #eaeaea;
}

.qty-input {
    width: 50px;
    text-align: center;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 6px 0;
}

/* وقتی صفر شد و دوباره "افزودن به سبد خرید" نمایش داده میشه */
.add-to-cart {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: block;       /* وسط‌چین شدن */
    margin: 0 auto;       /* وسط‌چین افقی */
}

.add-to-cart:hover {
    background: #218838;
}





.cart-btn {
    background: #ff5252;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}
.cart-btn:hover {
    background: #e04444;
}
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
