/* ==========================================================
   Haemori Shop
   フォント・基本色はテーマを継承し、ここではレイアウトと
   ショップ固有の要素だけを定義する。
   ========================================================== */

.hm-shop {
	max-width: 1100px;
	margin: 0 auto;
	/* 上余白はテーマの固定ヘッダー（ロゴ等）とページタイトルが
	   重ならないよう、ヘッダー高さ分を確保している */
	padding: 128px 16px 64px;
	box-sizing: border-box;
}

.hm-shop *,
.hm-shop *::before,
.hm-shop *::after {
	box-sizing: border-box;
}

.hm-shop img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------- 一覧 ---------- */

.hm-archive__head {
	margin-bottom: 24px;
}

.hm-archive__title {
	font-size: 1.6rem;
	margin: 0;
}

.hm-archive__term {
	margin: 4px 0 0;
	opacity: 0.7;
	font-size: 0.9rem;
}

.hm-empty {
	padding: 40px 0;
	text-align: center;
}

/* ---------- グリッド＆カード（一覧・関連商品共通） ---------- */

.hm-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px 24px;
}

.hm-card__thumb {
	display: block;
	overflow: hidden;
	background: #f2f2f2;
	aspect-ratio: 4 / 3;
}

.hm-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.hm-card__thumb:hover img {
	transform: scale(1.04);
}

.hm-card__thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #999;
	font-size: 0.85rem;
	letter-spacing: 0.08em;
}

.hm-card__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 6px;
}

.hm-card__cat {
	display: inline-block;
	font-size: 0.7rem;
	line-height: 1;
	letter-spacing: 0.05em;
	padding: 4px 8px;
	border: 1px solid currentColor;
	border-radius: 999px;
	opacity: 0.75;
}

a.hm-card__cat {
	color: inherit;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

a.hm-card__cat:hover {
	background: #111;
	border-color: #111;
	color: #fff;
	opacity: 1;
}

.hm-card__title {
	font-size: 1rem;
	line-height: 1.5;
	margin: 0 0 4px;
	font-weight: 600;
}

.hm-card__title a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hm-card__title a:hover {
	opacity: 0.7;
}

.hm-card__price {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
}

/* ---------- ページネーション ---------- */

.hm-pagination {
	margin-top: 40px;
	text-align: center;
}

.hm-pagination ul {
	display: inline-flex;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.hm-pagination a,
.hm-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ccc;
	color: inherit;
	text-decoration: none;
	font-size: 0.9rem;
}

.hm-pagination .current {
	background: #111;
	border-color: #111;
	color: #fff;
}

/* ---------- 詳細：上部2カラム ---------- */

.hm-single__top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	margin-bottom: 48px;
}

.hm-single__media {
	background: #f2f2f2;
}

.hm-single__media img {
	width: 100%;
}

.hm-single__media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	color: #999;
	letter-spacing: 0.08em;
}

.hm-single__buy .hm-card__cats {
	margin-top: 0;
}

.hm-single__title {
	font-size: 1.5rem;
	line-height: 1.4;
	margin: 0 0 12px;
}

.hm-single__price {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 24px;
}

.hm-single__unit {
	font-size: 1rem;
	font-weight: 400;
	margin-left: 2px;
}

/* 点数セレクタ（詳細ページ） */
.hm-qty .hm-single__label {
	display: block;
}

.hm-qty__select {
	padding: 8px 10px;
	border: 1px solid #ccc;
	font-size: 0.95rem;
	font-family: inherit;
	background: #fff;
	min-width: 84px;
}

.hm-qty__unit {
	font-size: 0.85rem;
	opacity: 0.75;
	margin-left: 8px;
}

.hm-single__block {
	border-top: 1px solid #ddd;
	padding: 14px 0;
}

.hm-single__label {
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	margin: 0 0 8px;
}

.hm-options {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hm-options__item {
	padding: 4px 0;
	font-size: 0.95rem;
}

.hm-options__name {
	font-weight: 600;
}

.hm-options__note {
	display: block;
	font-size: 0.85rem;
	opacity: 0.75;
	margin-top: 2px;
}

.hm-single__delivery {
	margin: 0;
	font-size: 0.95rem;
}

.hm-buy-btn {
	display: block;
	text-align: center;
	background: #111;
	color: #fff;
	text-decoration: none;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	padding: 16px 24px;
	margin-top: 24px;
	transition: opacity 0.2s ease;
}

.hm-buy-btn:hover {
	opacity: 0.8;
	color: #fff;
}

.hm-single__buynote {
	margin: 8px 0 0;
	font-size: 0.8rem;
	opacity: 0.7;
	text-align: center;
}

/* ---------- 詳細：下部1カラム ---------- */

.hm-single__body {
	max-width: 760px;
}

.hm-section {
	margin-bottom: 40px;
}

.hm-section__title {
	font-size: 1.15rem;
	border-bottom: 2px solid #111;
	padding-bottom: 8px;
	margin: 0 0 16px;
}

.hm-section__content {
	line-height: 1.8;
}

.hm-recommend {
	list-style: none;
	margin: 0;
	padding: 0;
	line-height: 1.8;
}

.hm-recommend li {
	position: relative;
	padding-left: 1.4em;
}

.hm-recommend li::before {
	content: "✓";
	position: absolute;
	left: 0;
	font-weight: 700;
}

.hm-contact-btn {
	display: inline-block;
	background: #111;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	padding: 12px 28px;
	margin-top: 8px;
	transition: opacity 0.2s ease;
}

.hm-contact-btn:hover {
	opacity: 0.8;
	color: #fff;
}

/* ---------- 詳細：ギャラリー ---------- */

.hm-gallery__main {
	background: #f2f2f2;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.hm-gallery__main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hm-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.hm-gallery__thumb {
	padding: 0;
	border: 2px solid transparent;
	background: #f2f2f2;
	width: 72px;
	height: 72px;
	overflow: hidden;
	cursor: pointer;
}

.hm-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hm-gallery__thumb.is-active {
	border-color: #111;
}

.hm-gallery__thumb:hover {
	opacity: 0.8;
}

/* ---------- 詳細：価格内訳 ---------- */

.hm-single__breakdown {
	margin: -16px 0 24px;
	font-size: 0.85rem;
	opacity: 0.7;
}

/* ---------- 詳細：オプション（ラジオ） ---------- */

.hm-optgroup {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hm-opt {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid #ddd;
	cursor: pointer;
	font-size: 0.95rem;
}

.hm-opt:hover {
	border-color: #999;
}

.hm-opt:has(input:checked) {
	border-color: #111;
	background: #fafafa;
}

.hm-opt input[type="radio"] {
	margin-top: 3px;
	accent-color: #111;
	flex-shrink: 0;
}

.hm-opt__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hm-opt__name {
	font-weight: 600;
}

.hm-opt__price {
	font-size: 0.9rem;
	font-weight: 600;
}

.hm-opt__note {
	font-size: 0.85rem;
	opacity: 0.75;
}

/* ---------- 詳細：下部タブ ---------- */

.hm-tabs {
	margin-bottom: 8px;
}

.hm-tabs__nav {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #111;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.hm-tabs__nav::-webkit-scrollbar {
	display: none;
}

.hm-tabs__btn {
	flex-shrink: 0;
	padding: 10px 18px;
	border: 1px solid #ddd;
	border-bottom: none;
	background: #f7f7f7;
	color: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.hm-tabs__btn.is-active {
	background: #111;
	border-color: #111;
	color: #fff;
}

.hm-tabs__panel {
	padding: 24px 4px 8px;
	line-height: 1.8;
}

.hm-tabs__panel[hidden] {
	display: none;
}

.hm-tabs__panel .hm-recommend {
	line-height: 1.8;
}

/* ---------- 関連商品 ---------- */

.hm-related {
	margin-top: 56px;
	border-top: 1px solid #ddd;
	padding-top: 32px;
}

.hm-related__title {
	font-size: 1.15rem;
	margin: 0 0 20px;
}

.hm-related .hm-grid {
	grid-template-columns: repeat(4, 1fr);
}

/* ---------- レスポンシブ ---------- */

@media (max-width: 900px) {
	.hm-related .hm-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.hm-shop {
		/* モバイルでも固定ヘッダーを避ける上余白を確保する */
		padding: 96px 12px 48px;
	}

	/* 一覧はモバイル2カラム */
	.hm-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 14px;
	}

	/* 詳細は1カラムに積み上げ */
	.hm-single__top {
		grid-template-columns: 1fr;
		gap: 20px;
		margin-bottom: 36px;
	}

	.hm-single__title {
		font-size: 1.3rem;
	}

	.hm-single__price {
		font-size: 1.2rem;
	}

	/* タブは横スクロールで全件たどれるようにする */
	.hm-tabs__btn {
		padding: 9px 14px;
		font-size: 0.9rem;
	}

	.hm-tabs__panel {
		padding: 18px 2px 4px;
	}

	.hm-gallery__thumb {
		width: 60px;
		height: 60px;
	}
}

/* ==========================================================
   カート（v1.2〜／v1.3 でドロワー形式に変更）
   ドロワー／サンクスページは .hm-shop の外（フッター・固定ページ本文）に
   出るため、ここのスタイルは .hm-shop 配下に限定しない。
   ========================================================== */

/* ---------- 購入ボタン（カートモードは <button>） ---------- */

button.hm-buy-btn {
	width: 100%;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

/* ---------- カート導線（右下固定ボタン） ---------- */

.hm-cart-fab {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 999;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #111;
	color: #fff;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 12px 18px;
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.hm-cart-fab[hidden] {
	display: none;
}

.hm-cart-fab:hover {
	opacity: 0.85;
	color: #fff;
}

.hm-cart-fab__count {
	background: #fff;
	color: #111;
	border-radius: 999px;
	min-width: 1.6em;
	padding: 1px 6px;
	text-align: center;
	font-size: 0.85rem;
	line-height: 1.4;
}

/* ---------- カート追加モーダル ---------- */

.hm-modal[hidden] {
	display: none;
}

.hm-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.hm-modal__box {
	position: relative;
	background: #fff;
	width: calc(100% - 32px);
	max-width: 420px;
	padding: 28px 24px 24px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	box-sizing: border-box;
}

.hm-modal__msg {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 6px;
}

.hm-modal__item {
	font-size: 0.9rem;
	opacity: 0.75;
	margin: 0 0 20px;
}

.hm-modal__btns {
	display: flex;
	gap: 10px;
}

.hm-modal__btn {
	flex: 1;
	text-align: center;
	padding: 12px 8px;
	font-size: 0.95rem;
	font-weight: 600;
	border: 1px solid #111;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}

.hm-modal__btn--sub {
	background: #fff;
	color: #111;
	font-family: inherit;
}

.hm-modal__btn--main {
	background: #111;
	color: #fff;
}

.hm-modal__btn:hover {
	opacity: 0.8;
}

/* ---------- カートドロワー ---------- */

.hm-drawer {
	position: fixed;
	inset: 0;
	z-index: 1100;
	visibility: hidden;
}

.hm-drawer.is-open {
	visibility: visible;
}

.hm-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.hm-drawer.is-open .hm-drawer__overlay {
	opacity: 1;
}

.hm-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 420px;
	max-width: 94vw;
	background: #fff;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.hm-drawer.is-open .hm-drawer__panel {
	transform: translateX(0);
}

.hm-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #ddd;
}

.hm-drawer__title {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0;
}

.hm-drawer__close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	color: #111;
	font-family: inherit;
}

.hm-drawer__close:hover {
	opacity: 0.6;
}

.hm-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 4px 20px 24px;
}

body.hm-drawer-open {
	overflow: hidden;
}

/* ドロワーは幅が狭いのでサムネイルと間隔を詰める */
.hm-drawer .hm-cart__item {
	gap: 10px;
}

.hm-drawer .hm-cart__thumb {
	width: 72px;
	height: 54px;
}

@media (max-width: 480px) {
	.hm-drawer__panel {
		width: 100%;
		max-width: 100%;
	}
}

/* ---------- カート（ドロワー内アイテム・互換表示） ---------- */

.hm-drawer *,
.hm-drawer *::before,
.hm-drawer *::after,
.hm-cart-legacy *,
.hm-cart-legacy *::before,
.hm-cart-legacy *::after {
	box-sizing: border-box;
}

.hm-cart-legacy {
	text-align: center;
	padding: 40px 0;
}

.hm-cart__item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid #ddd;
}

.hm-cart__thumb {
	width: 96px;
	height: 72px;
	object-fit: cover;
	background: #f2f2f2;
	flex-shrink: 0;
}

.hm-cart__thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 0.72rem;
	letter-spacing: 0.06em;
}

.hm-cart__info {
	flex: 1;
	min-width: 0;
}

.hm-cart__name {
	font-weight: 600;
	margin: 0;
}

.hm-cart__name a {
	color: inherit;
}

.hm-cart__opt {
	font-size: 0.85rem;
	opacity: 0.75;
	margin: 2px 0 0;
}

.hm-cart__price {
	font-weight: 600;
	white-space: nowrap;
	margin: 0;
	text-align: right;
}

.hm-cart__price-per {
	display: block;
	font-size: 0.8rem;
	font-weight: 400;
	opacity: 0.7;
}

/* 点数変更（ドロワー内） */
.hm-cart__qty {
	font-size: 0.85rem;
	margin: 6px 0 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hm-cart__qty-select {
	padding: 4px 6px;
	border: 1px solid #ccc;
	font-size: 0.9rem;
	font-family: inherit;
	background: #fff;
}

.hm-cart__qty-unit {
	opacity: 0.75;
}

.hm-cart__remove {
	background: #fff;
	border: 1px solid #ccc;
	padding: 6px 12px;
	font-size: 0.85rem;
	cursor: pointer;
	flex-shrink: 0;
}

.hm-cart__remove:hover {
	border-color: #111;
}

.hm-cart__empty {
	text-align: center;
	padding: 40px 0;
}

.hm-cart__customer {
	margin: 28px 0 8px;
}

.hm-cart__heading {
	font-size: 1rem;
	margin: 0 0 14px;
}

.hm-cart__field {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 12px;
}

.hm-cart__field input {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 10px;
	border: 1px solid #ccc;
	font-size: 0.95rem;
	font-weight: 400;
}

.hm-cart__note {
	font-size: 0.8rem;
	opacity: 0.7;
	margin: 4px 0 0;
}

.hm-cart__total {
	font-size: 1.15rem;
	font-weight: 700;
	text-align: right;
	margin: 20px 0 12px;
}

.hm-cart__checkout {
	display: block;
	width: 100%;
	background: #111;
	color: #fff;
	border: none;
	padding: 16px;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	font-family: inherit;
}

.hm-cart__checkout:hover:not(:disabled) {
	opacity: 0.85;
}

.hm-cart__checkout:disabled {
	background: #999;
	cursor: not-allowed;
}

.hm-cart__legal {
	margin: 10px 0 0;
	font-size: 12px;
	text-align: center;
}
.hm-cart__legal a {
	color: inherit;
	text-decoration: underline;
}
.hm-cart__error {
	color: #b00020;
	font-size: 0.9rem;
	margin: 12px 0 0;
}

/* ---------- サンクスページ ---------- */

.hm-thanks {
	line-height: 1.8;
}

/* 購入後フォーム（サンクスページ内） */
.hm-order-form {
	border: 1px solid #ddd;
	padding: 24px;
	margin: 28px 0;
	text-align: left;
}

.hm-order-form__title {
	font-size: 1.1rem;
	margin: 0 0 12px;
}

.hm-order-form__products {
	font-weight: 600;
	margin: 0 0 8px;
}

.hm-order-form__field {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 16px;
}

.hm-order-form__label {
	display: block;
	margin-bottom: 6px;
}

.hm-order-form__required {
	font-style: normal;
	font-size: 0.75rem;
	color: #b00020;
	border: 1px solid #b00020;
	padding: 1px 6px;
	margin-left: 8px;
	vertical-align: middle;
}

.hm-order-form__field input,
.hm-order-form__field textarea {
	display: block;
	width: 100%;
	padding: 10px;
	border: 1px solid #ccc;
	font-size: 0.95rem;
	font-weight: 400;
	font-family: inherit;
	box-sizing: border-box;
}

.hm-order-form__submit {
	display: block;
	width: 100%;
	background: #111;
	color: #fff;
	border: none;
	padding: 14px;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	font-family: inherit;
}

.hm-order-form__submit:hover:not(:disabled) {
	opacity: 0.85;
}

.hm-order-form__submit:disabled {
	background: #999;
	cursor: not-allowed;
}

.hm-order-form__error {
	color: #b00020;
	font-size: 0.9rem;
	margin: 12px 0 0;
}

.hm-order-form--done {
	background: #f6f6f6;
}

@media (max-width: 768px) {
	.hm-cart__item {
		gap: 10px;
	}

	.hm-cart__thumb {
		width: 72px;
		height: 54px;
	}

	.hm-modal__btns {
		flex-direction: column;
	}
}
