/* ==========================================================================
   FMH Store — WooCommerce styles
   Loaded after Ollie's assets/styles/woocommerce.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Prices & badges
   -------------------------------------------------------------------------- */

.woocommerce-Price-amount,
.wc-block-components-product-price,
.wc-block-formatted-money-amount {
	font-feature-settings: "tnum" 1;
	letter-spacing: 0.02em;
}

.wc-block-components-product-price {
	color: var(--wp--preset--color--main);
}

.woocommerce .wc-block-components-product-price bdi,
.wc-block-components-product-price bdi {
	font-weight: 500;
}

/* Struck-through regular price and the （税込） suffix never go below 12px. */
.wc-block-components-product-price del,
.wc-block-components-product-price__regular {
	color: var(--wp--preset--color--secondary);
	font-size: max(12px, 0.85em);
	text-decoration-thickness: 1px;
	font-weight: 400;
	opacity: 1;
	margin-right: 0.4em;
}

.wc-block-components-product-price del bdi {
	font-weight: 400;
}

.wc-block-components-product-price ins,
.wc-block-components-product-price__value.is-discounted {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	background: none;
}

.woocommerce-price-suffix,
.wc-block-components-product-price .woocommerce-price-suffix {
	font-size: max(12px, 0.78em);
	font-weight: 400;
	color: var(--wp--preset--color--secondary);
	margin-left: 0.15em;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

/* Sale badge: one style everywhere (cards, gallery, legacy grids). */
.wc-block-components-product-sale-badge,
.wc-block-product-template .wc-block-product .wc-block-components-product-sale-badge,
.wc-block-grid__product-onsale,
.woocommerce span.onsale {
	display: inline-flex;
	align-items: center;
	min-height: 0;
	margin: 0;
	padding: 0.3em 0.85em;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--primary);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.5;
	text-transform: none;
	box-shadow: none;
}

.wc-block-components-product-image .wc-block-components-product-sale-badge--align-left,
.wc-block-components-product-image .wc-block-components-product-sale-badge--align-right {
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	z-index: 9;
}

/* Small "discount" pills inside cart / mini-cart. */
.wc-block-components-product-badge,
.wc-block-components-sale-badge {
	background: var(--wp--preset--color--primary-accent);
	color: var(--wp--preset--color--primary);
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.2em 0.7em;
}

/* --------------------------------------------------------------------------
   Product grid & card
   -------------------------------------------------------------------------- */

.wc-block-product-template.wc-block-product-template__responsive,
.wc-block-product-template.is-flex-container {
	column-gap: clamp(0.875rem, 2.2vw, 1.75rem) !important;
	row-gap: clamp(2rem, 4vw, 3rem) !important;
}

/* Explicit column counts: 2 on phones/tablets, the block's own count from 782px. */
.wc-block-product-template.wc-block-product-template__responsive {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Tablets: 3 columns for long grids (shop, archives); short 4-item rows stay 2x2. */
@media (min-width: 600px) and (max-width: 781px) {
	.wc-block-product-template.wc-block-product-template__responsive:has(> :nth-child(5)) {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 782px) {
	.wc-block-product-template.wc-block-product-template__responsive.columns-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}

	.wc-block-product-template.wc-block-product-template__responsive.columns-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}

	.wc-block-product-template.wc-block-product-template__responsive.columns-5 {
		grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	}
}

.wc-block-product-template .wc-block-product {
	margin: 0;
	min-width: 0;
}

.fmh-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.fmh-card__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--tertiary);
	margin: 0 !important;
}

.fmh-card .wc-block-components-product-image {
	margin: 0 !important;
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
}

.fmh-card .wc-block-components-product-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	width: 100%;
	height: auto;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fmh-card:hover .wc-block-components-product-image img {
	transform: scale(1.04);
}

.fmh-card__body {
	padding-top: 0.85rem;
	margin: 0 !important;
}

.fmh-card__body > * {
	margin: 0 !important;
}

.fmh-card__title,
.wp-block-woocommerce-product-template .fmh-card__title.has-small-font-size {
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.04em;
	text-align: left;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fmh-card__title a {
	color: var(--wp--preset--color--main);
}

.fmh-card__price,
.fmh-card .wc-block-components-product-price {
	margin-top: 0.3rem !important;
	text-align: left;
	font-size: var(--wp--preset--font-size--small) !important;
}

/* Quick add: slides up on hover (desktop pointer devices only). */
.fmh-card__quick {
	position: absolute !important;
	left: 10px;
	right: 10px;
	bottom: 10px;
	margin: 0 !important;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity var(--wp--custom--transition), transform var(--wp--custom--transition);
	z-index: 10;
}

.fmh-card:hover .fmh-card__quick,
.fmh-card:focus-within .fmh-card__quick {
	opacity: 1;
	transform: none;
}

.fmh-card__quick .wp-block-woocommerce-product-button,
.fmh-card__quick .wc-block-components-product-button {
	margin: 0 !important;
	width: 100%;
	flex-direction: column;
	align-items: stretch;
}

.fmh-card__quick .wp-block-button__link,
.fmh-card__quick .wc-block-components-product-button__button {
	width: 100%;
	margin: 0 !important;
	padding: 0.7em 1em;
	border-radius: var(--wp--custom--radius--control);
	background: rgba(28, 27, 25, 0.92);
	color: var(--wp--preset--color--white);
	font-size: 0.75rem !important;
	letter-spacing: 0.08em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.fmh-card__quick .wp-block-button__link:hover,
.fmh-card__quick .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--main);
}

.fmh-card__quick .added_to_cart {
	display: block;
	margin-top: 0.4rem !important;
	padding: 0.5em;
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--white);
	font-size: 0.75rem;
	text-align: center;
	text-decoration: none;
}

/* Touch devices: no hover, keep the grid calm — the card itself links to the product. */
@media (hover: none), (max-width: 781px) {
	.fmh-card__quick {
		display: none !important;
	}

	.fmh-card:hover .wc-block-components-product-image img {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Home: hero collage, category tiles, promos, features
   -------------------------------------------------------------------------- */

.fmh-hero__title {
	letter-spacing: 0.06em;
	line-height: 1.35;
	margin-top: 0.25rem !important;
}

.fmh-hero__lead {
	max-width: 30em;
	line-height: 2;
}

.fmh-hero__collage {
	max-width: 580px;
	margin-left: auto;
}

.fmh-hero__collage .wc-block-product-template {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: clamp(0.625rem, 1.5vw, 1.125rem) !important;
	margin: 0;
	padding: 0;
}

.fmh-hero__collage .wc-block-product {
	margin: 0 !important;
	width: auto !important;
	max-width: none !important;
	flex: none !important;
}

.fmh-hero__collage .wc-block-components-product-image {
	margin: 0 !important;
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--soft);
}

.fmh-hero__collage .wc-block-components-product-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fmh-hero__collage .wc-block-components-product-image:hover img {
	transform: scale(1.04);
}

@media (min-width: 782px) {
	.fmh-hero__collage .wc-block-product:nth-child(even) {
		transform: translateY(1.75rem);
	}
}

@media (max-width: 781px) {
	.fmh-hero {
		padding-top: var(--wp--preset--spacing--large) !important;
		padding-bottom: var(--wp--preset--spacing--large) !important;
	}

	.fmh-hero__collage {
		max-width: none;
		margin: 0;
	}

	.fmh-hero__collage .wc-block-product:nth-child(n+3) {
		display: none !important;
	}

	.fmh-hero__buttons .wp-block-button {
		flex: 1 1 auto;
	}

	.fmh-hero__buttons .wp-block-button__link {
		width: 100%;
		padding-left: 1em;
		padding-right: 1em;
	}
}

/* Category tiles (front page) */
.fmh-category-tiles .wc-block-product-categories-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(0.75rem, 2vw, 1.5rem);
}

.fmh-category-tiles .wc-block-product-categories-list-item {
	margin: 0;
	padding: 0;
}

.fmh-category-tiles .wc-block-product-categories-list-item a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.06em;
	text-align: center;
}

.fmh-category-tiles .wc-block-product-categories-list-item__image {
	display: block;
	width: 100%;
	max-width: none;
	aspect-ratio: 1 / 1;
	margin: 0;
	border: 0;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wp--preset--color--tertiary);
}

.fmh-category-tiles .wc-block-product-categories-list-item__image img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fmh-category-tiles .wc-block-product-categories-list-item a:hover img {
	transform: scale(1.06);
}

.fmh-category-tiles .wc-block-product-categories-list-item a:hover .wc-block-product-categories-list-item__name {
	color: var(--wp--preset--color--primary);
}

.fmh-category-tiles .wc-block-product-categories-list-item-count {
	display: none;
}

@media (max-width: 781px) {
	/* Three per row; a short last row stays centered. */
	.fmh-category-tiles .wc-block-product-categories-list {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 1.25rem 0.75rem;
	}

	.fmh-category-tiles .wc-block-product-categories-list-item {
		flex: 0 0 calc((100% - 1.5rem) / 3);
		min-width: 0;
	}

	.fmh-category-tiles .wc-block-product-categories-list-item a {
		font-size: 12px;
		letter-spacing: 0;
		gap: 0.5rem;
	}
}

/* Promo banners */
.fmh-promo {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 260px;
}

.fmh-promo > * {
	position: relative;
	z-index: 1;
}

.fmh-promo h2 {
	line-height: 1.5;
	margin-top: 0.25rem;
}

.fmh-promo--dark .fmh-eyebrow {
	color: #E7A796;
}

/* Keep the copy clear of the decorative circle in the bottom-right corner. */
.fmh-promo > p:not(.fmh-eyebrow) {
	max-width: 28em;
}

.fmh-promo--dark::after,
.fmh-promo--accent::after {
	content: "";
	position: absolute;
	z-index: 0;
	right: -80px;
	bottom: -110px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	border: 1px solid currentColor;
	opacity: 0.12;
}

.fmh-promo .fmh-btn-light .wp-block-button__link:hover {
	background: var(--wp--preset--color--tertiary) !important;
	color: var(--wp--preset--color--main) !important;
}

/* Feature strip */
.fmh-feature {
	position: relative;
	padding-left: 3.5rem;
}

.fmh-feature::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--tertiary);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 1.25rem;
}

.fmh-feature--shipping::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3z'/%3E%3Cpath d='M14 10h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='17.5' r='1.6'/%3E%3Ccircle cx='17' cy='17.5' r='1.6'/%3E%3C/svg%3E");
}

.fmh-feature--payment::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='12' rx='2'/%3E%3Cpath d='M3 10h18M7 15h3'/%3E%3C/svg%3E");
}

.fmh-feature--guest::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c1.2-3.6 4-5 7-5s5.8 1.4 7 5'/%3E%3C/svg%3E");
}

.fmh-feature__title {
	margin: 0;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
}

.fmh-feature__text {
	margin: 0.2rem 0 0 !important;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
	line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Archive: breadcrumbs, category chips, results bar, sorting
   -------------------------------------------------------------------------- */

.woocommerce-breadcrumb,
.wc-block-breadcrumbs {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.04em;
}

.woocommerce-breadcrumb a,
.wc-block-breadcrumbs a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}

.woocommerce-breadcrumb a:hover,
.wc-block-breadcrumbs a:hover {
	color: var(--wp--preset--color--main);
	text-decoration: underline;
}

/* Phones: one line, the (long) current item is truncated. */
@media (max-width: 599px) {
	.woocommerce-breadcrumb {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

.fmh-cat-chips {
	margin-top: 1.25rem !important;
}

.fmh-cat-chips .wc-block-product-categories-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.fmh-cat-chips .wc-block-product-categories-list-item {
	margin: 0;
}

.fmh-cat-chips .wc-block-product-categories-list-item a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0.35rem 1rem;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.06em;
	text-decoration: none;
	transition: border-color var(--wp--custom--transition), background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.fmh-cat-chips .wc-block-product-categories-list-item a:hover {
	border-color: var(--wp--preset--color--main);
}

.fmh-cat-chips .wc-block-product-categories-list-item.fmh-is-current a,
.fmh-cat-chips .wc-block-product-categories-list-item a[aria-current] {
	background: var(--wp--preset--color--main);
	border-color: var(--wp--preset--color--main);
	color: var(--wp--preset--color--white);
}

.fmh-cat-chips .wc-block-product-categories-list-item-count {
	display: none;
}

@media (max-width: 781px) {
	.fmh-cat-chips .wc-block-product-categories-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin-right: calc(-1 * clamp(1rem, 4vw, 2.5rem));
		padding-right: clamp(1rem, 4vw, 2.5rem);
		-webkit-overflow-scrolling: touch;
	}

	.fmh-cat-chips .wc-block-product-categories-list::-webkit-scrollbar {
		display: none;
	}

	.fmh-cat-chips .wc-block-product-categories-list-item {
		flex: 0 0 auto;
	}
}

/* The (usually empty) store-notices group sits above the results bar: no block gap. */
.fmh-results-bar {
	margin-block-start: 0 !important;
	gap: 1rem;
	padding-bottom: 0.25rem;
}

.fmh-results-bar .woocommerce-result-count {
	margin: 0;
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.04em;
}

.fmh-results-bar .woocommerce-ordering {
	margin: 0;
}

.fmh-results-bar .woocommerce-ordering select,
.woocommerce .woocommerce-ordering select {
	min-height: 40px;
	padding: 0.4rem 2.4rem 0.4rem 0.9rem;
	border-radius: var(--wp--custom--radius--control);
	border: 1px solid var(--wp--preset--color--border-light);
	background-color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--main);
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Single product
   -------------------------------------------------------------------------- */

.fmh-product__top .wc-block-store-notices:empty {
	display: none;
}

.fmh-product__info {
	position: sticky;
	top: 1.5rem;
}

.fmh-product__info > * + * {
	margin-top: 1rem;
}

.fmh-product__cats {
	color: var(--wp--preset--color--secondary);
	letter-spacing: 0.08em;
}

.fmh-product__cats a {
	color: var(--wp--preset--color--secondary);
}

.fmh-product__cats a:hover {
	color: var(--wp--preset--color--primary);
}

.fmh-product__cats .wp-block-post-terms__separator {
	padding: 0 0.15em;
}

.fmh-product__title {
	margin-top: 0.4rem !important;
	letter-spacing: 0.06em;
	line-height: 1.45;
}

.fmh-product__price {
	margin-top: 1.25rem !important;
	font-weight: 500;
}

.fmh-product__price .wc-block-components-product-price {
	font-size: var(--wp--preset--font-size--large);
}

.fmh-product__excerpt {
	color: var(--wp--preset--color--secondary);
	line-height: 2;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.fmh-product__excerpt p {
	margin: 0;
}

.fmh-product__cart {
	margin-top: 1.5rem !important;
}

/* Variation pills */
.fmh-atc__attr label.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name,
.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	color: var(--wp--preset--color--secondary);
	letter-spacing: 0.08em;
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pills {
	gap: 0.5rem;
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pills label,
.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill {
	min-width: 4.5rem;
	min-height: 42px;
	padding: 0.5rem 1.1rem;
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--control) !important;
	background: var(--wp--preset--color--white) !important;
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
	justify-content: center;
	text-align: center;
	outline: none !important;
	box-shadow: none !important;
	transition: border-color var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:hover {
	border-color: var(--wp--preset--color--main) !important;
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:checked) {
	border-color: var(--wp--preset--color--main) !important;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--main) !important;
	font-weight: 700;
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:disabled) {
	opacity: 0.45;
	text-decoration: line-through;
}

.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--main) !important;
	outline-offset: 2px !important;
}

/* Quantity + add to cart: the button drops below the stepper when its label
   would not fit on one line (tablets, phones). */
.fmh-atc-row {
	flex-wrap: wrap !important;
	gap: 0.75rem !important;
	align-items: stretch !important;
	margin-top: 1.5rem;
}

.fmh-atc-row > .wp-block-woocommerce-add-to-cart-with-options-quantity-selector {
	flex: 0 0 auto;
	margin: 0;
}

/* Variable products: WooCommerce renders the quantity and the button hidden and
   shows them (plus the hint below) once its script runs. Keep their room
   meanwhile, so the 比較する toggle and the service notes below do not jump (CLS). */
.fmh-atc-row:has(button[hidden]) {
	min-height: 90px;
}

.fmh-atc-row > .wp-block-woocommerce-product-button,
.fmh-atc-row > .wc-block-components-product-button {
	flex: 1 1 auto;
	margin: 0 !important;
	max-width: none !important;
}

.fmh-atc-row .wc-block-components-product-button,
.fmh-atc-row .wp-block-woocommerce-product-button > * {
	width: 100%;
	height: 100%;
}

/* The flex item itself sizes to its label, so it only wraps when needed. */
.fmh-atc-row > .wp-block-woocommerce-product-button,
.fmh-atc-row > .wc-block-components-product-button,
.fmh-product__cart .fmh-atc-row > .wp-block-woocommerce-product-button,
.fmh-product__cart .fmh-atc-row > .wc-block-components-product-button {
	width: auto;
}

.fmh-atc-row .wc-block-components-product-button__button,
.fmh-atc-row .wp-block-button__link,
.fmh-atc-row button.wp-element-button {
	width: 100%;
	min-height: 52px;
	height: 100%;
	margin: 0 !important;
	white-space: nowrap;
	border-radius: var(--wp--custom--radius--control);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	letter-spacing: 0.12em;
}

.fmh-atc-row .wc-block-components-product-button__button[disabled],
.fmh-atc-row .wc-block-components-product-button__button.disabled,
.fmh-atc-row .wc-block-components-product-button__button[aria-disabled="true"] {
	/* Not selectable yet (variable product before the options are chosen):
	   readable grey (4.7:1) plus a hint below the button. */
	background: var(--wp--preset--color--border-light) !important;
	color: var(--wp--preset--color--secondary) !important;
	opacity: 1;
	cursor: not-allowed;
}

.fmh-atc-row:has(.wc-block-components-product-button__button.disabled:not([hidden]))::after {
	content: "上の項目をすべて選ぶと、お買い物カゴに追加できます";
	flex: 1 0 100%;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
	letter-spacing: 0.04em;
	line-height: 1.6;
}

.fmh-atc-row .wc-block-components-quantity-selector {
	transform: none !important;
	display: inline-flex;
	align-items: stretch;
	height: 52px;
	min-height: 52px;
	width: auto;
	margin: 0 !important;
	gap: 0;
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

.fmh-atc-row .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	width: 44px;
	min-width: 44px;
	border-radius: 0;
	background: transparent;
	color: var(--wp--preset--color--main);
	font-size: 1.125rem;
}

.fmh-atc-row .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover {
	background: var(--wp--preset--color--tertiary);
}

.fmh-atc-row .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-width: 44px;
	max-width: 52px;
	height: auto;
	padding: 0;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent;
	font-size: 1rem;
	font-weight: 500;
	text-align: center;
}

/* Add-to-cart buttons rendered by WooCommerce's default parts (external, grouped). */
.fmh-product__cart .wp-block-woocommerce-product-button,
.fmh-product__cart .wc-block-components-product-button {
	max-width: none !important;
	width: 100%;
}

.fmh-product__cart .wc-block-components-product-button__button,
.fmh-product__cart .wp-block-woocommerce-product-button .wp-block-button__link {
	width: 100%;
	min-height: 52px;
	border-radius: var(--wp--custom--radius--control);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-wrap: balance;
}

/* Grouped product list */
.wp-block-woocommerce-add-to-cart-with-options-grouped-product-selector {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--white);
	padding: 0.5rem 1.25rem !important;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item > .wp-block-group {
	align-items: center !important;
	gap: 1rem !important;
	padding-top: 0.9rem !important;
	padding-bottom: 0.9rem !important;
}

.wp-block-add-to-cart-with-options-grouped-product-item-selector,
.wc-block-add-to-cart-with-options-grouped-product-item-selector {
	flex: 0 0 auto;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-quantity-selector {
	transform: none !important;
	display: inline-flex;
	align-items: stretch;
	width: auto;
	height: 40px;
	min-height: 40px;
	margin: 0 !important;
	gap: 0;
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--white);
	overflow: hidden;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	width: 34px;
	min-width: 34px;
	border-radius: 0;
	background: transparent;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-width: 36px;
	max-width: 40px;
	padding: 0;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent;
	font-size: 0.9375rem;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item-label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.04em;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item-label a {
	color: var(--wp--preset--color--main);
	text-decoration: none;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-product-price {
	font-size: var(--wp--preset--font-size--small) !important;
	text-align: right;
	white-space: nowrap;
}

.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-product-price .woocommerce-price-suffix {
	display: block;
	margin: 0;
}

/* Phones: name gets the full row next to the stepper; price drops below, right-aligned. */
@media (max-width: 599px) {
	.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item > .wp-block-group {
		flex-wrap: wrap !important;
		row-gap: 0.25rem !important;
		column-gap: 0.75rem !important;
	}

	.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item-label {
		flex: 1 1 0 !important;
	}

	.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item > .wp-block-group > .wp-block-group:last-child {
		flex: 1 0 100%;
		align-items: flex-end;
	}

	.wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-product-price .woocommerce-price-suffix {
		display: inline;
		margin-left: 0.15em;
	}
}

/* Shipping / payment / stock notes */
.fmh-product__service {
	margin-top: 1.75rem !important;
	padding: 1rem 1.25rem;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--tertiary);
}

.fmh-service {
	position: relative;
	margin: 0 !important;
	padding-left: 1.85rem;
	font-size: var(--wp--preset--font-size--x-small);
	line-height: 1.7;
	letter-spacing: 0.04em;
}

.fmh-service + .fmh-service {
	margin-top: 0.5rem !important;
}

.fmh-service::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 1.2rem;
	height: 1.2rem;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.fmh-service--shipping::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h11v9H3z'/%3E%3Cpath d='M14 10h4l3 3v3h-7'/%3E%3Ccircle cx='7' cy='17.5' r='1.6'/%3E%3Ccircle cx='17' cy='17.5' r='1.6'/%3E%3C/svg%3E");
}

.fmh-service--payment::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='12' rx='2'/%3E%3Cpath d='M3 10h18M7 15h3'/%3E%3C/svg%3E");
}

.fmh-service--stock::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C1B19' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E");
}

.fmh-service--stock:not(:has(.wc-block-components-product-stock-indicator:not(:empty))),
.fmh-service--stock:has(.wp-block-woocommerce-product-stock-indicator:empty) {
	display: none;
}

.fmh-service .wc-block-components-product-stock-indicator,
.fmh-service .wp-block-woocommerce-product-stock-indicator {
	margin: 0;
	font-size: inherit;
	font-weight: 500;
}

.fmh-service .wc-block-components-product-stock-indicator--in-stock {
	color: var(--wp--preset--color--success);
}

/* Meta (SKU / categories / tags) */
.fmh-product__meta {
	margin-top: 1.5rem !important;
}

.fmh-product__meta .wp-block-post-terms__prefix,
.fmh-product__meta .wc-block-components-product-sku strong,
.fmh-product__meta .wp-block-woocommerce-product-sku strong {
	font-weight: 500;
	color: var(--wp--preset--color--main);
}

.fmh-product__meta a {
	color: var(--wp--preset--color--secondary);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--border-light);
}

.fmh-product__meta .wc-block-components-product-sku {
	letter-spacing: 0.06em;
}

/* 品番 is hidden while the catalog still uses the sample SKUs (woo-…).
   Remove this rule once the real 品番 are entered. */
.fmh-product__meta .wp-block-woocommerce-product-sku,
.fmh-product__meta .wc-block-components-product-sku {
	display: none !important;
}

/* Gallery */
.fmh-product__gallery .wc-block-product-gallery-large-image {
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	background: var(--wp--preset--color--tertiary);
}

.fmh-product__gallery .wc-block-product-gallery-large-image img {
	border-radius: var(--wp--custom--radius--card);
}

.fmh-product__gallery .wc-block-components-product-sale-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	right: auto;
	z-index: 9;
	font-size: 0.75rem;
}

.fmh-product__gallery .wc-block-product-gallery-thumbnails {
	gap: 0.75rem;
}

.fmh-product__gallery .wc-block-product-gallery-thumbnails__thumbnail {
	border-radius: var(--wp--custom--radius--control);
}

.fmh-product__gallery .wc-block-product-gallery-thumbnails__thumbnail img,
.fmh-product__gallery .wc-block-product-gallery-thumbnails--active-overlay .wc-block-product-gallery-thumbnails__thumbnail__image--is-active {
	border-radius: var(--wp--custom--radius--control);
	filter: none !important;
	opacity: 0.55;
	transition: opacity var(--wp--custom--transition);
}

.fmh-product__gallery .wc-block-product-gallery-thumbnails__thumbnail img:hover,
.fmh-product__gallery .wc-block-product-gallery-thumbnails .wc-block-product-gallery-thumbnails__thumbnail__image--is-active {
	opacity: 1;
}

.fmh-product__gallery .wc-block-product-gallery-thumbnails .wc-block-product-gallery-thumbnails__thumbnail__image--is-active {
	outline: 2px solid var(--wp--preset--color--main);
	outline-offset: -2px;
}

.fmh-product__gallery .wc-block-next-previous-buttons button,
.fmh-product__gallery .wc-block-product-gallery-large-image-next-previous button {
	background: rgba(255, 255, 255, 0.92);
	color: var(--wp--preset--color--main);
	border-radius: 50%;
	box-shadow: var(--wp--preset--shadow--soft);
}

@media (max-width: 781px) {
	.fmh-product__main {
		gap: 1.5rem !important;
	}

	.fmh-product__info {
		position: static;
	}

}

/* Tabs */
.fmh-product__details {
	border-top: 1px solid var(--wp--preset--color--border-light);
	padding-top: var(--wp--preset--spacing--large);
}

.fmh-product__details .woocommerce-tabs ul.tabs,
.wp-block-woocommerce-product-details.is-style-minimal ul.tabs.wc-tabs {
	display: flex;
	justify-content: center;
	flex-wrap: nowrap;
	gap: clamp(1.25rem, 4vw, 3rem);
	margin: 0 0 var(--wp--preset--spacing--medium) !important;
	padding: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--border-light) !important;
	overflow-x: auto;
	scrollbar-width: none;
}

.fmh-product__details .woocommerce-tabs ul.tabs::before,
.fmh-product__details .woocommerce-tabs ul.tabs::after {
	display: none !important;
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li {
	flex: 0 0 auto;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--wp--preset--color--secondary) !important;
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li::after {
	display: none !important;
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 0.9rem 0.25rem !important;
	color: inherit !important;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500 !important;
	letter-spacing: 0.08em;
	text-decoration: none;
	border: 0 !important;
	box-shadow: inset 0 -2px 0 transparent;
	transition: box-shadow var(--wp--custom--transition), color var(--wp--custom--transition);
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li a:hover {
	color: var(--wp--preset--color--main) !important;
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li.active {
	color: var(--wp--preset--color--main) !important;
}

.woocommerce div.product .fmh-product__details .woocommerce-tabs ul.tabs li.active a {
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--main);
	font-weight: 700 !important;
}

.fmh-product__details .woocommerce-Tabs-panel {
	font-size: var(--wp--preset--font-size--base);
	line-height: 2;
}

.fmh-product__details .woocommerce-Tabs-panel--description > h2:first-child,
.fmh-product__details .woocommerce-Tabs-panel--additional_information > h2:first-child {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Spec tables (description) + attribute table */
.fmh-product__details table.fmh-spec,
.fmh-product__details table.woocommerce-product-attributes,
.woocommerce table.shop_attributes {
	width: 100%;
	margin: 2rem 0 0;
	border-collapse: collapse;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--border-light) !important;
	background: transparent;
	border-radius: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.8;
}

.fmh-product__details table.woocommerce-product-attributes {
	margin-top: 0;
}

.fmh-product__details table.fmh-spec th,
.fmh-product__details table.fmh-spec td,
.woocommerce table.shop_attributes th,
.woocommerce table.shop_attributes td {
	padding: 0.9rem 1rem !important;
	border: 0 !important;
	border-bottom: 1px solid var(--wp--preset--color--border-light) !important;
	background: transparent !important;
	text-align: left;
	vertical-align: top;
	font-style: normal;
}

.fmh-product__details table.fmh-spec th,
.woocommerce table.shop_attributes th {
	width: 30%;
	min-width: 6.5em;
	font-weight: 500;
	color: var(--wp--preset--color--secondary);
	background: var(--wp--preset--color--tertiary) !important;
}

.woocommerce table.shop_attributes td p {
	margin: 0;
	padding: 0;
}

/* Reviews */
.fmh-product__details #reviews .woocommerce-noreviews,
.fmh-product__details #reviews .woocommerce-Reviews-title {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--secondary);
}

.fmh-product__details #review_form_wrapper {
	margin-top: 1.5rem;
	padding: var(--wp--preset--spacing--medium);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--tertiary);
	font-size: var(--wp--preset--font-size--small);
}

.fmh-product__details #review_form .comment-reply-title {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
}

.fmh-product__details #review_form .stars a {
	color: var(--wp--preset--color--primary);
}

/* Upsells / cross-sells printed by the classic product-details hooks. */
.fmh-product__details .up-sells,
.fmh-product__details .related.products {
	margin-top: var(--wp--preset--spacing--large);
}

.fmh-product__details .up-sells > h2 {
	font-size: var(--wp--preset--font-size--medium);
	margin-bottom: 1.25rem;
}

.woocommerce .fmh-product__details ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem;
	margin: 0;
}

.woocommerce .fmh-product__details ul.products::before,
.woocommerce .fmh-product__details ul.products::after {
	display: none;
}

.woocommerce .fmh-product__details ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	position: relative;
}

.woocommerce .fmh-product__details ul.products li.product img {
	border-radius: var(--wp--custom--radius--card);
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin-bottom: 0.75rem;
}

.woocommerce .fmh-product__details ul.products li.product .woocommerce-loop-product__title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	padding: 0;
}

.woocommerce .fmh-product__details ul.products li.product .price {
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--small);
}

.woocommerce ul.products li.product .price del {
	color: var(--wp--preset--color--secondary);
	font-size: max(12px, 0.85em);
	text-decoration-thickness: 1px;
	opacity: 1;
	margin-right: 0.4em;
}

.woocommerce ul.products li.product .price ins {
	color: var(--wp--preset--color--primary);
	font-weight: 500;
	text-decoration: none;
}

.woocommerce .fmh-product__details ul.products li.product .onsale {
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	min-width: 0;
}

.woocommerce .fmh-product__details ul.products li.product .button {
	display: none;
}

@media (max-width: 781px) {
	.woocommerce .fmh-product__details ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fmh-product__details .woocommerce-tabs ul.tabs {
		justify-content: flex-start;
	}
}

.fmh-related .wp-block-heading {
	margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Store notices
   -------------------------------------------------------------------------- */

.wc-block-components-notice-banner {
	border-radius: var(--wp--custom--radius--card);
	font-size: var(--wp--preset--font-size--small);
	padding: 0.9rem 1rem !important;
	gap: 0.75rem;
}

.wc-block-components-notice-banner:focus,
.wc-block-components-notice-banner:focus-visible {
	outline: 1px solid var(--wp--preset--color--main-accent);
	outline-offset: 2px;
}

.wc-block-components-notice-banner.is-success {
	background: #F1F7F2;
	border-color: #B9D6C1;
	color: #22543A;
}

.wc-block-components-notice-banner.is-success > svg {
	background: var(--wp--preset--color--success);
}

.wc-block-components-notice-banner.is-info {
	background: var(--wp--preset--color--tertiary);
	border-color: var(--wp--preset--color--border-light);
	color: var(--wp--preset--color--main);
}

.wc-block-components-notice-banner .wc-forward,
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward {
	color: inherit !important;
	font-weight: 700;
	opacity: 1 !important;
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Cart & checkout blocks
   -------------------------------------------------------------------------- */

.fmh-back-link a::after {
	content: "";
}

.fmh-back-link a::before {
	content: "← ";
}

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
	font-size: var(--wp--preset--font-size--small);
}

/* Cart line items */
.wc-block-cart table.wc-block-cart-items {
	border-top: 1px solid var(--wp--preset--color--border-light);
}

.wc-block-cart .wc-block-cart-items__header {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
	letter-spacing: 0.08em;
	text-transform: none;
}

.wc-block-cart .wc-block-cart-items__header th {
	padding-top: 0.9rem;
	padding-bottom: 0.9rem;
	font-weight: 500;
}

.wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row {
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.wc-block-cart .wc-block-components-product-name {
	color: var(--wp--preset--color--main);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.wc-block-cart .wc-block-components-product-name:hover {
	color: var(--wp--preset--color--primary);
}

@media (min-width: 782px) {
	.wc-block-cart table.wc-block-cart-items td.wc-block-cart-item__image {
		width: 96px;
	}

	.wc-block-cart table.wc-block-cart-items td.wc-block-cart-item__image img {
		width: 80px;
		max-width: none;
	}
}

/* Checkout summary: name, options and price only (no repeated short description). */
.wc-block-components-order-summary-item .wc-block-components-product-metadata__description {
	display: none;
}

.wc-block-cart-item__image img,
.wc-block-components-order-summary-item__image img {
	border-radius: var(--wp--custom--radius--control) !important;
	background: var(--wp--preset--color--tertiary);
}

.wc-block-components-product-metadata,
.wc-block-components-product-details {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
}

.wc-block-cart-item__remove-link,
.wc-block-cart .wc-block-cart-item__remove-link {
	color: var(--wp--preset--color--secondary) !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	text-decoration: underline !important;
	text-transform: none;
}

.wc-block-cart .wc-block-components-quantity-selector,
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector {
	transform: none !important;
	width: auto;
	height: 40px;
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--white);
	gap: 0;
	overflow: hidden;
}

.wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	width: 36px;
	min-width: 36px;
	border-radius: 0;
	background: transparent;
}

.wc-block-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input,
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-width: 40px;
	max-width: 44px;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent;
	padding: 0;
	font-size: 0.9375rem;
}

/* Order summary card */
.wc-block-cart__sidebar,
.wc-block-checkout__sidebar {
	align-self: flex-start;
}

.wc-block-cart__sidebar .wp-block-woocommerce-cart-totals-block,
.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	padding: 1.5rem !important;
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--card) !important;
	background: var(--wp--preset--color--white);
}

.wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
	border: 0 !important;
	padding: 0 !important;
}

.wc-block-components-sidebar {
	padding-left: var(--wp--preset--spacing--medium);
}

.wc-block-cart .wc-block-cart__totals-title,
.wp-block-woocommerce-cart-order-summary-heading-block,
.wc-block-cart .wp-block-woocommerce-cart-order-summary-heading-block {
	font-size: var(--wp--preset--font-size--base) !important;
	font-weight: 700 !important;
	letter-spacing: 0.06em;
	text-transform: none !important;
	padding: 0 0 0.75rem !important;
	margin: 0 !important;
	text-align: left;
}

.wc-block-components-totals-item__label {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
}

.wc-block-components-totals-item__description {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: var(--wp--preset--font-size--base);
	font-weight: 700;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value .wc-block-formatted-money-amount {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.wc-block-components-totals-footer-item-tax {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
}

.wc-block-components-totals-wrapper {
	border-top-color: var(--wp--preset--color--border-light) !important;
}

.wc-block-components-panel__button,
.wc-block-components-totals-coupon__button {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
}

/* Primary CTAs (proceed to checkout / place order) */
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-mini-cart__footer-checkout {
	min-height: 54px;
	border-radius: var(--wp--custom--radius--control) !important;
	background: var(--wp--preset--color--main) !important;
	color: var(--wp--preset--color--white) !important;
	font-size: var(--wp--preset--font-size--base) !important;
	font-weight: 500 !important;
	letter-spacing: 0.12em;
	box-shadow: none !important;
}

.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-mini-cart__footer-checkout:hover {
	background: var(--wp--preset--color--border-dark) !important;
}

.wc-block-mini-cart__footer-cart.wc-block-components-button:not(.is-link) {
	border: 1px solid var(--wp--preset--color--main) !important;
	border-radius: var(--wp--custom--radius--control) !important;
	background: transparent !important;
	color: var(--wp--preset--color--main) !important;
	box-shadow: none !important;
	letter-spacing: 0.08em;
}

.wc-block-cart__payment-options,
.wc-block-cart__payment-options .wc-block-components-payment-method-icons {
	justify-content: center;
}

/* Cross-sells inside the cart page content */
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection {
	margin-top: var(--wp--preset--spacing--large);
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection > h2,
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection .wp-block-heading {
	font-size: var(--wp--preset--font-size--medium) !important;
	text-align: left;
}

.wp-block-woocommerce-cart .wc-block-product .wp-block-post-title {
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500;
	text-align: left;
	margin: 0.75rem 0 0.25rem !important;
}

.wp-block-woocommerce-cart .wc-block-product .wc-block-components-product-price {
	text-align: left;
	justify-content: flex-start;
}

.wp-block-woocommerce-cart .wc-block-product .wc-block-components-product-image img {
	border-radius: var(--wp--custom--radius--card);
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.wp-block-woocommerce-cart .wc-block-product .wp-block-woocommerce-product-button {
	justify-content: flex-start;
	align-items: flex-start;
}

.wp-block-woocommerce-cart .wc-block-product .wp-block-button__link {
	padding: 0.6em 1.1em;
	font-size: var(--wp--preset--font-size--x-small) !important;
	background: transparent;
	color: var(--wp--preset--color--main);
	border: 1px solid var(--wp--preset--color--border-light);
}

.wp-block-woocommerce-cart .wc-block-product .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--main);
	background: transparent;
	color: var(--wp--preset--color--main);
}

/* Empty cart */
.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	letter-spacing: 0.06em;
	padding-top: 1rem;
}

/* Line bag icon (same stroke as the header icons) instead of WooCommerce's sad face. */
.wp-block-woocommerce-empty-cart-block .with-empty-cart-icon::before {
	width: 3.5rem;
	height: 3.5rem;
	background-color: var(--wp--preset--color--main-accent);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8h13l-1 12.5h-11z'/%3E%3Cpath d='M9 10.5V6.75a3 3 0 0 1 6 0v3.75'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8h13l-1 12.5h-11z'/%3E%3Cpath d='M9 10.5V6.75a3 3 0 0 1 6 0v3.75'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	margin-bottom: 1.25rem;
}

.wp-block-woocommerce-empty-cart-block .wp-block-separator.is-style-dots {
	margin: var(--wp--preset--spacing--large) auto;
	color: var(--wp--preset--color--main-accent);
}

.wp-block-woocommerce-empty-cart-block > h2:not(.wc-block-cart__empty-cart__title) {
	font-size: var(--wp--preset--font-size--medium);
	margin-bottom: var(--wp--preset--spacing--medium);
}

.fmh-empty-cart-cta {
	justify-content: center;
	margin-top: 1.5rem !important;
}

/* Legacy product grid (empty-cart "new in store" block): same look as .fmh-card */
.wc-block-grid.wc-block-grid .wc-block-grid__products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem clamp(0.875rem, 2.2vw, 1.75rem);
	margin: 0;
	padding: 0;
}

@media (min-width: 782px) {
	.wc-block-grid.wc-block-grid.has-4-columns .wc-block-grid__products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.wc-block-grid.wc-block-grid.has-3-columns .wc-block-grid__products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.wc-block-grid.wc-block-grid .wc-block-grid__product {
	position: relative;
	width: auto !important;
	max-width: none !important;
	flex: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	text-align: left;
	list-style: none;
}

.wc-block-grid .wc-block-grid__product-link {
	display: block;
	color: var(--wp--preset--color--main);
	text-decoration: none !important;
}

.wc-block-grid .wc-block-grid__product-image {
	margin: 0 0 0.85rem !important;
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	background: var(--wp--preset--color--tertiary);
}

.wc-block-grid .wc-block-grid__product-image img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--card);
}

.wc-block-grid .wc-block-grid__product-title {
	margin: 0 0 0.3rem !important;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 500 !important;
	line-height: 1.6;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--main);
	text-align: left;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wc-block-grid .wc-block-grid__product-price {
	margin: 0 !important;
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
	justify-content: flex-start;
}

.wc-block-grid .wc-block-grid__product-price ins {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.wc-block-grid .wc-block-grid__product-price del {
	color: var(--wp--preset--color--secondary);
	font-size: max(12px, 0.85em);
	text-decoration-thickness: 1px;
	margin-right: 0.4em;
}

.wc-block-grid.wc-block-grid .wc-block-grid__product .wc-block-grid__product-onsale {
	position: absolute;
	top: 10px;
	left: 10px;
	right: auto;
	z-index: 2;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	padding: 0.3em 0.85em;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: none;
}

/* The cards link to the product; no add-to-cart buttons in this showcase grid. */
.wc-block-grid .wc-block-grid__product-add-to-cart {
	display: none;
}

/* Checkout form */
.wc-block-checkout .wc-block-components-checkout-step__title,
.wc-block-components-checkout-step__heading .wc-block-components-title {
	font-size: var(--wp--preset--font-size--medium) !important;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.wc-block-components-checkout-step__description {
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--secondary);
}

.wc-block-components-form .wc-block-components-text-input input,
.wc-block-components-text-input input,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-checkout__add-note .wc-block-components-textarea,
.wc-block-components-textarea {
	border: 1px solid var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--control) !important;
	background-color: var(--wp--preset--color--white) !important;
	box-shadow: none !important;
	font-size: 16px !important;
}

.wc-block-components-form .wc-block-components-text-input input:focus,
.wc-block-components-text-input input:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus,
.wc-block-components-textarea:focus {
	border-color: var(--wp--preset--color--main) !important;
	box-shadow: 0 0 0 1px var(--wp--preset--color--main) !important;
}

.wc-block-components-text-input label,
.wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--wp--preset--color--secondary) !important;
	letter-spacing: 0.04em;
}

.wc-block-components-radio-control--highlight-checked,
.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option {
	border-radius: var(--wp--custom--radius--card) !important;
}

.wc-block-components-radio-control--highlight-checked::after {
	border-color: var(--wp--preset--color--border-light) !important;
	border-radius: var(--wp--custom--radius--card) !important;
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted {
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--main) !important;
	border-radius: var(--wp--custom--radius--card) !important;
}

.wc-block-components-radio-control__input:checked {
	border-color: var(--wp--preset--color--main) !important;
}

.wc-block-components-radio-control__input:checked::before {
	background: var(--wp--preset--color--main) !important;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	border-radius: 3px;
	border-color: var(--wp--preset--color--main-accent);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background: var(--wp--preset--color--main);
	border-color: var(--wp--preset--color--main);
}

.wc-block-checkout__terms {
	border-radius: var(--wp--custom--radius--card) !important;
	color: var(--wp--preset--color--secondary);
}

.wc-block-components-sidebar-layout .wc-block-components-main {
	border-right-color: var(--wp--preset--color--border-light) !important;
}

.fmh-checkout-header .wp-block-site-title {
	font-size: 1.25rem;
}

.fmh-checkout-header .fmh-secure {
	margin: 0;
	color: var(--wp--preset--color--secondary);
	padding-left: 1.2rem;
	position: relative;
	letter-spacing: 0.06em;
}

.fmh-checkout-header .fmh-secure::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 0.9rem;
	height: 0.9rem;
	transform: translateY(-55%);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366635D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.fmh-checkout-header .wc-block-cart-link {
	color: var(--wp--preset--color--main);
	text-decoration: none;
	letter-spacing: 0.06em;
}

.fmh-checkout-header .wc-block-cart-link svg {
	width: 22px;
}

@media (max-width: 599px) {
	.fmh-checkout-header .fmh-secure {
		display: none;
	}
}

/* Mobile: comfortable stacked cart & checkout */
@media (max-width: 781px) {
	.wc-block-components-sidebar {
		padding-left: 0;
	}

	.wc-block-cart__sidebar .wp-block-woocommerce-cart-totals-block,
	.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
		padding: 1.25rem !important;
	}

	.wc-block-cart .wc-block-components-product-name {
		font-size: var(--wp--preset--font-size--small);
	}

}

/* --------------------------------------------------------------------------
   Mini cart drawer
   -------------------------------------------------------------------------- */

.wc-block-mini-cart__drawer .components-modal__content,
.wc-block-mini-cart__drawer {
	font-size: var(--wp--preset--font-size--small);
}

h2.wc-block-mini-cart__title {
	font-size: var(--wp--preset--font-size--medium) !important;
	font-weight: 700;
	letter-spacing: 0.06em;
}

.wc-block-mini-cart__footer {
	background: var(--wp--preset--color--tertiary) !important;
}

.wc-block-mini-cart__footer .wc-block-components-totals-item__label,
.wc-block-mini-cart__footer .wc-block-components-totals-item__value {
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   My account (classic shortcode)
   -------------------------------------------------------------------------- */

.woocommerce-account .woocommerce form.login,
.woocommerce-account .woocommerce form.register {
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--white);
}

.woocommerce-account .woocommerce .button,
.woocommerce .woocommerce-form-login__submit {
	border-radius: var(--wp--custom--radius--control);
	background: var(--wp--preset--color--main);
	color: var(--wp--preset--color--white);
	letter-spacing: 0.08em;
}

/* 「ログイン状態を保存」: the same ink checkbox as the お問い合わせ consent. */
.woocommerce form .woocommerce-form__label-for-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	cursor: pointer;
}

.woocommerce form input.woocommerce-form__input-checkbox,
.woocommerce form #rememberme {
	flex: 0 0 auto;
	width: 1.125rem;
	height: 1.125rem;
	margin: 0;
	accent-color: var(--wp--preset--color--main);
	cursor: pointer;
}

.woocommerce form input.woocommerce-form__input-checkbox:focus-visible,
.woocommerce form #rememberme:focus-visible {
	outline: 2px solid var(--wp--preset--color--main);
	outline-offset: 2px;
}

/* Required marks in the vermilion accent (WooCommerce default: --wc-red #a00). */
.woocommerce form .form-row .required,
.woocommerce form .required {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	border: 0;
}

/* Notices above the archive grid get their own spacing only when they have content. */
.fmh-notices:has(.wc-block-components-notice-banner, .woocommerce-message, .woocommerce-info, .woocommerce-error) {
	margin-bottom: var(--wp--preset--spacing--medium);
}

/* Stock: 「残りわずか」 (at or below the low-stock threshold) in the accent colour. */
.fmh-service .wc-block-components-product-stock-indicator.fmh-stock--low,
.wc-block-components-product-stock-indicator.fmh-stock--low {
	color: var(--wp--preset--color--primary);
}
