/**
 * Danh sách báo giá nhiều sản phẩm (saha-core WooCommerce\QuoteList).
 */

/* Nút "Thêm vào danh sách báo giá" */
.saha-ql-add {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	margin: 10px 0;
	padding: 10px 16px;
	border: 1px solid currentcolor;
	border-radius: 6px;
	background: transparent;
	color: var(--saha-primary, #0b5cab);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.saha-ql-add:hover,
.saha-ql-add:focus-visible {
	background: var(--saha-surface, #f6f7f9);
}

.saha-ql-add.is-added::after {
	content: "✓";
	font-weight: 700;
}

.saha-ql-add--qv {
	margin-top: 12px;
}

/* Số trên icon header (giống số giỏ hàng) */
.saha-ql-link {
	position: relative;
}

.saha-ql-count {
	position: absolute;
	top: -6px;
	left: 14px;
	min-width: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--saha-accent, #f5a623);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.saha-ql-count[hidden] {
	display: none;
}

/* Thông báo nổi */
.saha-ql-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	z-index: 100000;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	align-items: center;
	max-width: calc(100vw - 32px);
	padding: 12px 16px;
	border-radius: 8px;
	background: #111827;
	color: #fff;
	font-size: 14px;
	box-shadow: 0 12px 32px rgb(15 23 42 / 30%);
	opacity: 0;
	transform: translate(-50%, 16px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.saha-ql-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

.saha-ql-toast__link {
	color: #fcd34d;
	font-weight: 700;
}

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

	.saha-ql-toast {
		transition: none;
	}
}

/* Trang danh sách */
.saha-ql__intro {
	margin: 0 0 20px;
	color: var(--saha-muted, #5f6b7a);
}

.saha-ql__status {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: 8px;
	background: var(--saha-surface, #f6f7f9);
}

.saha-ql__status.is-success {
	border-left: 4px solid #16a34a;
}

.saha-ql__status.is-error {
	border-left: 4px solid var(--saha-error, #c62828);
	color: var(--saha-error, #c62828);
}

.saha-ql__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.saha-ql__count {
	margin: 0;
	font-weight: 600;
}

.saha-ql__clear {
	padding: 6px 0;
	border: 0;
	background: none;
	color: var(--saha-muted, #5f6b7a);
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
}

.saha-ql__items {
	margin: 0 0 32px;
	padding: 0;
	border-top: 1px solid var(--saha-border, #e5e7eb);
	list-style: none;
}

.saha-ql__item {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 96px 40px;
	gap: 16px;
	align-items: center;
	padding: 16px 0;
	border-bottom: 1px solid var(--saha-border, #e5e7eb);
}

.saha-ql__item.is-invalid {
	background: rgb(198 40 40 / 6%);
}

.saha-ql__thumb {
	display: block;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--saha-surface, #f6f7f9);
}

.saha-ql__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.saha-ql__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.saha-ql__name {
	color: var(--saha-heading, #111827);
	font-weight: 600;
	text-decoration: none;
}

.saha-ql__meta {
	color: var(--saha-muted, #5f6b7a);
	font-size: 13px;
}

.saha-ql__invalid {
	color: var(--saha-error, #c62828);
	font-size: 13px;
	font-weight: 600;
}

.saha-ql__note,
.saha-ql__qty,
.saha-ql__field input,
.saha-ql__field textarea {
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid var(--saha-border, #d1d5db);
	border-radius: 6px;
	background: var(--saha-background, #fff);
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.saha-ql__note {
	min-height: 36px;
	margin-top: 4px;
	font-size: 14px;
}

.saha-ql__qty {
	text-align: center;
}

.saha-ql__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--saha-muted, #5f6b7a);
	cursor: pointer;
}

.saha-ql__remove:hover,
.saha-ql__remove:focus-visible {
	background: var(--saha-surface, #f6f7f9);
	color: var(--saha-error, #c62828);
}

.saha-ql__empty {
	padding: 40px 16px;
	border: 1px dashed var(--saha-border, #d1d5db);
	border-radius: 10px;
	text-align: center;
}

.saha-ql__form {
	padding: 24px;
	border: 1px solid var(--saha-border, #e5e7eb);
	border-radius: 10px;
	background: var(--saha-surface, #f6f7f9);
}

.saha-ql__form[hidden] {
	display: none;
}

.saha-ql__form-title {
	margin: 0 0 16px;
	font-size: 20px;
}

.saha-ql__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
}

.saha-ql__field {
	margin: 0 0 14px;
}

.saha-ql__field label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 600;
}

.saha-ql__req {
	color: var(--saha-error, #c62828);
}

.saha-ql__field [aria-invalid="true"] {
	border-color: var(--saha-error, #c62828);
}

.saha-ql__error {
	display: block;
	margin-top: 4px;
	color: var(--saha-error, #c62828);
	font-size: 13px;
}

.saha-ql__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 640px) {

	.saha-ql__item {
		grid-template-columns: 56px minmax(0, 1fr) 40px;
		gap: 10px 12px;
	}

	.saha-ql__thumb {
		width: 56px;
		height: 56px;
	}

	.saha-ql__qty {
		grid-row: 2;
		grid-column: 2;
		width: 96px;
	}

	.saha-ql__remove {
		grid-row: 1;
		grid-column: 3;
	}

	.saha-ql__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.saha-ql__form {
		padding: 16px;
	}
}
