/* AG Khách Sỉ – frontend chung. Author: August - https://augustcsgo.com */
.ag-ws-badge {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 7px;
	font-size: 0.7em;
	font-weight: 700;
	line-height: 1.6;
	color: #fff;
	vertical-align: middle;
	background: linear-gradient(135deg, #0f9d6c, #4cc38a);
	border-radius: 999px;
}

.ag-ws-retail-notice {
	margin: 6px 0 12px;
	font-size: 0.9em;
}

.ag-ws-retail-notice a {
	color: #0f9d6c;
	font-weight: 600;
}

.ag-ws-chanh-field {
	clear: both;
}

/* Giỏ hàng khách sỉ: khung báo thiếu + nút thanh toán bị khóa */
.ag-ws-min-box {
	margin: 0 0 12px;
	padding: 12px 14px;
	font-size: 0.9em;
	line-height: 1.5;
	color: #7a2e0e;
	background: #fff7ed;
	border: 1px solid #fdba74;
	border-left: 4px solid #ea580c;
	border-radius: 8px;
}

.ag-ws-min-box__head {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.ag-ws-min-box__head span {
	font-weight: 700;
	color: #c2410c;
}

.ag-ws-min-box ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

.ag-ws-min-box li {
	margin: 0 0 4px;
}

.ag-ws-progress {
	height: 8px;
	overflow: hidden;
	background: #fed7aa;
	border-radius: 999px;
}

.ag-ws-progress span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, #0f9d6c, #4cc38a);
	border-radius: 999px;
	transition: width 0.3s ease;
}

.ag-ws-min-box.is-flash {
	animation: ag-ws-shake 0.5s ease, ag-ws-glow 1.2s ease;
}

@keyframes ag-ws-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-8px); }
	40% { transform: translateX(8px); }
	60% { transform: translateX(-5px); }
	80% { transform: translateX(5px); }
}

@keyframes ag-ws-glow {
	0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
	30% { box-shadow: 0 0 0 6px rgba(234, 88, 12, 0.35); background: #ffedd5; }
}

a.checkout-button.ag-ws-checkout-locked,
a.button.ag-ws-checkout-locked--mini {
	opacity: 0.45;
	cursor: not-allowed;
	filter: grayscale(0.4);
}

@media (prefers-reduced-motion: reduce) {
	.ag-ws-min-box.is-flash {
		animation: ag-ws-glow 1.2s ease;
	}
}

/* Shortcode [ag_ws_button] – màu theo logo (xanh lá + vàng vương miện).
   Selector lặp class để thắng màu link header của theme (Flatsome…). */
a.ag-ws-button.ag-ws-button {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 7px;
	max-width: none;
	overflow: visible;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-decoration: none;
	white-space: nowrap;
	vertical-align: middle;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

a.ag-ws-button.ag-ws-button--solid {
	padding: 9px 18px 9px 12px;
	font-size: 13px;
	color: #fff !important;
	background: linear-gradient(135deg, #0f9d6c 0%, #22b07d 55%, #4cc38a 100%);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(15, 157, 108, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

a.ag-ws-button.ag-ws-button--solid:hover,
a.ag-ws-button.ag-ws-button--solid:focus-visible {
	color: #fff !important;
	transform: translateY(-1px);
	filter: brightness(1.05);
	box-shadow: 0 6px 18px rgba(15, 157, 108, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

a.ag-ws-button.ag-ws-button--solid:focus-visible {
	outline: 2px solid #f7b731;
	outline-offset: 2px;
}

/* Vòng tròn chứa icon vương miện vàng */
a.ag-ws-button--solid .ag-ws-button__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: #f7b731;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

a.ag-ws-button .ag-ws-button__icon svg {
	display: block;
	width: 15px;
	height: 15px;
}

a.ag-ws-button .ag-ws-button__text {
	color: inherit !important;
}

/* Chờ duyệt: nền vàng nhạt */
a.ag-ws-button.ag-ws-button--solid.ag-ws-button--pending {
	color: #7a4d00 !important;
	background: linear-gradient(135deg, #fff4d6 0%, #ffe39a 100%);
	box-shadow: 0 4px 12px rgba(247, 183, 49, 0.35);
}

a.ag-ws-button--solid.ag-ws-button--pending .ag-ws-button__icon {
	color: #e08a00;
}

/* Đã là khách sỉ: xanh đậm */
a.ag-ws-button.ag-ws-button--solid.ag-ws-button--approved {
	background: linear-gradient(135deg, #0b6b4a 0%, #0f9d6c 100%);
}

/* Dạng chữ (giống mục menu) */
a.ag-ws-button.ag-ws-button--link {
	color: #0f9d6c !important;
}

a.ag-ws-button--link .ag-ws-button__icon {
	display: inline-flex;
	color: #f7b731;
}

a.ag-ws-button.ag-ws-button--link:hover .ag-ws-button__text {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 549px) {
	a.ag-ws-button.ag-ws-button--solid {
		padding: 7px 13px 7px 8px;
		font-size: 12px;
	}

	a.ag-ws-button--solid .ag-ws-button__icon {
		width: 20px;
		height: 20px;
	}
}

/* ---------- Bảng đặt sỉ theo ri (trang sản phẩm) ---------- */
.ag-ws-ri {
	margin: 10px 0 18px;
	padding: 14px 16px;
	background: #f6fdf9;
	border: 1px solid #c9ecd9;
	border-radius: 14px;
}

.ag-ws-ri__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	margin-bottom: 10px;
}

.ag-ws-ri__head strong {
	color: #0b6b4a;
}

.ag-ws-ri__head span {
	font-size: 0.85em;
	color: #4b5563;
}

.ag-ws-ri__table {
	width: 100%;
	margin: 0 0 10px;
	border-collapse: collapse;
}

.ag-ws-ri__table th {
	padding: 6px 8px;
	font-size: 0.75em;
	letter-spacing: 0.03em;
	text-align: left;
	text-transform: uppercase;
	color: #6b7280;
	border-bottom: 1px solid #d6efe2;
}

.ag-ws-ri__table td {
	padding: 10px 8px;
	vertical-align: middle;
	background: #fff;
	border-bottom: 6px solid #f6fdf9;
}

.ag-ws-ri__table td:first-child {
	border-radius: 10px 0 0 10px;
}

.ag-ws-ri__table td:last-child {
	border-radius: 0 10px 10px 0;
}

.ag-ws-ri__table td small {
	display: block;
	font-size: 0.8em;
	color: #6b7280;
}

.ag-ws-ri__table .ag-ws-ri__warn {
	color: #c2410c;
}

.ag-ws-ri__table tr.is-out td {
	opacity: 0.55;
}

.ag-ws-ri__price {
	font-weight: 700;
	white-space: nowrap;
	color: #0b6b4a;
}

.ag-ws-ri__qty-h,
.ag-ws-ri__qty {
	width: 130px;
	text-align: right;
}

.ag-ws-ri__stepper {
	display: inline-flex;
	align-items: center;
	overflow: hidden;
	border: 1px solid #c9ecd9;
	border-radius: 999px;
}

.ag-ws-ri__stepper input[type="number"] {
	width: 44px;
	height: 34px;
	margin: 0;
	padding: 0;
	font-weight: 700;
	text-align: center;
	border: 0;
	box-shadow: none;
	-moz-appearance: textfield;
}

.ag-ws-ri__stepper input::-webkit-outer-spin-button,
.ag-ws-ri__stepper input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

button.ag-ws-ri__btn {
	width: 34px;
	height: 34px;
	min-height: 0;
	margin: 0;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: #0b6b4a;
	background: #f0faf5;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

button.ag-ws-ri__btn:hover {
	color: #fff;
	background: #0f9d6c;
}

.ag-ws-ri__soldout {
	font-size: 0.85em;
	color: #c2410c;
}

.ag-ws-ri__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.ag-ws-ri__summary {
	font-weight: 600;
	color: #374151;
}

.ag-ws-ri__summary strong {
	color: #0b6b4a;
}

.ag-ws-ri .ag-ws-ri__submit {
	margin: 0;
	background: linear-gradient(135deg, #0f9d6c, #22b07d);
	border-radius: 999px;
}

.ag-ws-ri .ag-ws-ri__submit[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Giỏ hàng: số lượng của dòng thuộc ri */
.ag-ws-ri-cart-qty {
	display: inline-block;
	min-width: 28px;
	font-weight: 700;
	text-align: center;
}

.ag-ws-ri-cart-edit {
	display: block;
	font-size: 0.8em;
}

@media (max-width: 549px) {
	.ag-ws-ri__qty-h,
	.ag-ws-ri__qty {
		width: auto;
	}

	.ag-ws-ri__foot .ag-ws-ri__submit {
		width: 100%;
	}
}

/* Icon SVG dùng chung */
.ag-ws-ico {
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: -0.15em;
}

.ag-ws-retail-notice .ag-ws-ico,
.ag-ws-ri__head .ag-ws-ico {
	color: #f7b731;
}

.ag-ws-min-box__head .ag-ws-ico {
	color: #ea580c;
}

/* Chấm màu trong bảng ri (dữ liệu từ AG Swatches) */
.ag-ws-ri__dot {
	margin-right: 8px;
	vertical-align: -4px;
	cursor: default;
}

.ag-ws-ri__dot:hover {
	transform: none;
}


/* Khách sỉ đã đăng nhập: ẩn mục "Tài khoản" ở header – nút "Chào shop…" đã dẫn vào trang tài khoản. */
body.ag-ws-wholesale-in #header .account-item,
body.ag-ws-wholesale-in .header-wrapper .account-item {
	display: none !important;
}

.ag-ws-button--approved .ag-ws-button__text {
	display: inline-block;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: middle;
}

/* Chữ ngắn của nút sỉ (chỉ hiện trên điện thoại) */
.ag-ws-button__short { display: none; }

/* ---------- Header điện thoại: hàng dưới logo gọn 1 dòng, 2 nút nhỏ cân nhau ---------- */
@media (max-width: 849px) {
	#wide-nav .show-for-medium .nav {
		display: flex;
		flex-wrap: nowrap;
		justify-content: center;
		gap: 8px;
		padding: 2px 0 8px;
	}

	#wide-nav .show-for-medium .nav > li {
		margin: 0 !important;
	}

	#wide-nav .ag-ws-button {
		height: 34px;
		min-height: 34px;
		padding: 0 14px 0 5px !important;
		font-size: 12px !important;
		box-shadow: 0 4px 10px rgba(15, 157, 108, .22) !important;
	}

	#wide-nav .ag-ws-button__icon {
		width: 24px;
		height: 24px;
	}

	#wide-nav .ag-ws-button__text { display: none; }
	#wide-nav .ag-ws-button__short { display: inline; }

	/* Nút Đăng nhập / Tài khoản: viên thuốc trắng viền xanh cùng chiều cao */
	#wide-nav .account-item > a,
	#wide-nav .account-item .header-button > a {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		height: 34px;
		min-height: 34px;
		margin: 0;
		padding: 0 14px !important;
		font-size: 12px;
		font-weight: 800;
		line-height: 1;
		color: #0b6b4a !important;
		background: #fff !important;
		border: 1.5px solid #cfe9dc !important;
		border-radius: 999px !important;
		box-shadow: 0 4px 10px rgba(11, 107, 74, .08) !important;
	}

	#wide-nav .account-item > a::before,
	#wide-nav .account-item .header-button > a::before {
		content: "";
		width: 16px;
		height: 16px;
		background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E") center / contain no-repeat;
	}

	#wide-nav .account-item .icon-user { display: none; }
}