/* ===== 商品详情页 - microperfumes 风格 ===== */

/* 0. 顶部留白压缩：商品页内容紧贴头部 */
.single-product .content-area { margin-top: 0 !important; padding-top: 12px !important; padding-bottom: 24px; }
.single-product .site-content { margin-top: 0 !important; padding-top: 0 !important; }
.single-product .site-main { padding-top: 0 !important; }
.single-product .ast-woocommerce-container { padding-top: 0 !important; }
.single-product .site-content > .ast-container { padding-top: 0 !important; }
.single-product div.product { margin-top: 0; }

/* 摘要区容器 */
.single-product div.product .summary {
	display: flex;
	flex-direction: column;
}

/* 0.5 加宽商品页 + 调整两栏比例
 *   Astra 默认容器 1240px、主图 50% / 摘要 46%，摘要区约 552px，
 *   而 5 档规格卡需要 5×104 + 4×10 = 560px，刚好差一点导致第 5 张换行。
 *   这里把容器放宽到 1500px（对齐参考站），并把摘要区提到 52%。 */
@media screen and (min-width: 922px) {
	.single-product .site-content > .ast-container { max-width: 1500px !important; }
	.single-product .ast-woocommerce-container div.product div.images  { width: 46% !important; }
	.single-product .ast-woocommerce-container div.product div.summary { width: 52% !important; }
}

/* 0.6 左栏主图下方缩略图：一行容纳 5 个小图（原 flexslider 默认 4 列） */
.single-product .woocommerce-product-gallery .flex-control-thumbs {
	display: grid !important;
	grid-template-columns: repeat(5, 1fr) !important;
	gap: 8px;
	margin-top: 8px;
}
.single-product .woocommerce-product-gallery .flex-control-thumbs li {
	float: none;
	width: 100% !important;
	margin: 0;
	padding: 0;
}

/* 1. 促销语：整行浅灰底横条（第二行：最低价），价格红色 */
/* 顶部促销行（第二行）：通栏 —— 跨越 Astra 容器占满整个视口宽度，文字居中
 *   100vw + 负 margin（50% 为父容器半宽、50vw 为视口半宽）实现 full-bleed；
 *   box-sizing:border-box 保证 padding 不撑宽度；通栏后去掉圆角。 */
.single-product .acmp-promo-line {
	display: block;
	width: 100vw;
	max-width: 100vw;
	margin: 0 calc(50% - 50vw) 14px;
	box-sizing: border-box;
	font-size: 14px;
	color: #111;
	background: #f5f5f5;
	border-radius: 0;
	padding: 10px 16px;
	text-align: center;
}
/* 兜底：100vw 含滚动条宽度时，避免出现横向滚动条
 * clip 优先（不影响 position:sticky），旧浏览器回退 hidden */
body.single-product {
	overflow-x: hidden;
	overflow-x: clip;
}
.single-product .acmp-promo-line strong { color: #d02e2e; }

/* 1.85 自定义面包屑 */
.acmp-breadcrumb {
	font-size: 13px;
	color: #555;
	margin: 0 0 10px;
}
.acmp-breadcrumb a { color: #555; text-decoration: none; }
.acmp-breadcrumb a:hover { color: #111; text-decoration: underline; }
.acmp-bc-sep { margin: 0 8px; color: #aaa; }
/* 隐藏 Astra/WooCommerce 默认面包屑 */
.single-product .ast-breadcrumbs,
.single-product .woocommerce-breadcrumb { display: none !important; }

/* 2. 标题块 */
.acmp-product-title {
	font-size: 26px;
	font-weight: 700;
	letter-spacing: .01em;
	margin: 0 0 8px;
}
.acmp-meta-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	margin-bottom: 12px;
}
.acmp-meta-item, .acmp-meta-brand { color: #333; }
.acmp-meta-brand { text-decoration: underline; text-underline-offset: 2px; }
.acmp-conc { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.acmp-meta-sku { color: #888; }
.acmp-dot { color: #bbb; }

/* 3. 评价 */
.acmp-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.acmp-star-row .dashicons { font-size: 16px; width: 16px; height: 16px; color: #f5a623; }
.acmp-star-row .dashicons-star-empty::before { color: #d8d8d8; }
.acmp-review-count { font-size: 13px; color: #1a73e8; text-decoration: underline; }

/* 4. 免责小字 */
.acmp-disclaimer-note {
	font-size: 12px;
	line-height: 1.6;
	color: #8a8a8a;
	border-left: 3px solid #e5e5e5;
	padding-left: 12px;
	margin: 0 0 16px;
}

/* 5. 橙色提示条 + 价格块 + 容量行 + 分期行 */
.acmp-retail-note {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #c05621;
	border: 1px solid #f0a24b;
	border-radius: 4px;
	padding: 4px 10px;
	margin-bottom: 12px;
}
.acmp-price-block { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.acmp-price { font-size: 26px !important; font-weight: 700; color: #111; }
.acmp-from-label { font-size: 14px; font-weight: 500; color: #555; margin-right: 2px; }
.acmp-msrp { color: #999; font-size: 16px; margin-left: 6px; }
.acmp-capacity { font-size: 13px; color: #555; margin-bottom: 4px; min-height: 18px; }
/* 分期行：位于「Guaranteed Safe Checkout」支付图标区下方 */
.acmp-installments { font-size: 13px; color: #333; margin: 10px 0 16px; }
.acmp-afterpay {
	color: #111;
	background: #b2fce4;
	border-radius: 3px;
	padding: 1px 7px;
	font-size: 12px;
	letter-spacing: .02em;
}

/* 6. 规格卡片 */
/* 覆盖 mu-plugin 对 table.variations 的隐藏（卡片在表格 td 内） */
.single-product form.variations_form table.variations {
	display: block !important;
	border: 0;
	margin: 0 0 4px;
	background: none;
}
.single-product form.variations_form table.variations tbody,
.single-product form.variations_form table.variations tr { display: block; }
.single-product form.variations_form table.variations th.label { display: none; }
.single-product form.variations_form table.variations td.value { padding: 0; }
.single-product form.variations_form .reset_variations { display: none !important; }

.acmp-size-cards {
	display: grid;
	/* 列数由 PHP 按实际档数输出 acmp-size-cols-N：N 张卡恰好 N 列不换行，
	 * 且档位少时卡片不会被拉伸过宽（auto-fit 做不到这点） */
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 10px;
}
.acmp-size-cols-1 { grid-template-columns: repeat(1, 1fr); }
.acmp-size-cols-2 { grid-template-columns: repeat(2, 1fr); }
.acmp-size-cols-3 { grid-template-columns: repeat(3, 1fr); }
.acmp-size-cols-4 { grid-template-columns: repeat(4, 1fr); }
.acmp-size-cols-5 { grid-template-columns: repeat(5, 1fr); }
.acmp-size-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: center;
	justify-content: space-between;
	padding: 12px 8px 12px;
	background: #fff;
	border: 1.5px solid #d9d9d9;
	border-radius: 10px;
	cursor: pointer;
	transition: all .15s ease;
	font-family: inherit;
	min-height: 260px;
	color: #111;
}
.acmp-size-card:hover { border-color: #111; }
.acmp-size-card.is-active {
	border-color: #111;
	box-shadow: 0 0 0 1px #111;
}
.acmp-sc-name { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.acmp-sc-img {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 6px 0;
}
.acmp-sc-img img {
	max-width: 100%;
	max-height: 150px;
	width: auto;
	height: auto;
	object-fit: contain;
}
.acmp-sc-price { font-size: 15px; font-weight: 600; color: #111; }
.acmp-sc-price del { color: #aaa; font-size: 12px; margin-left: 4px; }
.acmp-sc-price-na { color: #888; font-weight: 500; font-size: 12px; }
.acmp-sc-foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}
.acmp-sc-soldout {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #b00;
}
.acmp-notify-link {
	font-size: 11px;
	color: #111;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.acmp-sc-offer {
	position: absolute;
	top: -8px;
	right: -6px;
	font-size: 10px;
	font-weight: 700;
	color: #fff;
	background: #e53935;
	border-radius: 4px;
	padding: 2px 6px;
}
.acmp-size-card.is-soldout { opacity: .6; }
.acmp-size-card.is-soldout .acmp-sc-price { text-decoration: line-through; color: #999; }
.acmp-size-card.is-soldout .acmp-sc-img { opacity: .45; }

.acmp-size-details-link { color: #333; text-decoration: underline; text-underline-offset: 2px; }

/* 变体表格底线（规格卡下方横线）与 Woo 变体描述（如 0.75 ml）均不显示 */
.single-product div.product form.cart .variations { border-bottom: 0; }
.single-product div.product form.cart .single_variation_wrap .single_variation { display: none !important; }

/* 7. 加购区 */
.single-product div.product form.cart { margin-bottom: 18px; }

/* 数量框：- 1 + 横排，隐藏浏览器原生 spinner */
.single-product div.product .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}
.single-product div.product .quantity .qty,
.single-product div.product .quantity input.qty {
	width: 56px !important;
	min-width: 56px;
	max-width: 56px;
	height: 100%;
	border: 0;
	text-align: center;
	font-weight: 600;
	-moz-appearance: textfield;
	padding: 0 2px;
	margin: 0;
	box-sizing: border-box;
}
.single-product div.product .quantity input.qty::-webkit-outer-spin-button,
.single-product div.product .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.acmp-qty-btn {
	width: 40px;
	flex: 0 0 40px;
	height: 100%;
	border: 0;
	background: #fff;
	color: #111;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	cursor: pointer;
}
.acmp-qty-btn:hover { background: #f2f2f2; }
.acmp-qty-btn:active { background: #e8e8e8; }

/* 加购行：数量框与按钮并排、等高对齐 */
.single-product div.product .woocommerce-variation-add-to-cart,
.single-product div.product form.cart:not(.variations_form):not(.grouped_form) {
	display: flex;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 12px;
}
.single-product div.product .woocommerce-variation-add-to-cart .quantity,
.single-product div.product form.cart:not(.variations_form) .quantity {
	flex: 0 0 auto;
	width: 138px;
	margin-right: 0;
	height: 52px;
	min-height: 52px;
}
.single-product div.product .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.single-product div.product form.cart:not(.variations_form) .single_add_to_cart_button {
	flex: 1 1 auto;
	width: auto;
	height: 52px;
	min-height: 52px;
	padding: 0 24px;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
/* 售罄时按钮置灰提示（Woo 默认加 .disabled） */
.single-product div.product .single_add_to_cart_button.disabled,
.single-product div.product .single_add_to_cart_button.wc-variation-selection-needed {
	opacity: .55;
	cursor: not-allowed;
}

/* 隐藏 Woo 原生变体价格，避免与自定义价格区重复显示 */
.single-product div.product .woocommerce-variation-price { display: none; }
.single-product div.product .single_add_to_cart_button {
	width: 100%;
	background: #111;
	color: #fff;
	font-weight: 700;
	letter-spacing: .03em;
	padding: 14px 24px;
	border-radius: 6px;
}
.single-product div.product .single_add_to_cart_button:hover { background: #333; }

/* 8. Trust 卡片：参考站灰色圆角单卡 */
.acmp-trust-card {
	background: #f7f7f7;
	border-radius: 12px;
	padding: 16px 20px;
	margin: 16px 0 12px;
}
.acmp-trust-title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #111;
	margin-bottom: 8px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.acmp-trust-card p { font-size: 12px; line-height: 1.7; color: #555; margin: 0; }
.acmp-trust-more { color: #111; text-decoration: underline; }



/* 10. 评价分布 */
.acmp-rating-breakdown {
	display: flex;
	gap: 24px;
	align-items: center;
	padding: 18px 0;
	border-bottom: 1px solid #eee;
	margin-bottom: 18px;
	flex-wrap: wrap;
}
.acmp-rb-summary { text-align: center; min-width: 140px; }
.acmp-rb-avg { display: block; font-size: 34px; font-weight: 700; }
.acmp-rb-total { display: block; font-size: 12px; color: #888; margin-top: 4px; }
.acmp-rb-bars { flex: 1; min-width: 240px; }
.acmp-rb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.acmp-rb-star { font-size: 12px; color: #666; width: 48px; }
.acmp-rb-track {
	flex: 1;
	height: 8px;
	background: #eee;
	border-radius: 4px;
	overflow: hidden;
	display: block;
}
.acmp-rb-fill { display: block; height: 100%; background: #f5a623; }
.acmp-rb-pct { font-size: 12px; color: #888; width: 80px; text-align: right; }

/* 11. 评论列表 */
.commentlist .review .comment-text { border: 0 !important; }
.commentlist .review .comment-text .meta strong { font-size: 14px; }
.commentlist .review .star-rating { float: none; display: inline-block; margin-bottom: 4px; }

/* 12. 弹窗 */
.acmp-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.45);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.acmp-modal.is-open { display: flex; }
.acmp-modal-box {
	background: #fff;
	border-radius: 10px;
	max-width: 480px;
	width: 100%;
	padding: 28px;
	position: relative;
	max-height: 80vh;
	overflow: auto;
}
.acmp-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #999;
}
.acmp-modal-box h3 { margin: 0 0 8px; font-size: 18px; text-transform: uppercase; }
.acmp-modal-box p { font-size: 13px; line-height: 1.7; color: #555; }
.acmp-modal-ok {
	margin-top: 16px;
	background: #111;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 10px 28px;
	font-weight: 700;
	cursor: pointer;
}
.acmp-notify-form { margin-top: 14px; }
.acmp-notify-form input[type="email"] {
	width: 100%;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 10px 12px;
	margin-bottom: 10px;
}
.acmp-notify-form .button {
	width: 100%;
	background: #1a73e8;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 11px;
	font-weight: 700;
	cursor: pointer;
}
.acmp-notify-skip {
	display: block;
	width: 100%;
	background: none;
	border: 0;
	color: #888;
	text-decoration: underline;
	margin-top: 10px;
	cursor: pointer;
}

/* 13. 相关商品标题 */
.related.products > h2, .cross-sells > h2 {
	text-transform: uppercase;
	letter-spacing: .02em;
	font-size: 20px;
}

/* 13b. 相关商品网格：电脑端 4 列 / 平板 3 列 / 手机 2 列 */
.related.products ul.products,
.related.products ul.products[class*='columns-'] {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
}
.related.products ul.products li,
.related.products ul.products li.product {
	width: auto !important;
	max-width: none !important;
	float: none !important;
	clear: none !important;
	margin: 0 !important;
}

/* 13c. 商品 Tabs（About / Shipping & Returns / Reviews）
 * Astra 默认是 inline-block，窄屏会因标签文字较长而折行堆叠。
 * 改为始终排一行，放不下时横向滑动（隐藏滚动条），标签仍点击切换。 */
.woocommerce-js div.product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.woocommerce-js div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
.woocommerce-js div.product .woocommerce-tabs ul.tabs li {
	flex: 0 0 auto;
	margin-right: 20px;
}
.woocommerce-js div.product .woocommerce-tabs ul.tabs li:last-child { margin-right: 0; }
.woocommerce-js div.product .woocommerce-tabs ul.tabs li a { white-space: nowrap; }

/* 14. 响应式 */
@media (max-width: 992px) {
	.related.products ul.products,
	.related.products ul.products[class*='columns-'] {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 768px) {
	.acmp-size-cards,
	.acmp-size-cols-1, .acmp-size-cols-2, .acmp-size-cols-3,
	.acmp-size-cols-4, .acmp-size-cols-5 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
	.acmp-size-card { min-height: 190px; }
	.acmp-sc-img img { max-height: 90px; }
	.acmp-rating-breakdown { flex-direction: column; align-items: stretch; }

	/* 手机端相关商品 2 列 */
	.related.products ul.products,
	.related.products ul.products[class*='columns-'] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	/* 加购行在窄屏保持一行：数量框略收窄 */
	.single-product div.product .quantity input.qty { width: 44px; min-width: 44px; }
	.acmp-qty-btn { width: 34px; }

	/* 手机端商品 Tabs：改为三等分方框，各自有边界，一眼看出是 3 个标签 */
	.woocommerce-js div.product .woocommerce-tabs ul.tabs {
		display: flex;
		gap: 8px;
		overflow: visible;
		border-bottom: 0;
	}
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li {
		flex: 1 1 0;
		min-width: 0;
		margin: 0;
		border: 1px solid #d9d9d9;
		border-radius: 3px;
		background: #fff;
	}
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li a {
		display: block;
		padding: 9px 6px;
		font-size: 12px;
		line-height: 1.35;
		text-align: center;
		white-space: normal;
		color: #555;
	}
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li.active {
		border-color: #111;
		background: #f4f4f4;
	}
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li.active a { color: #111; font-weight: 700; }

	/* 隐藏 Astra 的分隔线与装饰角，避免和方框冲突 */
	.woocommerce-js div.product .woocommerce-tabs ul.tabs::before,
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li::before,
	.woocommerce-js div.product .woocommerce-tabs ul.tabs li::after { display: none; }
}
