/*
 * attoma ショップトップ 商品カード
 * 対象：お買い得商品(6)・新発売の商品(7)・注目商品(8)
 *
 * 色や角丸は、先頭のカスタムプロパティを変更してください。
 */
:root {
	--attoma-shop-card-bg: #ffffff;
	--attoma-shop-card-border: #cfdcc9;
	--attoma-shop-card-shadow: 0 5px 14px rgba(51, 77, 51, 0.08);
	--attoma-shop-card-radius: 24px;

	--attoma-shop-image-bg: #f5f7f4;
	--attoma-shop-image-radius: 18px;

	--attoma-shop-text-color: #153d2d;
	--attoma-shop-sub-color: #788768;

	--attoma-shop-badge-bg: #6b9668;
	--attoma-shop-badge-color: #ffffff;

	--attoma-shop-button-bg: #6b9668;
	--attoma-shop-button-color: #ffffff;
	--attoma-shop-button-hover-bg: #527b50;

	/*
	 * 文字設定：このCSSを編集して変更できます。
	 * サイト全体のフォントを引き継ぐ場合は inherit のままで使用します。
           商品名だけ変える場合は、
          --attoma-shop-name-font-family: "メイリオ", sans-serif;
	 */
	--attoma-shop-font-family: inherit;
	--attoma-shop-name-font-family: inherit;
	--attoma-shop-price-font-family: inherit;
	--attoma-shop-button-font-family: inherit;

	--attoma-shop-name-font-size: clamp(14px, 2vw, 20px);
	--attoma-shop-name-line-height: 1.45;

	/*
	 * お知らせ等のアップロード画像（1・4・5・9・10）
	 * 未設定時：5pxの白枠＋右下へ自然に広がる影
	 */
	--attoma-top-image-border-width: 5px;
	--attoma-top-image-border-color: #ffffff;
	--attoma-top-image-shadow-natural: 5px 10px 28px rgba(0, 0, 0, 0.22);
	--attoma-top-image-shadow: var(--attoma-top-image-shadow-natural);

}

.attoma-top-products {
	box-sizing: border-box;
	border-collapse: separate;
	border-spacing: var(--attoma-card-gap, 18px) 18px;
	table-layout: fixed;
	margin-right: auto;
	margin-left: auto;
	font-family: var(--attoma-shop-font-family, inherit);
}

.attoma-top-product-cell {
	height: 1px;
	padding: 0;
	vertical-align: top;
}

.attoma-top-product-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: 100%;
	padding: var(--attoma-card-padding, 24px);
	overflow: hidden;
	background: var(--attoma-shop-card-bg);
	border: 1px solid var(--attoma-shop-card-border);
	border-radius: var(--attoma-shop-card-radius);
	box-shadow: var(--attoma-shop-card-shadow);
	text-align: left;
}

.attoma-top-product-image {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
	background: var(--attoma-shop-image-bg);
	border-radius: var(--attoma-shop-image-radius);
}

.attoma-top-product-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.attoma-top-product-image img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border: 0;
	object-fit: contain;
}

.attoma-top-product-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding-top: 20px;
	color: var(--attoma-shop-text-color);
}

.attoma-top-product-marks {
	min-height: 31px;
	margin-bottom: 10px;
	line-height: 1.7;
}

.attoma-top-product-marks img {
	max-height: 24px;
	width: auto;
	vertical-align: middle;
}

.attoma-top-product-code {
	margin-bottom: 12px;
	color: var(--attoma-shop-sub-color);
	font-size: clamp(13px, 1.45vw, 18px);
	font-weight: 700;
}

.attoma-top-product-name {
	display: -webkit-box;
	margin: 0 0 14px;
	padding: 0;
	overflow: hidden;
	color: var(--attoma-shop-text-color);
	font-family: var(--attoma-shop-name-font-family, inherit);
	font-size: var(--attoma-shop-name-font-size, clamp(14px, 2vw, 22px));
	line-height: var(--attoma-shop-name-line-height, 1.45);
	font-weight: 700;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--attoma-name-lines, 4);
}

.attoma-top-product-name a {
	color: inherit;
	text-decoration: none;
}

.attoma-top-product-name a:hover {
	text-decoration: underline;
}

.attoma-top-product-price {
	margin: 0 0 22px;
	color: var(--attoma-shop-text-color);
	font-family: var(--attoma-shop-price-font-family, inherit);
	font-size: clamp(15px, 1.8vw, 23px);
	line-height: 1.3;
}

.attoma-top-product-price span {
	font-size: clamp(20px, 2.6vw, 30px);
	font-weight: 700;
}

.attoma-top-product-button-wrap {
	margin-top: auto;
	padding-top: 12px;
	text-align: center;
}

.attoma-top-product-button {
	box-sizing: border-box;
	display: inline-block;
	min-width: 76%;
	padding: 12px 20px;
	background: var(--attoma-shop-button-bg);
	border-radius: 999px;
	color: var(--attoma-shop-button-color) !important;
	font-family: var(--attoma-shop-button-font-family, inherit);
	font-size: clamp(14px, 1.55vw, 20px);
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none !important;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.attoma-top-product-button:hover {
	background: var(--attoma-shop-button-hover-bg);
	transform: translateY(-1px);
}

.attoma-top-product-empty {
	visibility: hidden;
}

/* 5商品表示では余白と文字を少し抑え、狭い列でも崩れにくくする */
.attoma-top-products-5 .attoma-top-product-card {
	padding: max(10px, calc(var(--attoma-card-padding, 24px) * 0.65));
	border-radius: 18px;
}

.attoma-top-products-5 .attoma-top-product-body {
	padding-top: 14px;
}

.attoma-top-products-5 .attoma-top-product-name {
	font-size: var(--attoma-shop-name-font-size, clamp(14px, 2vw, 22px));
}

.attoma-top-products-5 .attoma-top-product-price,
.attoma-top-products-5 .attoma-top-product-price span {
	font-size: clamp(16px, 1.6vw, 23px);
}

.attoma-top-products-5 .attoma-top-product-button {
	min-width: 90%;
	padding: 10px 8px;
	font-size: clamp(12px, 1.25vw, 16px);
}

/* 画面自体が狭い場合の安全対策。管理設定の列数を優先しつつ横スクロールを防ぐ */
@media screen and (max-width: 700px) {
	.attoma-top-products {
		table-layout: auto;
		border-spacing: 8px 12px;
	}

	.attoma-top-product-card {
		padding: 12px;
		border-radius: 15px;
	}

	.attoma-top-product-button {
		min-width: 100%;
		padding-right: 6px;
		padding-left: 6px;
	}
}


/* お知らせ(1)(9)(10)・おすすめ商品(4)・新着情報(5)のアップロード画像 */
.attoma-top-upload-image {
	display: inline-block;
	max-width: 100%;
	vertical-align: top;
}

.attoma-top-upload-image img {
	box-sizing: border-box;
	display: block;
	max-width: 100%;
	height: auto;
	border-width: var(--attoma-top-image-border-width, 5px) !important;
	border-style: solid !important;
	border-color: var(--attoma-top-image-border-color, #ffffff) !important;
	box-shadow: var(--attoma-top-image-shadow, var(--attoma-top-image-shadow-natural)) !important;
	vertical-align: top;
}
