/* ショッピングカート・お気に入り機能用スタイル */

/* スライドパネルの基本スタイル */
.slide-panel {
	position: fixed !important;
	top: 0 !important;
	right: -100% !important; /* 初期状態では完全に画面外 */
	width: 320px !important;
	height: 100% !important;
	background-color: #ffffff; /* よりクリーンな白へ */
	box-shadow: -5px 0 15px rgba(0, 0, 0, 0.08); /* ソフトな影 */
	z-index: 10000 !important;
	transition: right 0.3s ease-in-out !important;
	padding: 20px;
	overflow-y: auto;
	color: #333;
	border-left: 1px solid #eee;
	transform: translateX(0) !important; /* transform を使った確実な位置制御 */
	visibility: hidden !important; /* 初期状態では非表示 */
	opacity: 0 !important; /* 初期状態では透明 */
}

.slide-panel.open {
	right: 0 !important; /* 表示状態 */
	visibility: visible !important;
	opacity: 1 !important;
}

.slide-panel .panel-title {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 1.4em;
	font-weight: bold;
	border-bottom: 1px solid #ddd;
	padding-bottom: 10px;
	color: #555;
}

/* カート内商品・お気に入り商品アイテム */
.cart-item,
.wishlist-item {
	display: flex;
	align-items: center;
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}

.cart-item:last-child,
.wishlist-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.cart-item img,
.wishlist-item img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	margin-right: 15px;
	border-radius: 4px;
}

.cart-item div p,
.wishlist-item div p {
	margin: 0 0 5px 0;
	font-size: 0.9em;
}

.cart-item div p:first-child,
.wishlist-item div p:first-child {
	font-weight: bold;
	color: #444;
}

/* Item links in slide panels */
.cart-item-link,
.wishlist-item-link {
	text-decoration: none;
	color: inherit; /* Inherit color from parent */
	display: contents; /* Make the link behave like its children for layout purposes */
}

.cart-item-link:hover img,
.wishlist-item-link:hover img {
	opacity: 0.8; /* Example hover effect for images */
}

.cart-item-link:hover p,
.wishlist-item-link:hover p {
	text-decoration: underline; /* Example hover effect for text */
	color: #b08d57; /* Example hover color */
}

.remove-from-cart,
.remove-from-wishlist {
	margin-left: auto;
	background-color: #e74c3c;
	color: white;
	border: none;
	padding: 5px 10px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.8em;
	transition: background-color 0.2s;
}

.remove-from-cart:hover,
.remove-from-wishlist:hover {
	background-color: #c0392b;
}

/* カートサマリー */
#cart-summary {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
}

#cart-summary p {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 0.95em;
}

#cart-summary p:last-of-type {
	font-weight: bold;
	font-size: 1.1em;
	margin-top: 10px;
}

/* ボタン */
#checkout-button,
.close-panel-button {
	display: block;
	width: 100%;
	padding: 12px;
	margin-top: 20px;
	background-color: #2ecc71;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
	font-size: 1em;
	transition: background-color 0.2s;
}

#checkout-button:hover {
	background-color: #27ae60;
}

.close-panel-button {
	background-color: #95a5a6;
	margin-top: 10px;
}

.close-panel-button:hover {
	background-color: #7f8c8d;
}

/* 商品一覧・詳細ページのボタン */
.product-actions button {
	background-color: #3498db;
	color: white;
	border: none;
	padding: 10px 15px;
	margin: 5px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9em;
	transition: background-color 0.2s;
}

.product-actions button.add-to-wishlist-button {
	background-color: #e67e22;
}

.product-actions button:hover {
	background-color: #2980b9;
}

.product-actions button.add-to-wishlist-button:hover {
	background-color: #d35400;
}

.slide-panel {
	background-color: #ffffff; /* よりクリーンな白へ */
	box-shadow: -5px 0 15px rgba(0, 0, 0, 0.08); /* ソフトな影 */
}

/* カート・お気に入りボタン - おしゃれなデザイン */
#cart-icon-wrapper-header,
#wishlist-icon-wrapper-header {
	position: relative;
	display: inline-block;
	margin-left: 8px; /* PCでの適切な余白に戻す */
}

#cart-icon-header,
#wishlist-icon-header {
	background: linear-gradient(135deg, #b08d57 0%, #c69963 100%);
	border: none;
	color: #fff;
	padding: 8px 16px;
	font-size: 12px;
	font-weight: 500;
	border-radius: 25px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-family: inherit;
	text-decoration: none;
	display: inline-block;
	line-height: 1;
	min-width: 70px;
	text-align: center;
	white-space: nowrap;
}

#cart-icon-header:hover,
#wishlist-icon-header:hover {
	background: linear-gradient(135deg, #a07c4a 0%, #b58956 100%);
	transform: translateY(-1px);
	color: #fff;
}

/* モバイル対応の追加修正 */
@media (max-width: 768px) {
	.slide-panel {
		width: 90% !important;
		max-width: 350px !important;
		right: -100% !important; /* モバイルでも確実に隠す */
		padding: 15px !important;
	}

	.slide-panel.open {
		right: 0 !important;
	}

	/* 小さな画面でのカートアイテム調整 */
	.cart-item img,
	.wishlist-item img {
		width: 50px !important;
		height: 50px !important;
	}

	.cart-item,
	.wishlist-item {
		margin-bottom: 12px !important;
		padding-bottom: 12px !important;
	}
}

/* さらに小さな画面（320px以下）での対応 */
@media (max-width: 320px) {
	.slide-panel {
		width: 95% !important;
		padding: 10px !important;
	}
}

/* 確実にパネルを隠すための追加スタイル */
.slide-panel:not(.open) {
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* デバッグ用: パネルが確実に表示されるように */
.slide-panel.open {
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
	right: 0 !important;
}
