/* ============================================================
   ATP Web Quick Buy — popup styles
   ============================================================ */

:root {
	--atpqb-gold: #f05a25;
	--atpqb-gold-dark: #d8430f;
	--atpqb-price: #e0531f;
	--atpqb-ink: #2a2018;
	--atpqb-line: #ead9cb;
	--atpqb-btn: #caa64a;
	--atpqb-btn-dark: #b8932f;
}

/* ---------- Nút mở popup (Mua ngay) ---------- */
.atpqb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 32px;
	margin-right: 14px;
	border: none;
	border-radius: 50px;
	background: var(--atpqb-btn);
	color: #fff;
	font-weight: 600;
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.18s ease;
}

/* Icon khiên (FA5) cho nút Mua ngay */
.atpqb-button::before {
	font-family: "Font Awesome 5 Free";
	font-weight: 900;
	content: "\f3ed";
	font-size: 12px;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
}

.atpqb-button:hover {
	background: var(--atpqb-btn-dark);
	transform: translateY(-1px);
}

.atpqb-button-small {
	padding: 8px 16px;
	font-size: 0.8rem;
}

/* ---------- Sửa icon ô vuông/skype của nút "Mua thêm" -> giỏ hàng (FA5) ---------- */
.single-product div.product .single_add_to_cart_button:before {
	font-family: "Font Awesome 5 Free" !important;
	font-weight: 900 !important;
	content: "\f07a" !important;
	font-size: 12px !important;
	line-height: 1 !important;
}

/* ---------- Overlay + popup ---------- */
body.atpqb-noscroll {
	overflow: hidden;
}

.atpqb-popup {
	display: none;
}

.atpqb-popup.atpqb-open {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px 16px;
	background: rgba(0, 0, 0, 0.6);
	overflow-y: auto;
	animation: atpqb-fade 0.2s ease;
}

@keyframes atpqb-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.atpqb-popup-inner {
	width: 100%;
	max-width: 780px;
	margin: auto;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	animation: atpqb-slide 0.25s ease;
}

/* phần thân cuộn được khi popup cao hơn màn hình */
.atpqb-popup-body {
	overflow-y: auto;
}

@keyframes atpqb-slide {
	from { transform: translateY(-18px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* ---------- Header ---------- */
.atpqb-popup-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	background: var(--atpqb-gold);
	color: #fff;
}

.atpqb-popup-title {
	font-weight: 700;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.atpqb-popup-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px !important;
	height: 30px !important;
	min-width: 30px !important;
	max-width: 30px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
	font-size: 18px;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background 0.2s ease;
}

.atpqb-popup-close:hover {
	background: rgba(255, 255, 255, 0.45);
}

/* ---------- Body ---------- */
.atpqb-popup-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	padding: 20px;
}

/* Cột sản phẩm */
.atpqb-product {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.atpqb-product-thumb img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.atpqb-product-name {
	font-weight: 700;
	color: var(--atpqb-ink);
	font-size: 1rem;
}

.atpqb-product-price {
	color: var(--atpqb-price);
	font-weight: 700;
	font-size: 1.15rem;
}

.atpqb-product-mess {
	font-size: 0.85rem;
	color: #666;
	line-height: 1.5;
	margin: 4px 0 0;
}

/* Cột form */
.atpqb-form-title {
	font-weight: 700;
	color: var(--atpqb-ink);
	margin-bottom: 12px;
}

.atpqb-form-subtitle {
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 6px;
}

.atpqb-row {
	margin-bottom: 10px;
}

.atpqb-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.atpqb-gender {
	display: flex;
	gap: 18px;
	font-size: 0.9rem;
}

.atpqb-gender label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.atpqb-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--atpqb-line);
	border-radius: 4px;
	font-size: 0.9rem;
	box-sizing: border-box;
	font-family: inherit;
}

.atpqb-input:focus {
	outline: none;
	border-color: var(--atpqb-gold);
	box-shadow: 0 0 0 2px rgba(202, 166, 74, 0.2);
}

textarea.atpqb-input {
	resize: vertical;
}

.atpqb-payment label {
	display: block;
	font-size: 0.88rem;
	margin-bottom: 4px;
	cursor: pointer;
}

.atpqb-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-top: 1px solid var(--atpqb-line);
	font-weight: 700;
	color: var(--atpqb-ink);
}

.atpqb-total-val {
	color: var(--atpqb-price);
	font-size: 1.1rem;
}

.atpqb-submit {
	width: 100%;
	padding: 11px 16px;
	border: none;
	border-radius: 6px;
	background: var(--atpqb-gold);
	color: #fff;
	font-weight: 600;
	font-size: 0.88rem;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.18s ease;
}

.atpqb-submit:hover {
	background: var(--atpqb-gold-dark);
}

.atpqb-submit.is-loading {
	opacity: 0.7;
	cursor: wait;
}

.atpqb-message {
	margin-top: 10px;
	font-size: 0.9rem;
}

.atpqb-message.error {
	color: var(--atpqb-price);
}

.atpqb-message.success {
	color: #2e7d32;
	font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	.atpqb-popup-body {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.atpqb-product {
		flex-direction: row;
		align-items: flex-start;
		gap: 12px;
	}
	.atpqb-product-thumb {
		flex: 0 0 96px;
	}
}
