/**
 * ProCountdown – 前端样式
 *
 * 视觉参考：BEST SELLERS 限时特惠版块
 *  - 黑色大字标题 + 深蓝说明文字
 *  - 白色圆角卡片（细边框 + 柔和投影）
 *  - 红色斜向 SALE 角标、红色大写促销标题
 *  - 红色大号倒计时数字 + 浅红色单位文字
 *
 * 布局尺寸（字号 / 内边距）默认由本文件负责，因此短代码与 Elementor 都有一致的响应式表现；
 * 在 Elementor 中修改字号、内边距等控件时，控件生成的样式优先级更高，会覆盖此处默认值。
 */

.pcd {
	--pcd-ink: #0b0b10;
	--pcd-sub: #16233f;
	--pcd-red: #c4291a;
	--pcd-red-soft: #dd4a31;
	--pcd-line: #efe9e4;
	--pcd-card-bg: #ffffff;
	--pcd-badge-bg: #c0221a;
	--pcd-badge-rotate: -14deg;

	box-sizing: border-box;
	font-family: "Poppins", "Montserrat", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--pcd-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.pcd *,
.pcd *::before,
.pcd *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------
 * 标题区
 * ------------------------------------------------------- */
.pcd-header {
	max-width: 980px;
	margin: 0 auto 30px;
}

.pcd--align-left .pcd-header {
	text-align: left;
}

.pcd--align-center .pcd-header {
	text-align: center;
}

.pcd--align-right .pcd-header {
	text-align: right;
}

.pcd .pcd-heading {
	margin: 0;
	font-size: clamp(26px, 3.4vw, 44px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--pcd-ink);
	text-wrap: balance;
}

.pcd .pcd-subtitle {
	margin: 14px 0 0;
	font-size: clamp(15px, 1.55vw, 20px);
	font-weight: 500;
	line-height: 1.55;
	color: var(--pcd-sub);
}

/* ---------------------------------------------------------
 * 卡片
 * ------------------------------------------------------- */
.pcd-card {
	position: relative;
	max-width: 980px;
	margin: 0 auto;
	padding: 40px 56px 46px;
	background: var(--pcd-card-bg);
	border: 1px solid var(--pcd-line);
	border-radius: 22px;
	box-shadow: 0 30px 70px -40px rgba(24, 10, 5, 0.35), 0 2px 10px rgba(24, 10, 5, 0.03);
}

.pcd-card-inner {
	position: relative;
}

.pcd .pcd-title {
	margin: 0 0 26px;
	text-align: center;
	color: var(--pcd-red);
	font-size: clamp(19px, 2.45vw, 34px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-wrap: balance;
}

/* ---------------------------------------------------------
 * SALE 角标
 * ------------------------------------------------------- */
.pcd-badge {
	position: absolute;
	z-index: 2;
	display: inline-block;
	padding: 10px 26px;
	background: var(--pcd-badge-bg);
	border-radius: 4px;
	color: #ffffff;
	font-size: clamp(14px, 1.6vw, 22px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	transform: rotate(var(--pcd-badge-rotate, -14deg));
	transform-origin: center;
	box-shadow: 0 12px 22px -10px rgba(192, 34, 26, 0.75);
}

.pcd-badge--outer-left {
	left: -26px;
	top: 26px;
}

.pcd-badge--outer-right {
	right: -26px;
	top: 26px;
}

.pcd-badge--above {
	position: static;
	display: table;
	margin: 0 auto 22px;
}

/* ---------------------------------------------------------
 * 倒计时
 * ------------------------------------------------------- */
.pcd-timer {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: clamp(18px, 5.2vw, 64px);
	text-align: center;
}

.pcd-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: clamp(58px, 8vw, 104px);
}

.pcd .pcd-value {
	font-size: clamp(34px, 4.6vw, 58px);
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.02em;
	color: var(--pcd-red);
	font-variant-numeric: tabular-nums lining-nums;
	font-feature-settings: "tnum" 1, "lnum" 1;
}

.pcd .pcd-label {
	margin-top: 10px;
	font-size: clamp(13px, 1.55vw, 20px);
	font-weight: 500;
	line-height: 1.2;
	color: var(--pcd-red-soft);
}

/*
 * 一直播模式的截止时间存在 localStorage 里，服务端无法预知；
 * 在脚本接管之前先隐藏数字，避免老访客看到「满时长」再跳变。
 * 布局空间保留，不会造成跳动；3 秒后若脚本仍未接管则自动显示（兜底）。
 */
@keyframes pcd-fallback-reveal {
	to {
		visibility: visible;
	}
}

.pcd[data-mode="evergreen"]:not([data-pcd-ready]) .pcd-timer {
	visibility: hidden;
	animation: pcd-fallback-reveal 0s linear 3s forwards;
}

/* ---------------------------------------------------------
 * 到期状态
 * ------------------------------------------------------- */
.pcd-expired-msg {
	display: none;
	margin: 6px 0 0;
	text-align: center;
	font-size: clamp(14px, 1.5vw, 18px);
	font-weight: 600;
	line-height: 1.5;
	color: var(--pcd-red);
}

.pcd[data-state="expired"] .pcd-expired-msg {
	display: block;
}

.pcd[data-state="expired"][data-expire="message"] .pcd-timer {
	display: none;
}

.pcd[data-state="expired"][data-expire="hide-card"] .pcd-card {
	display: none;
}

.pcd[data-state="expired"][data-expire="hide-card"] .pcd-expired-msg {
	display: none;
}

/* ---------------------------------------------------------
 * 编辑器提示
 * ------------------------------------------------------- */
.pcd-editor-note {
	margin: 0 0 16px;
	padding: 8px 12px;
	background: #fff6f3;
	border: 1px dashed #f0c3b8;
	border-radius: 8px;
	text-align: center;
	font-size: 13px;
	line-height: 1.5;
	color: #a2361f;
}

/* ---------------------------------------------------------
 * 响应式
 * ------------------------------------------------------- */
@media (max-width: 1024px) {
	.pcd-card {
		padding: 34px 36px 38px;
	}

	.pcd-badge--outer-left {
		left: -18px;
		top: 22px;
	}

	.pcd-badge--outer-right {
		right: -18px;
		top: 22px;
	}
}

@media (max-width: 767px) {
	.pcd-header {
		margin-bottom: 22px;
	}

	.pcd .pcd-heading {
		letter-spacing: 0.08em;
	}

	.pcd .pcd-subtitle {
		margin-top: 10px;
	}

	.pcd-card {
		padding: 26px 18px 30px;
		border-radius: 16px;
	}

	.pcd .pcd-title {
		margin-bottom: 20px;
		letter-spacing: 0.06em;
	}

	.pcd-timer {
		gap: clamp(6px, 2.4vw, 18px);
	}

	.pcd-unit {
		flex: 1 1 0;
		min-width: 0;
	}

	.pcd .pcd-value {
		letter-spacing: 0;
	}

	.pcd-badge {
		padding: 8px 16px;
		font-size: 13px;
		letter-spacing: 0.12em;
	}

	.pcd-badge--outer-left {
		left: -10px;
		top: -14px;
	}

	.pcd-badge--outer-right {
		right: -10px;
		top: -14px;
	}

	.pcd-badge--above {
		margin-bottom: 18px;
	}
}
