/**
 * 購物車與結帳頁樣式（支援 WooCommerce Blocks 與傳統 shortcode）。
 *
 * 色彩由後台與 web/prototypes/css/tokens.css 雙層驅動：
 * --c-brass: #7A5C24（生漆按金深色版，用於實心按鈕與文字標示）
 * --c-brass-on-dark: #C9A24A（真金箔亮金，用於懸停高光與陰影）
 */

:root {
	--swk-accent-color: var(--swk-accent, var(--e-global-color-primary, var(--wp--preset--color--primary, #7A5C24)));
	--swk-gold-glow: #C9A24A;
}

/* ---------- 頁面外層容器與標題齊頭對齊 ---------- */

body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-cart #primary,
body.woocommerce-checkout #primary,
body.woocommerce-cart #content.site-main,
body.woocommerce-checkout #content.site-main {
	max-width: 1200px !important;
	margin: 32px auto 60px auto !important;
	padding-left: 24px !important;
	padding-right: 24px !important;
	box-sizing: border-box !important;
	width: 100% !important;
}

body.woocommerce-cart .page-header,
body.woocommerce-checkout .page-header,
body.woocommerce-cart .entry-header,
body.woocommerce-checkout .entry-header {
	max-width: 100% !important;
	margin: 0 0 28px 0 !important;
	padding: 0 !important;
	width: 100% !important;
}

body.woocommerce-cart .entry-title,
body.woocommerce-checkout .entry-title {
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
	font-size: clamp( 1.75rem, 3vw, 2.25rem ) !important;
	color: #181716 !important;
	font-weight: 700 !important;
	letter-spacing: -0.02em !important;
}

/* ---------- 結帳頁（/checkout）區塊重構 ---------- */

/* 核心按鈕：下單購買（去除粉紅線框，改用按金實心滿版按鈕） */
.wc-block-components-checkout-place-order-button,
.wc-block-checkout__actions .wc-block-components-checkout-place-order-button,
button.wc-block-components-checkout-place-order-button,
#place_order,
.woocommerce-checkout button#place_order {
	background-color: var(--swk-accent-color, #7A5C24) !important;
	background: var(--swk-accent-color, #7A5C24) !important;
	border: 1px solid var(--swk-accent-color, #7A5C24) !important;
	color: #ffffff !important;
	border-radius: 8px !important;
	height: 52px !important;
	min-height: 52px !important;
	padding: 0 28px !important;
	font-size: 1.05rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.04em !important;
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	box-shadow: 0 2px 6px rgba( 122, 92, 36, 0.18 ) !important;
	transition: all 0.2s ease !important;
}

.wc-block-components-checkout-place-order-button .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button .wc-block-components-checkout-place-order-button__text {
	color: #ffffff !important;
}

.wc-block-components-checkout-place-order-button:hover,
.wc-block-checkout__actions .wc-block-components-checkout-place-order-button:hover,
button.wc-block-components-checkout-place-order-button:hover,
#place_order:hover,
.woocommerce-checkout button#place_order:hover {
	background-color: color-mix( in srgb, var(--swk-accent-color, #7A5C24) 86%, #000000 ) !important;
	border-color: color-mix( in srgb, var(--swk-accent-color, #7A5C24) 86%, #000000 ) !important;
	color: #ffffff !important;
	box-shadow: 0 6px 18px rgba( 122, 92, 36, 0.32 ) !important;
	transform: translateY( -1px ) !important;
}

/* 帳單與運送地址卡片（移除 Blocks 預設粉紅色外框） */
.wc-block-components-address-card {
	border: 1px solid #e5e7eb !important;
	border-radius: 8px !important;
	background-color: #ffffff !important;
	padding: 16px 18px !important;
	box-shadow: 0 1px 3px rgba( 15, 23, 42, 0.02 ) !important;
}

.wc-block-components-address-card__edit,
button.wc-block-components-address-card__edit {
	background: #f9fafb !important;
	background-color: #f9fafb !important;
	border: 1px solid #d1d5db !important;
	border-radius: 6px !important;
	padding: 4px 14px !important;
	color: #4b5563 !important;
	font-size: 0.825rem !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	transition: all 0.15s ease !important;
}

.wc-block-components-address-card__edit:hover,
button.wc-block-components-address-card__edit:hover {
	color: var(--swk-accent-color, #7A5C24) !important;
	border-color: var(--swk-accent-color, #7A5C24) !important;
	background: #ffffff !important;
	text-decoration: none !important;
}

/* 步驟數字徽章顏色 */
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title::before {
	background-color: var(--swk-accent-color, #7A5C24) !important;
	color: #ffffff !important;
}

/* ---------- 購物車頁（/cart）區塊重構 ---------- */

/* 前往結帳按鈕（與下單購買統一規格） */
.wc-block-cart__submit-button,
.wc-block-cart__submit-container .wc-block-components-button,
button.wc-block-cart__submit-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	background-color: var(--swk-accent-color, #7A5C24) !important;
	background: var(--swk-accent-color, #7A5C24) !important;
	border: 1px solid var(--swk-accent-color, #7A5C24) !important;
	color: #ffffff !important;
	border-radius: 8px !important;
	height: 50px !important;
	min-height: 50px !important;
	padding: 0 28px !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.04em !important;
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	box-shadow: 0 2px 6px rgba( 122, 92, 36, 0.18 ) !important;
	transition: all 0.2s ease !important;
	text-decoration: none !important;
}

.wc-block-cart__submit-button:hover,
.wc-block-cart__submit-container .wc-block-components-button:hover,
button.wc-block-cart__submit-button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background-color: color-mix( in srgb, var(--swk-accent-color, #7A5C24) 86%, #000000 ) !important;
	border-color: color-mix( in srgb, var(--swk-accent-color, #7A5C24) 86%, #000000 ) !important;
	color: #ffffff !important;
	box-shadow: 0 6px 18px rgba( 122, 92, 36, 0.32 ) !important;
	transform: translateY( -1px ) !important;
	text-decoration: none !important;
}

/* ---------- 通用表單互動與光暈效果 ---------- */

/* 輸入框 Focus 光暈 */
.wc-block-components-text-input input:focus,
.wc-block-components-combobox .wc-block-components-combobox__input:focus {
	outline: none !important;
	border-color: var(--swk-accent-color, #7A5C24) !important;
	box-shadow: 0 0 0 3px color-mix( in srgb, var(--swk-accent-color, #7A5C24) 18%, transparent ) !important;
}

/* 複選框與單選框強調色 */
.wc-block-components-checkbox input[type="checkbox"]:checked,
.wc-block-components-radio-control input[type="radio"]:checked {
	accent-color: var(--swk-accent-color, #7A5C24) !important;
}

/* 優惠券折疊面板與套用按鈕重構 */
.wc-block-components-totals-coupon .wc-block-components-panel__button,
.wc-block-components-totals-coupon-link,
button.wc-block-components-panel__button {
	color: #181716 !important;
	font-size: 0.925rem !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	transition: color 0.15s ease !important;
}

.wc-block-components-totals-coupon .wc-block-components-panel__button:hover,
.wc-block-components-totals-coupon-link:hover,
button.wc-block-components-panel__button:hover {
	color: var(--swk-accent-color, #7A5C24) !important;
	text-decoration: none !important;
}

.wc-block-components-totals-coupon .wc-block-components-panel__button .wc-block-components-panel__button-icon,
.wc-block-components-totals-coupon .wc-block-components-panel__button svg {
	fill: currentColor !important;
	transition: fill 0.15s ease !important;
}

/* 優惠券輸入框齊高 */
.wc-block-components-totals-coupon__form .wc-block-components-text-input input,
.wc-block-components-totals-coupon__input input {
	height: 44px !important;
	min-height: 44px !important;
	border: 1px solid #d1d5db !important;
	border-radius: 6px !important;
	box-sizing: border-box !important;
	font-size: 0.9rem !important;
	padding: 0 12px !important;
	background-color: #ffffff !important;
}

.wc-block-components-totals-coupon__form .wc-block-components-text-input input:focus,
.wc-block-components-totals-coupon__input input:focus {
	border-color: var(--swk-accent-color, #7A5C24) !important;
	box-shadow: 0 0 0 3px color-mix( in srgb, var(--swk-accent-color, #7A5C24) 18%, transparent ) !important;
}

/* 優惠券「套用」按鈕（清除粉紅外框） */
.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button,
.wc-block-components-totals-coupon__form button.wc-block-components-button,
button.wc-block-components-totals-coupon__button,
.woocommerce-cart table.cart td.actions .coupon .button,
.woocommerce-checkout form.checkout_coupon .button {
	height: 44px !important;
	min-height: 44px !important;
	line-height: 42px !important;
	background-color: #f9fafb !important;
	background: #f9fafb !important;
	border: 1px solid #d1d5db !important;
	border-radius: 6px !important;
	color: #374151 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 0 20px !important;
	font-size: 0.875rem !important;
	font-weight: 500 !important;
	cursor: pointer !important;
	transition: all 0.15s ease !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button .wc-block-components-button__text,
button.wc-block-components-totals-coupon__button .wc-block-components-button__text {
	color: inherit !important;
}

/* 套用按鈕 Hover */
.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:hover:not(:disabled),
.wc-block-components-totals-coupon__form button.wc-block-components-button:hover:not(:disabled),
button.wc-block-components-totals-coupon__button:hover:not(:disabled),
.woocommerce-cart table.cart td.actions .coupon .button:hover,
.woocommerce-checkout form.checkout_coupon .button:hover {
	background-color: #ffffff !important;
	background: #ffffff !important;
	color: var(--swk-accent-color, #7A5C24) !important;
	border-color: var(--swk-accent-color, #7A5C24) !important;
	box-shadow: 0 2px 6px rgba( 122, 92, 36, 0.14 ) !important;
}

.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:hover:not(:disabled) .wc-block-components-button__text,
button.wc-block-components-totals-coupon__button:hover:not(:disabled) .wc-block-components-button__text {
	color: var(--swk-accent-color, #7A5C24) !important;
}

/* 套用按鈕 禁用狀態 */
.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:disabled,
.wc-block-components-totals-coupon__form button.wc-block-components-button:disabled,
button.wc-block-components-totals-coupon__button:disabled {
	background-color: #f3f4f6 !important;
	background: #f3f4f6 !important;
	border-color: #e5e7eb !important;
	color: #9ca3af !important;
	cursor: not-allowed !important;
	opacity: 0.6 !important;
	box-shadow: none !important;
}

.wc-block-components-totals-coupon__form .wc-block-components-totals-coupon__button:disabled .wc-block-components-button__text,
button.wc-block-components-totals-coupon__button:disabled .wc-block-components-button__text {
	color: #9ca3af !important;
}

/* 已套用優惠券標籤（Chip） */
.wc-block-components-totals-discount__coupon-list-item,
.wc-block-components-chip {
	background-color: #f8fafc !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 6px !important;
	color: #334155 !important;
}

.wc-block-components-chip .wc-block-components-chip__text {
	font-weight: 500 !important;
	color: var(--swk-accent-color, #7A5C24) !important;
}

.wc-block-components-chip__remove-icon {
	color: #64748b !important;
	transition: color 0.15s ease !important;
}

.wc-block-components-chip__remove-icon:hover {
	color: #dc2626 !important;
}

/* ---------- 免運門檻提示條 ---------- */

.swk-free-shipping-hint {
	margin: 0 0 20px;
	padding: 12px 16px;
	border: 1px solid var(--swk-border, #e5e7eb);
	border-radius: var(--swk-radius, 12px);
	background-color: var(--swk-hint-bg, #f8fafc);
	color: var(--swk-hint-text, #334155);
	font-size: 0.95em;
	line-height: 1.5;
	text-align: center;
}

.swk-free-shipping-hint.is-qualified {
	border-color: var(--swk-success-border, #86efac);
	background-color: var(--swk-success-bg, #f0fdf4);
	color: var(--swk-success-text, #166534);
}

/* ---------- 純虛擬商品結帳情境：隱藏國家／地區選單與「帳單地址」步驟標題（方案 B） ---------- */

body.swk-cart-all-virtual .wc-block-components-country-input,
body.swk-cart-all-virtual .wc-block-components-address-form__country,
body.swk-cart-all-virtual .woocommerce-billing-fields #billing_country_field,
body.swk-cart-all-virtual .wc-block-checkout__billing-address .wc-block-components-checkout-step__heading,
body.swk-cart-all-virtual .wc-block-checkout__billing-address .wc-block-components-checkout-step__title,
body.swk-cart-all-virtual .wp-block-woocommerce-checkout-billing-address-block .wc-block-components-checkout-step__heading,
body.swk-cart-all-virtual .wp-block-woocommerce-checkout-billing-address-block .wc-block-components-checkout-step__title,
body.swk-cart-all-virtual .woocommerce-billing-fields > h3 {
	display: none !important;
}
