/* =========================================================
   NAM QUOTE CART — giỏ hàng "yêu cầu báo giá"
   Tông màu theo concept Sơn Hà: primary #398D42, không gradient.
   ========================================================= */

.nam-qc-btn,
.nam-qc-add,
.nam-qc-page,
.nam-qc-float {
	--qc-primary: var(--wp--preset--color--primary, #398D42);
	--qc-primary-dark: #2C7134;
	--qc-soft: #F4F8F4;
	--qc-border: #E4EBE5;
	--qc-text: #1F2A24;
	--qc-muted: #6B7A70;
	--qc-danger: #E0313A;
	box-sizing: border-box;
}

.nam-qc-page *,
.nam-qc-page *::before,
.nam-qc-page *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------
   1. Nút giỏ ở đầu trang
   --------------------------------------------------------- */

.nam-qc-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--qc-primary);
	color: #fff !important;
	text-decoration: none;
	flex: 0 0 auto;
	transition: background-color .2s ease, transform .2s ease;
}

.nam-qc-btn:hover,
.nam-qc-btn:focus-visible {
	background: var(--qc-primary-dark);
	color: #fff !important;
	transform: translateY(-1px);
}

.nam-qc-btn__icon {
	display: flex;
	line-height: 0;
}

.nam-qc-btn__count,
.nam-qc-float__count {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--qc-danger);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
	border: 2px solid #fff;
}

.nam-qc-btn__count.is-empty,
.nam-qc-float__count.is-empty {
	display: none;
}

/* Hiệu ứng nảy khi vừa thêm sản phẩm */
@keyframes namQcPop {
	0% { transform: scale(1); }
	45% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

.nam-qc-btn__count.is-pop,
.nam-qc-float__count.is-pop {
	animation: namQcPop .42s ease;
}

/* ---------------------------------------------------------
   2. Nút giỏ nổi (điện thoại)
   --------------------------------------------------------- */

.nam-qc-float {
	position: fixed;
	left: 16px;
	bottom: 18px;
	z-index: 9990;
	display: none;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--qc-primary);
	color: #fff !important;
	box-shadow: 0 6px 18px rgba(24, 60, 32, .32);
	text-decoration: none;
}

@media (max-width: 1024px) {
	.nam-qc-float {
		display: flex;
	}
}

/* ---------------------------------------------------------
   3. Nút "Đặt mua"
   --------------------------------------------------------- */

.nam-qc-add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 18px;
	border: 1.5px solid var(--qc-primary);
	border-radius: 999px;
	background: var(--qc-primary);
	color: #fff;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.3;
	font-family: inherit;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .15s ease;
}

.nam-qc-add--outline {
	background: #fff;
	color: var(--qc-primary);
}

.nam-qc-add:hover,
.nam-qc-add:focus-visible {
	background: var(--qc-primary-dark);
	border-color: var(--qc-primary-dark);
	color: #fff;
}

.nam-qc-add:active {
	transform: scale(.97);
}

.nam-qc-add__icon {
	display: flex;
	line-height: 0;
}

.nam-qc-add.is-added .nam-qc-add__icon svg path {
	d: path("M20 6 9 17l-5-5");
}

.nam-qc-add.is-busy {
	opacity: .65;
	pointer-events: none;
}

/* ---------------------------------------------------------
   4. Thông báo nhỏ khi thêm vào giỏ
   --------------------------------------------------------- */

.nam-qc-toast {
	position: fixed;
	right: 18px;
	bottom: 96px;
	z-index: 999995;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: min(92vw, 360px);
	padding: 13px 16px;
	border-radius: 10px;
	background: #1F2A24;
	color: #fff;
	font-size: .9rem;
	line-height: 1.4;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease;
}

.nam-qc-toast.is-open {
	opacity: 1;
	transform: translateY(0);
}

.nam-qc-toast--error {
	background: var(--qc-danger);
}

.nam-qc-toast a {
	color: #9BE3A6;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}

@media (max-width: 767px) {
	.nam-qc-toast {
		right: 12px;
		left: 12px;
		bottom: 78px;
		max-width: none;
	}
}

/* ---------------------------------------------------------
   5. Trang giỏ báo giá
   --------------------------------------------------------- */

.nam-qc-page {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin: 0 auto;
	padding: 4px 0 40px;
	color: var(--qc-text);
}

/* ---------- Tiêu đề trang ---------- */

/* Nằm trong cùng lưới với danh sách sản phẩm bên dưới nên mép chữ thẳng hàng tuyệt đối. */
.nam-qc-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	font-size: clamp(1.3rem, 1.05rem + 1vw, 1.85rem);
	font-weight: 800;
	line-height: 1.25;
	color: var(--qc-text);
	text-transform: uppercase;
	letter-spacing: .01em;
}

.nam-qc-title::before {
	content: "";
	flex: 0 0 auto;
	width: 5px;
	height: 1.05em;
	border-radius: 3px;
	background: var(--qc-primary);
}

@media (max-width: 767px) {
	.nam-qc-title {
		margin-bottom: 14px;
	}
}

/* Điện thoại: ô số lượng xuống dòng dưới, nhường cả bề ngang cho tên sản phẩm
   (để chung một hàng thì tên bị bóp còn 2–3 chữ, không đọc được sản phẩm nào). */
@media (max-width: 600px) {
	.nam-qc-item {
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 9px 12px;
		padding-right: 30px;
	}

	.nam-qc-item__thumb {
		width: 64px;
		height: 54px;
	}

	.nam-qc-item__qty {
		grid-column: 2;
		justify-self: start;
	}

	.nam-qc-list,
	.nam-qc-form-wrap {
		padding: 16px 15px;
	}
}

.nam-qc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 26px;
	align-items: start;
}

@media (max-width: 991px) {
	.nam-qc-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
}

.nam-qc-list,
.nam-qc-form-wrap {
	background: #fff;
	border: 1px solid var(--qc-border);
	border-radius: 14px;
	padding: 20px 22px;
}

.nam-qc-list__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--qc-border);
}

.nam-qc-list__head h2,
.nam-qc-form-wrap h2 {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 800;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: .01em;
}

.nam-qc-list__n {
	color: var(--qc-muted);
	font-weight: 600;
}

.nam-qc-clear {
	padding: 0;
	border: 0;
	background: none;
	color: var(--qc-muted);
	font-size: .85rem;
	font-family: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.nam-qc-clear:hover {
	color: var(--qc-danger);
}

/* ---------- Dòng sản phẩm ---------- */

.nam-qc-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nam-qc-item {
	position: relative;
	display: grid;
	grid-template-columns: 74px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 15px 34px 15px 0;
	border-bottom: 1px solid var(--qc-border);
}

.nam-qc-item:last-child {
	border-bottom: 0;
	padding-bottom: 4px;
}

.nam-qc-item.is-removing {
	opacity: .4;
	pointer-events: none;
}

.nam-qc-item__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 74px;
	height: 60px;
	border: 1px solid var(--qc-border);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.nam-qc-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nam-qc-item__body {
	min-width: 0;
}

.nam-qc-item__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: .92rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--qc-text) !important;
	text-decoration: none;
}

.nam-qc-item__name:hover {
	color: var(--qc-primary) !important;
}

.nam-qc-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 4px;
	font-size: .78rem;
	color: var(--qc-muted);
}

.nam-qc-item__sku {
	font-weight: 700;
	color: var(--qc-primary);
}

/* ---------- Số lượng ---------- */

.nam-qc-item__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--qc-border);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.nam-qc-qty-btn {
	width: 30px;
	height: 34px;
	padding: 0;
	border: 0;
	background: var(--qc-soft);
	color: var(--qc-text);
	font-size: 1rem;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color .18s ease;
}

.nam-qc-qty-btn:hover {
	background: #E4EFE6;
}

.nam-qc-qty-input {
	width: 46px;
	height: 34px;
	padding: 0 4px;
	border: 0;
	border-left: 1px solid var(--qc-border);
	border-right: 1px solid var(--qc-border);
	background: #fff;
	color: var(--qc-text);
	font-size: .88rem;
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
}

.nam-qc-qty-input::-webkit-outer-spin-button,
.nam-qc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nam-qc-item__remove {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--qc-muted);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease;
}

.nam-qc-item__remove:hover {
	background: #FCEBEC;
	color: var(--qc-danger);
}

/* ---------------------------------------------------------
   6. Form liên hệ
   --------------------------------------------------------- */

.nam-qc-form-note {
	margin: 8px 0 16px;
	font-size: .86rem;
	line-height: 1.55;
	color: var(--qc-muted);
}

.nam-qc-field {
	margin-bottom: 13px;
}

.nam-qc-row2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 13px;
}

@media (max-width: 480px) {
	.nam-qc-row2 {
		grid-template-columns: minmax(0, 1fr);
	}
}

.nam-qc-field label {
	display: block;
	margin-bottom: 5px;
	font-size: .82rem;
	font-weight: 600;
	color: var(--qc-text);
}

.nam-qc-field label span {
	color: var(--qc-danger);
}

.nam-qc-field input,
.nam-qc-field textarea {
	width: 100%;
	padding: 10px 13px;
	border: 1px solid var(--qc-border);
	border-radius: 8px;
	background: #fff;
	color: var(--qc-text);
	font-size: .92rem;
	font-family: inherit;
	line-height: 1.45;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.nam-qc-field input:focus,
.nam-qc-field textarea:focus {
	outline: none;
	border-color: var(--qc-primary);
	box-shadow: 0 0 0 3px rgba(57, 141, 66, .13);
}

.nam-qc-field textarea {
	resize: vertical;
	min-height: 92px;
}

/* Bẫy bot — ẩn khỏi người dùng nhưng không dùng display:none để bot vẫn thấy */
.nam-qc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nam-qc-submit {
	width: 100%;
	margin-top: 6px;
	padding: 13px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--qc-primary);
	color: #fff;
	font-size: .95rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background-color .2s ease;
}

.nam-qc-submit:hover {
	background: var(--qc-primary-dark);
}

.nam-qc-submit.is-busy {
	opacity: .7;
	pointer-events: none;
}

.nam-qc-hotline {
	margin: 12px 0 0;
	font-size: .84rem;
	text-align: center;
	color: var(--qc-muted);
}

.nam-qc-errors {
	margin-bottom: 14px;
	padding: 12px 14px;
	border: 1px solid #F3C9CB;
	border-radius: 8px;
	background: #FCEBEC;
	color: #A32126;
	font-size: .87rem;
}

.nam-qc-errors p {
	margin: 0 0 4px;
}

.nam-qc-errors p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------
   7. Trạng thái trống / gửi thành công
   --------------------------------------------------------- */

.nam-qc-empty,
.nam-qc-success {
	max-width: 640px;
	margin: 0 auto;
	padding: 40px 26px;
	border: 1px solid var(--qc-border);
	border-radius: 14px;
	background: #fff;
	text-align: center;
}

.nam-qc-empty__icon {
	color: #C3D6C7;
	margin-bottom: 10px;
}

.nam-qc-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: var(--qc-primary);
	color: #fff;
	font-size: 30px;
	line-height: 1;
}

.nam-qc-empty h2,
.nam-qc-success h2 {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 800;
}

.nam-qc-empty p,
.nam-qc-success p {
	margin: 0 0 10px;
	font-size: .93rem;
	line-height: 1.6;
	color: var(--qc-muted);
}

.nam-qc-btn-link {
	display: inline-block;
	margin-top: 8px;
	padding: 11px 24px;
	border-radius: 999px;
	background: var(--qc-primary);
	color: #fff !important;
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
}

.nam-qc-btn-link:hover {
	background: var(--qc-primary-dark);
}

/* ---------------------------------------------------------
   8. Chế độ thương mại điện tử — giỏ hàng gốc WooCommerce
   Ở chế độ này CSS mặc định của Woo được giữ lại, chỉ chỉnh
   thêm cho khớp bề rộng và màu nút của theme.
   --------------------------------------------------------- */

.nam-qc-woo-cart {
	--qc-primary: var(--wp--preset--color--primary, #398D42);
	--qc-text: #1F2A24;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin: 0 auto;
	padding: 4px 0 40px;
}

.nam-qc-woo-cart .button,
.nam-qc-woo-cart .wc-block-components-button {
	border-radius: 999px;
	background-color: var(--qc-primary);
	color: #fff;
}

.nam-qc-woo-cart .checkout-button {
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

	.nam-qc-btn,
	.nam-qc-add,
	.nam-qc-toast,
	.nam-qc-btn__count,
	.nam-qc-float__count {
		transition: none;
		animation: none;
	}
}
