/* 购物车页 —— 对齐 microperfumes.com
 * 两栏布局：左侧商品列表 + 右侧订单摘要（sticky）
 */

.acmp-cart-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 40px;
	align-items: start;
}

/* ---- 标题 ---- */
/* 左侧 CART SUMMARY 与右栏 ORDER SUMMARY 对齐到同一水平线：
 * 两列都是 align-items:start、标题 margin-top 为 0，
 * 只要字号 / 行高 / 字重一致，两个标题就落在同一水平线。
 * 原来 CART SUMMARY 22px、ORDER SUMMARY 18px，基线错开，这里统一。 */
.acmp-cart-title,
.acmp-cart-side .acmp-totals-block > .acmp-side-title {
	font-size: 22px;
	line-height: 28px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #111;
	margin: 0 0 16px;
}

/* 购物车页电脑端内容宽度：Astra 容器默认 1200，这里放宽到 1500 */
@media (min-width: 993px) {
	body.woocommerce-cart .ast-container,
	body.woocommerce-cart .acmp-cart-layout {
		max-width: 1500px;
	}
}

/* ---- 免运进度条 ---- */
.acmp-fs-bar {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 12px 14px;
	margin-bottom: 18px;
	background: #fff;
}
.acmp-fs-text {
	font-size: 13px;
	color: #333;
	margin-bottom: 8px;
}
.acmp-fs-text strong { color: #111; }
.acmp-fs-track {
	height: 6px;
	border-radius: 99px;
	background: #eee;
	overflow: hidden;
}
.acmp-fs-fill {
	height: 100%;
	background: #111;
	border-radius: 99px;
	transition: width .3s ease;
}

/* ---- 商品行 ---- */
.acmp-cart-items {
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}
.acmp-cart-item {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto 110px;
	gap: 16px;
	align-items: center;
	padding: 18px;
	border-bottom: 1px solid #eee;
}
.acmp-cart-item:last-child { border-bottom: 0; }

.acmp-ci-thumb img {
	width: 96px;
	height: 96px;
	object-fit: cover;
	border-radius: 8px;
	background: #f7f7f7;
	display: block;
}

.acmp-ci-info { min-width: 0; }
.acmp-ci-info .acmp-ci-info a,
.acmp-ci-info a {
	color: #111;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
}
.acmp-ci-info a:hover { text-decoration: underline; }
.acmp-ci-meta {
	margin-top: 4px;
	font-size: 13px;
	color: #666;
}
.acmp-ci-meta dl, .acmp-ci-meta ul { margin: 0; }
.acmp-ci-meta dt, .acmp-ci-meta dd { display: inline; margin: 0; }
.acmp-ci-unit {
	margin-top: 6px;
	font-size: 13px;
	color: #666;
}
.acmp-ci-unit-label { margin-left: 4px; }

/* 数量：与详情页一致的 - 1 + */
.acmp-ci-qty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.acmp-ci-qty .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #ddd;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	height: 42px;
}
.acmp-ci-qty .quantity input.qty {
	width: 46px !important;
	min-width: 46px;
	max-width: 46px;
	height: 100%;
	border: 0;
	text-align: center;
	font-weight: 600;
	padding: 0 2px;
	margin: 0;
	box-sizing: border-box;
	-moz-appearance: textfield;
}
.acmp-ci-qty .quantity input.qty::-webkit-outer-spin-button,
.acmp-ci-qty .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.acmp-qty-btn {
	width: 34px;
	flex: 0 0 34px;
	height: 100%;
	border: 0;
	background: #fff;
	color: #111;
	font-size: 16px;
	line-height: 1;
	padding: 0;
	margin: 0;
	cursor: pointer;
}
.acmp-qty-btn:hover { background: #f2f2f2; }

.acmp-ci-remove {
	font-size: 12px;
	color: #888;
	text-decoration: underline;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}
.acmp-ci-remove:hover { color: #c00; }

.acmp-ci-subtotal {
	text-align: right;
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
}

/* ---- 底部操作条 ---- */
.acmp-cart-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 18px;
}

/* Update cart 按钮：本期暂不显示（后台无此开关，只能这里控制）。
 * 只做 CSS 隐藏、保留 DOM——它是 cart.js 的降级入口（AJAX 失败时触发它）。
 * 数量加减已由 cart.js 自动 AJAX 更新，不依赖该按钮。
 * 优惠券不在这里改：由后台「WooCommerce → Settings → General → Enable coupons」控制。 */
.acmp-cart-actions .acmp-update-btn { display: none !important; }
.acmp-continue-shopping {
	font-size: 13px;
	color: #333;
	text-decoration: underline;
	text-underline-offset: 2px;
}
/* 后台未启用优惠券时，操作条里只剩隐藏的 Update cart（cart.js 降级入口），
 * 这里让它不占高度。Update cart 是 display:none 的，隐藏容器不影响 JS 触发。
 * 不支持 :has() 的浏览器会忽略本规则，行为不变。 */
.acmp-cart-actions:not(:has(.acmp-coupon)) { display: none; }
.acmp-coupon { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.acmp-coupon input.input-text {
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 8px 10px;
	min-width: 150px;
}
.acmp-coupon button[type=submit] {
	background: #fff;
	border: 1px solid #111;
	color: #111;
	border-radius: 6px;
	padding: 8px 14px;
	font-weight: 600;
	cursor: pointer;
}
.acmp-coupon button[type=submit]:hover { background: #f2f2f2; }
.acmp-update-btn {
	background: #f2f2f2 !important;
	border: 1px solid #ddd !important;
	color: #333 !important;
	border-radius: 6px !important;
	font-weight: 600 !important;
}

/* ---- 右侧订单摘要 ---- */
.acmp-cart-side .cart-collaterals {
	margin: 0;
	float: none;
	width: 100%;
}
.acmp-cart-side .cart_totals,
.acmp-cart-side .cross-sells {
	width: 100% !important;
	float: none !important;
	margin: 0;
}
/* 订单摘要整块 = 容器外标题 + 卡片。sticky 放在外层，标题跟着一起吸顶 */
.acmp-cart-side .acmp-totals-block {
	position: sticky;
	top: 24px;
}
.acmp-cart-side .cart_totals {
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	padding: 20px;
	background: #fff;
	box-sizing: border-box;
}
/* 区块标题：放在卡片 / 网格外面，参照页面顶部 CART SUMMARY 的呈现
 * （同时用于右栏订单摘要与下方推荐区，所以不限定父容器） */
.acmp-side-title {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #111;
	margin: 0 0 12px;
}

/* 推荐区：购物车列表下方全宽 */
.acmp-cart-crosssell {
	margin-top: 36px;
}
.acmp-cart-crosssell ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
	margin: 0;
}
@media (max-width: 992px) {
	.acmp-cart-crosssell ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
	.acmp-cart-crosssell ul.products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.acmp-cart-side .shop_table {
	border: 0;
	margin: 0 0 14px;
}
.acmp-cart-side .shop_table th,
.acmp-cart-side .shop_table td {
	border: 0;
	padding: 7px 0;
	font-size: 14px;
}
.acmp-cart-side .shop_table th { color: #666; font-weight: 400; }
.acmp-cart-side .shop_table td { text-align: right; }
.acmp-cart-side .order-total th,
.acmp-cart-side .order-total td {
	font-size: 18px;
	font-weight: 700;
	color: #111;
	border-top: 1px solid #eee;
	padding-top: 12px;
}

/* 分期提示 */
.acmp-cart-installments {
	font-size: 13px;
	color: #555;
	margin: 0 0 14px;
}
.acmp-cart-installments strong { color: #111; }

.acmp-cart-side .wc-proceed-to-checkout { padding: 0; margin: 0 0 10px; }
.acmp-cart-side .checkout-button,
.acmp-cart-side .wc-proceed-to-checkout .button {
	display: block;
	width: 100%;
	background: #111;
	color: #fff;
	border-radius: 6px;
	padding: 14px 20px;
	font-weight: 700;
	letter-spacing: .03em;
	text-align: center;
	font-size: 15px;
}
.acmp-cart-side .checkout-button:hover { background: #333; color: #fff; }

.acmp-cart-secure {
	font-size: 12px;
	color: #777;
	text-align: center;
	margin-top: 8px;
}

/* Continue shopping：移到「Guaranteed Safe Checkout」下方，默认带下划线明示可点 */
.acmp-cart-side .acmp-continue-wrap {
	margin: 6px 0 0;
	text-align: center;
}
.acmp-cart-side .acmp-continue-wrap .acmp-continue-shopping {
	font-size: 13px;
	color: #333;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.acmp-cart-side .acmp-continue-wrap .acmp-continue-shopping:hover { color: #000; }

/* 更新中状态 */
.acmp-cart-updating { opacity: .55; pointer-events: none; }

/* ---- 空车态 ---- */
.acmp-cart-empty {
	text-align: center;
	padding: 40px 0 10px;
}
.acmp-empty-title { font-size: 20px; font-weight: 700; margin: 10px 0 6px; }
.acmp-empty-desc { color: #666; max-width: 520px; margin: 0 auto 20px; }
.acmp-empty-btn {
	display: inline-block;
	background: #111;
	color: #fff;
	border-radius: 6px;
	padding: 13px 28px;
	font-weight: 700;
	text-decoration: none;
}
.acmp-empty-btn:hover { background: #333; color: #fff; }

/* ---- 响应式 ---- */
@media (max-width: 992px) {
	.acmp-cart-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.acmp-cart-side .cart_totals { position: static; }
}
@media (max-width: 768px) {
	.acmp-cart-item {
		grid-template-columns: 80px minmax(0, 1fr);
		gap: 12px;
		padding: 14px;
	}
	.acmp-ci-thumb img { width: 80px; height: 80px; }
	.acmp-ci-qty {
		grid-column: 1 / -1;
		flex-direction: row;
		justify-content: space-between;
	}
	.acmp-ci-subtotal {
		grid-column: 2;
		text-align: right;
	}
	.acmp-coupon { margin-left: 0; width: 100%; }
	.acmp-coupon input.input-text { flex: 1 1 auto; min-width: 0; }
}
