/* カート全体 */
#cart-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0,0,0,.08);
	padding: 20px;
	max-width: 800px;
	margin: 20px auto;
}

/* 商品一覧 */
.cart-items {
	display: flex;
	flex-direction: column;
}

/* 商品カード（1商品） */
.cart-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid #ddd;
}

.cart-item:last-child {
	border-bottom: none;
}

/* 商品画像 */
.cart-image {
	width: 240px;       /* 固定幅 */
	height: 135px;      /* 固定高さ */
	flex-shrink: 0;
	display: flex;
	align-items: center;    /* 縦方向中央寄せ */
	justify-content: center;/* 横方向中央寄せ */
	border-radius: 8px;
	overflow: hidden;
	background: url("../asset/bg.png") center/cover no-repeat, #f1f5f9;

	img {
		max-width: 100%;
		max-height: 100%;
		object-fit: contain; /* 枠内に収める（切り抜きなし） */
	}
}


/* 商品情報 */
.cart-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between; /* 上下に整列 */
	gap: 8px;
	padding: 4px 0;
	
	.product-name {
		font-size: 18px;
		font-weight: bold;
		line-height: 1.4;
	}
	.product-price {
		font-size: 16px;
		color: #e53935;
		font-weight: bold;
	}

	.cart-actions {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 16px;
		margin-top: 8px;
	}

	/* 数量入力 */
	.quantity-box {
		display: flex;
		align-items: center;
		gap: 8px;
	}

	.item-subtotal {
		font-size: 14px;
		color: #555;
		min-width: 100px; /* 小計の幅を固定して整列 */
	}

	/* 削除ボタン */
	.btn-remove {
		margin-left: auto; /* 削除ボタンを右寄せ */
		background: #f44336;
		color: #fff;
		border: none;
		padding: 6px 10px;
		border-radius: 6px;
		cursor: pointer;
	}
}

.cart-empty {
	text-align: center;
	font-size: 18px;
	color: #666;
	padding: 40px 0;
}
.item-subtotal {
	font-size: 14px;
	color: #555;
}

/* 合計エリア */
.cart-summary {
	margin-top: 20px;
	text-align: right;
	border-top: 2px solid #ccc;
	padding-top: 16px;
}

.cart-summary p {
	margin: 4px 0;
}

.cart-buttons {
	margin-top: 12px;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.cart-buttons button {
	padding: 8px 16px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	cursor: pointer;
}

.btn-back {
	background: #ccc;
	color: #333;
}

.btn-checkout {
	background: #2196f3;
	color: #fff;
}

/* ✅ スマホ対応 */
@media (max-width: 768px) {
	.cart-item {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.cart-image {
		width: 100%;
		max-width: 200px;
		height: 200px; /* スマホでは少し大きめ */
	}

	.cart-image img {
		width: 100%;
		max-width: 200px;
	}

	.cart-info {
		align-items: center;
	}

	.cart-buttons {
		flex-direction: column;
		align-items: center;
	}

	.cart-buttons button {
		width: 100%;
	}
	
	.cart-actions {
		flex-direction: column;
		align-items: center;
		gap: 8px;
	}
	.btn-remove {
		margin-left: 0; /* 中央寄せ */
	}

}
