/**
 * SoftXAsia Woo Quick Buy — frontend styles.
 */

:root {
	--sxqb-bg: #ff5722;
	--sxqb-color: #fff;
	--sxqb-radius: 4px;
}

.sa-quick-buy-tools {
    display: flex !important;
}

.sxqb-btn {
	align-items: center;
	background: var(--sxqb-bg);
	border: 0;
	border-radius: var(--sxqb-radius);
	color: var(--sxqb-color);
	cursor: pointer;
	display: inline-flex;
	font-weight: 600;
	gap: 0.4em;
	justify-content: center;
	line-height: 1.2;
	padding: 0.55em 1em;
	text-decoration: none;
	transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.sxqb-btn:hover {
	opacity: 0.92;
	/* transform: translateY(-1px); */
}

.sxqb-btn:disabled,
.sxqb-btn.is-loading {
	cursor: wait;
	opacity: 0.65;
	pointer-events: none;
}

.sxqb-btn--small { font-size: 0.82em; padding: 0.35em 0.65em; }
.sxqb-btn--medium { font-size: 0.95em; }
.sxqb-btn--large { font-size: 1.05em; padding: 0.7em 1.2em; }

.sxqb-btn__icon svg { display: block; height: 1.1em; width: 1.1em; }

.sxqb-btn--single {  }

@media (max-width: 549px) {
	.sxqb-btn--full-mobile.sxqb-btn--single {
		display: flex;
		margin: 0.75em 0 0;
		width: 100%;
	}

	.sa-quick-buy-tools {
		display: flex !important;
		flex-wrap: wrap;
		gap: 5px;
		opacity: 1;
		transform: unset;
	}

	.sxqb-product-card, .sxqb-product-card .sxqb-btn {
		width: 100%;
	}
}

/* Popup */
.sxqb-popup {
	inset: 0;
	position: fixed;
	z-index: 99999;
}

.sxqb-popup[hidden] { display: none !important; }

.sxqb-popup__overlay {
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
	inset: 0;
	position: absolute;
	-webkit-tap-highlight-color: transparent;
}

.sxqb-popup__panel {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	left: 50%;
	max-height: 90vh;
	max-width: 520px;
	overflow: hidden;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 2rem);
}

.sxqb-popup--slide .sxqb-popup__panel {
	animation: sxqbSlideIn 0.28s ease;
}

.sxqb-popup--fade .sxqb-popup__panel {
	animation: sxqbFadeIn 0.22s ease;
}

@keyframes sxqbSlideIn {
	from { opacity: 0; transform: translate(-50%, -45%); }
	to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes sxqbFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

.sxqb-popup__close {
    align-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 2;
    padding: 0;
    min-height: unset;
    width: 36px;
    height: 36px;
}

.sxqb-popup__handle {
	display: none !important;
}

.sxqb-popup__panel {
	touch-action: pan-y;
}

.sxqb-popup__body {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	overflow-y: auto;
	padding: 1.25rem;
}

@media (min-width: 550px) {
	.sxqb-popup__body {
		grid-template-columns: 160px 1fr;
	}
}

.sxqb-popup__image img {
	border-radius: 8px;
	display: block;
	height: auto;
	max-width: 100%;
	width: 100%;
}

.sxqb-popup__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.5rem;
}

.sxqb-popup__thumb {
	background: none;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	padding: 0;
}

.sxqb-popup__thumb.is-active { border-color: var(--sxqb-bg); }

.sxqb-popup__thumb img {
	border-radius: 4px;
	display: block;
	height: 48px;
	object-fit: cover;
	width: 48px;
}

.sxqb-popup__title {
	font-size: 1.05rem;
	line-height: 1.35;
	margin: 0 0 0.35rem;
}

.sxqb-popup__price {
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.sxqb-popup__price del {
	font-size: 0.9em;
	font-weight: 400;
	margin-right: 0.35rem;
	opacity: 0.65;
}

.sxqb-popup__sku,
.sxqb-popup__stock {
	font-size: 0.85rem;
	margin-bottom: 0.35rem;
}

.sxqb-popup__stock .out-of-stock { color: #c0392b; }

.sxqb-popup__attribute { margin-bottom: 0.85rem; }

.sxqb-popup__attribute-head {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	margin-bottom: 0.5rem;
}

.sxqb-popup__attribute-label {
	font-size: 0.85rem;
	font-weight: 600;
}

.sxqb-popup__attribute-selected {
	color: var(--sxqb-bg, #ff5722);
	font-size: 0.85rem;
	font-weight: 600;
}

.sxqb-popup__attribute-selected:empty {
	display: none;
}

.sxqb-popup__select--hidden {
	height: 0;
	margin: 0;
	opacity: 0;
	overflow: hidden;
	padding: 0;
	pointer-events: none;
	position: absolute;
	width: 0;
}

.sxqb-popup__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sxqb-popup__option {
	align-items: center;
	background: #fff;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	color: #333;
	cursor: pointer;
	display: inline-flex;
	gap: 0.35rem;
	justify-content: center;
	line-height: 1.2;
	min-height: 38px;
	margin: 0;
	min-width: 38px;
	padding: 0.4rem 0.75rem;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sxqb-popup__option:hover {
	border-color: #bbb;
}

.sxqb-popup__option.is-active {
	border: 0;
}

.sxqb-popup__option--color {
    min-width: 42px;
    border: 0;
    padding: 0;
}

.sxqb-popup__option-color {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 999px;
	display: block;
	height: 28px;
	width: 28px;
}

.sxqb-popup__option--color.is-active .sxqb-popup__option-color {
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--sxqb-bg, #ff5722);
}

.sxqb-popup__option--color .sxqb-popup__option-label {
	height: 1px;
	overflow: hidden;
	position: absolute;
	width: 1px;
	clip: rect(0, 0, 0, 0);
}

.sxqb-popup__option-label {
	font-size: 0.85rem;
}

.sxqb-popup__qty {
	margin-bottom: 0.75rem;
}

.sxqb-popup__qty label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.sxqb-popup__qty-control {
	align-items: center;
	display: inline-flex;
	gap: 0;
	max-width: 160px;
}

.sxqb-popup__qty-btn {
	align-items: center;
	background: #f5f5f5;
	border: 1px solid #ddd;
	color: #333;
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 40px;
	font-size: 1.25rem;
	height: 40px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	transition: background 0.2s ease;
	width: 40px;
	margin: 0;
	min-height: unset;
}

.sxqb-popup__qty-btn:first-child {
	border-radius: 6px 0 0 6px;
}

.sxqb-popup__qty-btn:last-child {
	border-radius: 0 6px 6px 0;
}

.sxqb-popup__qty-btn:hover {
	background: #ececec;
}

.sxqb-popup__qty-btn:active {
	background: #e0e0e0;
}

.sxqb-popup__qty-input {
	-moz-appearance: textfield;
	border: 1px solid #ddd;
	border-left: 0;
	border-radius: 0;
	border-right: 0;
	flex: 1 1 auto;
	font-size: 1rem;
	height: 40px;
	margin: 0;
	max-width: none;
	min-width: 48px;
	padding: 0;
	text-align: center;
	width: 56px;
}

.sxqb-popup__qty-input::-webkit-outer-spin-button,
.sxqb-popup__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.sxqb-btn--popup {
	width: 100%;
}

.sxqb-popup__message {
	background: #fdecea;
	border-radius: 6px;
	color: #c0392b;
	font-size: 0.85rem;
	margin-top: 0.5rem;
	padding: 0.5rem 0.65rem;
}

/* Mobile bottom sheet */
@media (max-width: 549px) {
	.sxqb-popup[data-bottom-sheet="yes"] .sxqb-popup__panel {
		border-radius: 16px 16px 0 0;
		bottom: 0;
		left: 0;
		max-height: 88vh;
		max-width: none;
		top: auto;
		transform: translateY(100%);
		transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
		width: 100%;
	}

	.sxqb-popup[data-bottom-sheet="yes"].is-open .sxqb-popup__panel {
		transform: translateY(0);
	}

	.sxqb-popup[data-bottom-sheet="yes"] .sxqb-popup__close {
		top: 8px;
	}
}

.sxqb-popup.is-open { display: block; }

body.sxqb-popup-open { overflow: hidden; }
