/* Amount to Cart — mọi selector nằm dưới .atc để không ảnh hưởng phần khác của site. */
.atc {
	--atc-fg: var(--wp--preset--color--contrast, #111);
	--atc-bg: var(--wp--preset--color--base, #fff);
	--atc-muted: #6b7280;
	--atc-line: #e5e7eb;
	--atc-soft: #f7f7f8;
	box-sizing: border-box;
	max-width: var(--wp--style--global--content-size, 720px); /* cùng độ rộng cột nội dung của theme, thẳng hàng với tiêu đề */
	margin: 0 auto;
	padding: 28px;
	border: 1px solid var(--atc-line);
	border-radius: 14px;
	background: var(--atc-bg);
	color: var(--atc-fg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
	font-size: 1rem;
	line-height: 1.5;
}

/* Form */
.atc-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 1.05rem;
}
.atc-row { display: flex; gap: 10px; }
.atc-input {
	flex: 1;
	display: flex;
	align-items: center;
	border: 1.5px solid #d1d5db;
	border-radius: 10px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.atc-input:focus-within { border-color: var(--atc-fg); box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.atc-input span { padding: 0 4px 0 16px; font-size: 1.25rem; color: var(--atc-muted); }
.atc-input input {
	flex: 1;
	min-width: 0;
	height: 52px;
	padding: 0 14px 0 2px;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 1.25rem;
	color: var(--atc-fg);
}
.atc .atc-btn {
	height: 52px;
	padding: 0 24px;
	border: 0;
	border-radius: 10px;
	background: var(--atc-fg);
	color: var(--atc-bg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}
.atc .atc-btn:hover { opacity: .88; }
.atc-hint { margin: 8px 0 0; font-size: .875rem; color: var(--atc-muted); }

/* Thông báo */
.atc-msg {
	margin: 20px 0 0;
	padding: 12px 16px;
	border-radius: 10px;
	border: 1px solid;
	font-weight: 500;
}
.atc-ok    { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.atc-near  { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.atc-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }

/* Bảng giỏ hàng */
.atc table.atc-cart {
	width: 100%;
	margin: 24px 0 0;
	border-collapse: collapse;
	border: 0;
	font-size: .95rem;
}
.atc .atc-cart th,
.atc .atc-cart td {
	padding: 12px 8px;
	border: 0;
	border-bottom: 1px solid var(--atc-line);
	vertical-align: middle;
	text-align: left;
}
.atc .atc-cart thead th {
	padding-top: 0;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--atc-muted);
}
.atc .atc-cart .atc-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.atc .atc-cart .atc-qty { text-align: center; width: 56px; font-variant-numeric: tabular-nums; }
.atc-prod { display: flex; align-items: center; gap: 12px; }
.atc-prod img {
	flex: none;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--atc-line);
	background: var(--atc-soft);
}
.atc .atc-cart tfoot th,
.atc .atc-cart tfoot td { border-bottom: 0; padding-top: 16px; font-size: 1.15rem; font-weight: 700; color: var(--atc-fg); }

/* Nút checkout */
.atc .atc-checkout {
	display: block;
	margin-top: 20px;
	padding: 16px 24px;
	border-radius: 10px;
	background: var(--atc-fg);
	color: var(--atc-bg);
	text-align: center;
	text-decoration: none;
	font-weight: 600;
	font-size: 1.05rem;
}
.atc .atc-checkout:hover { opacity: .88; }

/* Mobile: bảng thành danh sách thẻ */
@media (max-width: 600px) {
	.atc { padding: 18px; border-radius: 12px; }
	.atc-row { flex-direction: column; }
	.atc .atc-btn { width: 100%; }
	.atc .atc-cart thead { display: none; }
	.atc .atc-cart,
	.atc .atc-cart tbody,
	.atc .atc-cart tfoot { display: block; }
	.atc .atc-cart tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 4px 12px;
		padding: 12px 0;
		border-bottom: 1px solid var(--atc-line);
	}
	.atc .atc-cart tbody td { padding: 0; border: 0; }
	.atc .atc-cart tbody td.atc-name { grid-column: 1 / -1; }
	.atc .atc-cart tbody td.atc-qty,
	.atc .atc-cart tbody td.atc-price { display: none; }
	.atc .atc-cart tbody td.atc-sub { grid-column: 2; }
	.atc .atc-cart tbody td.atc-sub::before { content: attr(data-label); margin-right: 6px; font-weight: 400; color: var(--atc-muted); }
	.atc .atc-cart tfoot tr { display: flex; justify-content: space-between; }
	.atc .atc-cart tfoot th { padding-left: 0; }
	.atc .atc-cart tfoot td { padding-right: 0; }
}
