/* WC Size Selector — UI 还原自 Size Selector.dc.html (StockX 风格) */

.wcss {
	--wcss-ink: #121212;
	--wcss-muted: #8A8A8A;
	--wcss-line: #E2E2E2;
	--wcss-green: #006340;
	--wcss-sel-bg: #F0EFED;
	--wcss-tab-bg: #F0F1F2;
	box-sizing: border-box;
	width: 100%;
	max-width: 576px;
	margin: 0 0 18px;
	font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
	color: var(--wcss-ink);
	line-height: 1.2;
}

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

/* 锁定行高，挡住主题把大 line-height 继承进来撑大控件（"看起来偏大"的主因）。 */
.wcss button,
.wcss span,
.wcss h2 {
	line-height: 1.2;
}

/* 卡片 + 折叠条 -------------------------------------------------- */

.wcss-card {
	background: #FFFFFF;
	border: 1px solid var(--wcss-line);
	border-radius: 10px;
}

.wcss-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: none;
	border-radius: 10px;
	padding: 15px 18px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1.2;
	color: var(--wcss-ink);
	font-family: inherit;
	transition: background-color 0.15s;
}

.wcss-bar:hover {
	background-color: #FAFAFA;
}

.wcss-bar-right {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-weight: 700;
}

.wcss-selected-label.wcss-placeholder {
	color: var(--wcss-muted);
	font-weight: 400;
}

.wcss-chevron {
	flex: 0 0 auto;
	transform: rotate(0deg);
	transition: transform 0.2s;
	color: var(--wcss-ink);
}

/* 强制描边型箭头，挡住主题对 svg 的 fill 覆盖（否则路径被填充成实心三角）。 */
.wcss-chevron,
.wcss-chevron path {
	fill: none !important;
	stroke: currentColor !important;
}

.wcss-chevron path {
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wcss-bar[aria-expanded="true"] .wcss-chevron {
	transform: rotate(180deg);
}

/* 面板（桌面内联）---------------------------------------------- */

.wcss-panel {
	padding: 0 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	animation: wcss-panelIn 0.18s ease;
}

.wcss-panel[hidden] {
	display: none;
}

.wcss-panel-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--wcss-ink);
}

/* 单位切换 pill ------------------------------------------------- */

.wcss-tabs {
	display: flex;
	gap: 9px;
	overflow-x: auto;
	padding: 2px;
	-webkit-overflow-scrolling: touch;
}

.wcss-tab {
	flex: 0 0 auto;
	border: none;
	cursor: pointer;
	border-radius: 999px;
	padding: 9px 16px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	background: var(--wcss-tab-bg);
	color: var(--wcss-ink);
	transition: background 0.15s;
}

.wcss-tab.is-active {
	background: var(--wcss-ink);
	color: #FFFFFF;
}

/* 尺码网格 ----------------------------------------------------- */

.wcss-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.wcss-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: 56px;
	padding: 9px 6px;
	background: #FFFFFF;
	border: 1px solid var(--wcss-line);
	border-radius: 10px;
	box-shadow: none;
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.12s, background 0.12s;
}

.wcss-cell:hover {
	border-color: var(--wcss-green);
}

.wcss-cell.is-selected {
	background: var(--wcss-sel-bg);
	border: 1px solid var(--wcss-green);
	box-shadow: inset 0 0 0 1px var(--wcss-green);
}

.wcss-cell-label {
	font-size: 14px;
	font-weight: 700;
	color: var(--wcss-ink);
	white-space: nowrap;
}

.wcss-cell-price,
.wcss-cell-price .amount,
.wcss-cell-price .woocommerce-Price-amount {
	font-size: 14px;
	font-weight: 700;
	color: var(--wcss-green);
}

/* 遮罩（仅移动端可见）----------------------------------------- */

.wcss-scrim {
	display: none;
}

/* 加购按钮在未选尺码时的禁用态 -------------------------------- */

.single_add_to_cart_button.wcss-atc-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

/* 移动端：底部 sheet ----------------------------------------- */

@media (max-width: 700px) {
	.wcss-scrim.is-open {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 15, 15, 0.45);
		animation: wcss-scrimIn 0.2s ease;
		z-index: 99998;
	}

	/* sheet 自身不滚动；内部分三段：标题 + tabs 固定，网格滚动。 */
	.wcss-panel:not([hidden]) {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99999;
		max-height: 80vh;
		display: flex;
		flex-direction: column;
		gap: 0;
		margin: 0;
		padding: 0;
		overflow: hidden;
		background: #FFFFFF;
		border-radius: 8px 8px 0 0;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
		animation: wcss-sheetIn 0.28s cubic-bezier(0.32, 0.72, 0, 1);
	}

	/* 固定：标题 */
	.wcss-panel:not([hidden]) .wcss-panel-title {
		flex: 0 0 auto;
		margin: 0;
		padding: 18px 20px 12px;
		background: #FFFFFF;
		border-bottom: 1px solid #E8E8E8;
	}

	/* 固定：单位切换 */
	.wcss-panel:not([hidden]) .wcss-tabs {
		flex: 0 0 auto;
		margin: 0;
		padding: 14px 20px 0;
		background: #FFFFFF;
	}

	/* 滚动：尺码网格 */
	.wcss-panel:not([hidden]) .wcss-grid {
		flex: 1 1 auto;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		margin: 0;
		padding: 14px 20px 28px;
	}
}

/* 动画 -------------------------------------------------------- */

@keyframes wcss-panelIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes wcss-scrimIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wcss-sheetIn {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}
