/*
 * WooCommerce 標準スタイルの上に重ねる調整。
 * WooCommerce の CSS はそのまま使い、色・グリッド・余白だけを合わせています。
 */

/* ---------- 共通: ボタン ---------- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-page a.button,
.woocommerce-page button.button,
.woocommerce-page input.button {
	background: var(--paper);
	color: var(--ink);
	border: 1px solid var(--ink);
	border-radius: 3px;
	font-weight: 700;
	padding: .7rem 1.2rem;
	line-height: 1.4;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--ink);
	color: #fff;
}
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.checkout-button,
.woocommerce button.single_add_to_cart_button {
	background: var(--yellow);
	color: var(--ink);
	border-color: var(--yellow);
}
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce button.single_add_to_cart_button:hover {
	background: #ffdf3d;
	color: var(--ink);
	border-color: #ffdf3d;
}
.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce button.button.disabled,
.woocommerce button.button.alt.disabled {
	background: #e3e3df;
	color: #8a8982;
	border-color: #e3e3df;
}

/* ---------- パンくず・件数・並び替え ---------- */
.woocommerce .woocommerce-breadcrumb {
	margin: 0 0 1.25rem;
	font-size: .85rem;
	color: var(--muted);
}
.woocommerce .woocommerce-breadcrumb a { color: var(--muted); }

.woocommerce-products-header__title.page-title,
.woocommerce div.product .product_title {
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.35;
}
.woocommerce .woocommerce-result-count { margin: 0 0 1rem; font-size: .9rem; color: var(--muted); line-height: 2.4; }
.woocommerce .woocommerce-ordering { margin: 0 0 1rem; }
.woocommerce .woocommerce-ordering select { padding: .5rem .6rem; }

/* サイズ検索の条件表示 */
.finder-notice {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .9rem;
	margin: 0 0 1.25rem; padding: .75rem 1rem;
	background: var(--rubber); color: #fff;
	border-left: 5px solid var(--yellow);
}
.finder-notice__size { font-family: var(--font-num); font-weight: 700; font-size: 1.6rem; line-height: 1.2; color: var(--yellow); letter-spacing: .03em; }
.finder-notice__clear { margin-left: auto; color: #fff; font-size: .9rem; }

/* ---------- 商品一覧グリッド ---------- */
.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid;
	/* 1マスの最小幅 = 商品画像の幅(原寸で収まるように) */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(220px, calc(var(--dls-img-w, 300px) + 2px))), 1fr));
	gap: 1rem;
	margin: 0 0 2rem;
	padding: 0;
}
/* WooCommerce の clearfix 疑似要素がグリッドの空きマスにならないように */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after { display: none; content: none; }

.woocommerce ul.products[class*="columns-"] li.product,
.woocommerce-page ul.products[class*="columns-"] li.product {
	float: none;
	width: auto;
	margin: 0;
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--rule);
	padding: 0 0 1rem;
}
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: block; flex: 1 0 auto; text-decoration: none; }
/* 商品画像は原寸。拡大も縮小もせず、マスの中央に置く(マスより大きい場合のみ、はみ出さないよう収める) */
.woocommerce ul.products li.product a img {
	display: block; width: auto; height: auto; max-width: 100%;
	margin: 0 auto .8rem; aspect-ratio: auto; object-fit: fill; background: none;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	padding: 0 1rem; margin: 0 0 .4rem;
	font-size: .95rem; font-weight: 700; line-height: 1.5;
}
.woocommerce ul.products li.product .price {
	display: block; padding: 0 1rem; margin: 0 0 .8rem;
	color: var(--ink); font-weight: 700; font-size: 1rem;
}
.woocommerce ul.products li.product .price del { color: var(--muted); font-weight: 400; }
.woocommerce ul.products li.product .price ins { text-decoration: none; color: #c8102e; }
.woocommerce ul.products li.product .button { margin: auto 1rem 0; text-align: center; }
.woocommerce ul.products li.product .star-rating { margin: 0 1rem .5rem; }

.woocommerce span.onsale {
	background: #c8102e; color: #fff;
	min-width: 0; min-height: 0; line-height: 1;
	padding: .45rem .6rem; border-radius: 2px;
	top: .6rem; left: .6rem; right: auto; margin: 0;
	font-size: .8rem; font-weight: 700;
}

.woocommerce nav.woocommerce-pagination { margin-top: 1rem; }
.woocommerce nav.woocommerce-pagination ul { border: 0; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; float: none; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	background: var(--paper); border: 1px solid var(--rule); color: var(--ink); padding: .45rem .9rem; min-width: 2.5rem;
}
.woocommerce nav.woocommerce-pagination ul li span.current { background: var(--yellow); border-color: var(--yellow); font-weight: 700; }

/* ---------- 商品詳細 ---------- */
.woocommerce div.product { background: var(--paper); border: 1px solid var(--rule); padding: clamp(1rem, 3vw, 2rem); }

/* 画像は原寸。画像 + 商品情報を横に並べ、並べると商品情報が狭くなる大きさの画像は上下に並べる */
.woocommerce div.product {
	display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center;
	gap: 1.5rem 2rem; position: relative;
}
.woocommerce div.product::before,
.woocommerce div.product::after { display: none; content: none; }

.woocommerce div.product div.images.woocommerce-product-gallery {
	float: none; width: auto; max-width: 100%; flex: 0 0 auto; margin: 0; opacity: 1 !important;
}
.woocommerce div.product div.images img {
	display: block; width: auto; max-width: 100%; height: auto;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image + .woocommerce-product-gallery__image { margin-top: 1rem; }
.woocommerce div.product div.images .woocommerce-product-gallery__image a { pointer-events: none; cursor: default; }

.woocommerce div.product div.summary.entry-summary {
	float: none; width: auto; margin: 0; flex: 1 1 20rem; min-width: min(100%, 20rem);
}
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related.products,
.woocommerce div.product .upsells.products,
.woocommerce div.product .up-sells {
	flex: 0 0 100%; width: 100%; max-width: 100%;
}

/* 画像が未登録のときの仮画像は、一覧の画像幅に合わせて小さめに */
.woocommerce :is(ul.products li.product a, div.product div.images) img.woocommerce-placeholder {
	width: var(--dls-img-w, 300px); max-width: 100%;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price { color: var(--ink); font-size: 1.6rem; font-weight: 700; }
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins { text-decoration: none; color: #c8102e; }
.woocommerce div.product .woocommerce-product-details__short-description { margin-bottom: 1.25rem; }
.woocommerce div.product .product_meta { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1.25rem; }
.woocommerce div.product .product_meta > span { display: block; margin-bottom: .25rem; }

/* サイズ(バリエーション)の選択 */
.woocommerce div.product form.cart .variations { width: 100%; margin-bottom: 1rem; }
.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td { display: block; padding: 0; text-align: left; line-height: 1.6; }
.woocommerce div.product form.cart .variations th { font-weight: 700; padding-bottom: .3rem; }
.woocommerce div.product form.cart .variations select { width: 100%; max-width: 100%; padding: .7rem .75rem; }
.woocommerce div.product form.cart .reset_variations { display: inline-block; margin-top: .4rem; font-size: .85rem; }
.woocommerce div.product form.cart .woocommerce-variation-price .price { font-size: 1.5rem; }
.woocommerce div.product form.cart .single_variation_wrap { margin-top: .5rem; }
.woocommerce div.product form.cart div.quantity { margin-right: .75rem; }
.woocommerce .quantity .qty { padding: .65rem .5rem; width: 4.5rem; }

.woocommerce div.product .woocommerce-tabs { margin-top: 2rem; }
.woocommerce div.product .woocommerce-tabs ul.tabs { padding-left: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: #eceae4; border-color: var(--rule); border-radius: 3px 3px 0 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: var(--paper); border-bottom-color: var(--paper); }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--ink); }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { font-weight: 700; }

.woocommerce .related.products > h2,
.woocommerce .upsells.products > h2,
.woocommerce .cross-sells > h2 {
	font-size: 1.25rem; padding-left: .7rem; border-left: 5px solid var(--yellow); margin: 2rem 0 1rem;
}

/* ---------- 通知 ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background: var(--paper);
	color: var(--ink);
	border: 1px solid var(--rule);
	border-top: 0;
	border-left: 5px solid var(--yellow);
}
.woocommerce-error { border-left-color: #c8102e; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--ink); }

/* ---------- カート・購入手続き・マイアカウント ---------- */
.woocommerce table.shop_table { background: var(--paper); border-collapse: collapse; border-radius: 0; border-color: var(--rule); }
.woocommerce table.shop_table th { background: #f6f6f4; }
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-checkout #order_review { background: var(--paper); border: 1px solid var(--rule); padding: 1rem 1.25rem; }
.woocommerce-checkout #payment { background: #f6f6f4; border-radius: 0; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select { padding: .65rem .75rem; border-color: #b9b9b3; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; margin: 0 0 1.5rem; background: var(--paper); border: 1px solid var(--rule); }
.woocommerce-account .woocommerce-MyAccount-navigation li a { display: block; padding: .7rem 1rem; text-decoration: none; border-left: 4px solid transparent; }
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a { border-left-color: var(--yellow); font-weight: 700; background: #f6f6f4; }

/* ---------- 固定ページ(カート等)の見出しと余白 ---------- */
.woocommerce-cart .entry,
.woocommerce-checkout .entry,
.woocommerce-account .entry { background: transparent; border: 0; padding: 0; }

/* ---------- 小さな画面 ---------- */
@media (max-width: 599px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products { gap: .6rem; }
	.woocommerce ul.products li.product .woocommerce-loop-product__title { padding: 0 .7rem; font-size: .88rem; }
	.woocommerce ul.products li.product .price { padding: 0 .7rem; font-size: .95rem; }
	.woocommerce ul.products li.product .button { margin: auto .7rem 0; padding: .6rem .5rem; font-size: .85rem; }
	.finder-notice__clear { margin-left: 0; }
	.woocommerce div.product form.cart .button { width: 100%; margin-top: .75rem; }
	.woocommerce table.shop_table_responsive tr td { background: var(--paper); }
}

/* ---------------------------------------------------------------
 * Product Variant Table for WooCommerce (pvtfw) の表
 * 以前のテーマで使っていたCSSを移し、見出しの表記を調整しています。
 * ------------------------------------------------------------- */

/* 商品詳細の横並びレイアウトの中でも、表は全幅 + 横にはみ出さない */
.woocommerce div.product > .pvtfw_variant_table_block { flex: 0 0 100%; width: 100%; max-width: 100%; }
.pvtfw_variant_table_block { overflow-x: auto; }

/* 文字サイズ */
.pvtfw_variant_table_block table.variant { font-size: 17.5px !important; }
.pvtfw_variant_table_block table.variant thead th { font-size: 17.5px !important; padding: 10px 8px !important; }
.pvtfw_variant_table_block table.variant tbody td { font-size: 17.5px !important; padding: 10px 8px !important; vertical-align: middle !important; }
.pvtfw_variant_table_block table.variant tbody td small { font-size: 14px !important; }
.pvtfw_variant_table_block .pvt-qty-input input.qty,
.pvtfw_variant_table_block .pvt-qty-input button.qty-count { font-size: 17.5px !important; }
.pvtfw_variant_table_block button.pvtfw_variant_table_cart_btn .pvtfw-btn-text { font-size: 16px !important; }

/* 見出しの表記: SKU→コード / Price→価格 / Quantity→数量 / Description→* / サイズ:xxx→サイズ */
.pvtfw_variant_table_block table.variant thead th[class^="サイズ"],
.pvtfw_variant_table_block table.variant thead th.sku,
.pvtfw_variant_table_block table.variant thead th.price_html,
.pvtfw_variant_table_block table.variant thead th.quantity,
.pvtfw_variant_table_block table.variant thead th.variation_description { font-size: 0 !important; }

.pvtfw_variant_table_block table.variant thead th[class^="サイズ"]::before,
.pvtfw_variant_table_block table.variant thead th.sku::before,
.pvtfw_variant_table_block table.variant thead th.price_html::before,
.pvtfw_variant_table_block table.variant thead th.quantity::before,
.pvtfw_variant_table_block table.variant thead th.variation_description::before { font-size: 17.5px !important; }

.pvtfw_variant_table_block table.variant thead th[class^="サイズ"]::before { content: "サイズ" !important; }
.pvtfw_variant_table_block table.variant thead th.sku::before { content: "コード" !important; }
.pvtfw_variant_table_block table.variant thead th.price_html::before { content: "価格" !important; }
.pvtfw_variant_table_block table.variant thead th.quantity::before { content: "数量" !important; }
.pvtfw_variant_table_block table.variant thead th.variation_description::before { content: "*" !important; }

/* 欠品中のボタン: 赤色 + 「欠品中」 */
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn:disabled,
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn[disabled] {
	background-color: #e2401c !important;
	border-color: #e2401c !important;
	color: #ffffff !important;
	opacity: .8 !important;
	cursor: not-allowed !important;
}
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn:disabled .pvtfw-btn-text,
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn[disabled] .pvtfw-btn-text { font-size: 0 !important; }
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn:disabled .pvtfw-btn-text::before,
.pvtfw_variant_table_block table.variant tbody tr button.pvtfw_variant_table_cart_btn[disabled] .pvtfw-btn-text::before {
	content: "欠品中" !important;
	font-size: 14px !important;
	color: #ffffff !important;
	font-weight: bold !important;
}

/* スマートフォン(767px以下): 表が縦積みになり、各行の左に項目名(data-title)が出る。
   プラグインは SKU / PRICE / QUANTITY / ACTION と英語で出すので、日本語に差し替える。 */
@media screen and (max-width: 767px) {
	.pvtfw_variant_table_block table.variant tbody td[data-title^="サイズ"]::before { content: "サイズ" !important; }
	.pvtfw_variant_table_block table.variant tbody td[data-title="SKU"]::before { content: "コード" !important; }
	.pvtfw_variant_table_block table.variant tbody td[data-title="Price"]::before { content: "価格" !important; }
	.pvtfw_variant_table_block table.variant tbody td[data-title="Quantity"]::before { content: "数量" !important; }
	.pvtfw_variant_table_block table.variant tbody td[data-title="Action"]::before { display: none !important; }
}

/* PayPal の別窓での支払いが終わったあとの表示(theme.js が印を付ける) */
[data-dls-paid] { font-size: 0 !important; line-height: 0 !important; }
[data-dls-paid] * { pointer-events: none; }
[data-dls-paid]::before {
	content: "支払い済み";
	font-size: 1rem; line-height: 1.5; font-weight: 700; color: var(--ink);
}
[data-dls-hide] { display: none !important; }

/* カートが空のときなどに出る「新登場」(最新の商品)を非表示 */
[data-dls-hide-new] { display: none !important; }
.wp-block-woocommerce-empty-cart-block .wp-block-woocommerce-product-new,
.wp-block-woocommerce-empty-mini-cart-contents-block .wp-block-woocommerce-product-new { display: none !important; }

/* PayPal のボタン・後払いメッセージは、購入手続き(支払い)ページ以外では隠す */
body:not(.woocommerce-checkout) .ppc-button-wrapper,
body:not(.woocommerce-checkout) [id^="ppc-button"],
body:not(.woocommerce-checkout) [id^="ppcp-"][id*="button"],
body:not(.woocommerce-checkout) .ppcp-button-apm,
body:not(.woocommerce-checkout) .ppcp-messages,
body:not(.woocommerce-checkout) #ppcp-messages,
body:not(.woocommerce-checkout) .ppcp-pay-later-messages,
body:not(.woocommerce-checkout) .ppcp-paylater-messages,
body:not(.woocommerce-checkout) [class*="ppcp-button"],
body:not(.woocommerce-checkout) .wc-block-components-express-payment:has([class*="ppc"]),
body:not(.woocommerce-checkout) .wc-block-components-express-payment-continue-rule:has(+ .wc-block-components-express-payment:has([class*="ppc"])) {
	display: none !important;
}
