/**
 * Skill Woo Multi-Buy and WhatsApp Pro — frontend styles.
 *
 * Every selector is scoped to the plugin wrapper. No generic element
 * selectors are used, so themes and other plugins are never affected.
 */

.wc-mbb-wrapper {
	--wc-mbb-cart-bg: #111827;
	--wc-mbb-cart-text: #ffffff;
	--wc-mbb-cart-hover: #1f2937;
	--wc-mbb-ext-bg: #ffffff;
	--wc-mbb-ext-text: #111827;
	--wc-mbb-ext-hover: #f3f4f6;
	--wc-mbb-wa-bg: #059669;
	--wc-mbb-wa-text: #ffffff;
	--wc-mbb-wa-hover: #047857;
	--wc-mbb-radius: 10px;
	--wc-mbb-border-width: 1px;
	--wc-mbb-font-size: 15px;
	--wc-mbb-font-weight: 600;
	--wc-mbb-icon-size: 18px;
	--wc-mbb-button-height: 48px;
	--wc-mbb-gap: 12px;
	--wc-mbb-modal-width: 520px;
	--wc-mbb-backdrop-opacity: 0.6;

	display: block;
	margin: 1rem 0;
	max-width: 100%;
}

.wc-mbb-wrapper *,
.wc-mbb-wrapper *::before,
.wc-mbb-wrapper *::after {
	box-sizing: border-box;
}

.wc-mbb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wc-mbb-gap);
	align-items: stretch;
}

.wc-mbb-layout--vertical .wc-mbb-buttons {
	flex-direction: column;
	flex-wrap: nowrap;
}

.wc-mbb-align--left .wc-mbb-buttons {
	justify-content: flex-start;
}

.wc-mbb-align--center .wc-mbb-buttons {
	justify-content: center;
}

.wc-mbb-align--right .wc-mbb-buttons {
	justify-content: flex-end;
}

.wc-mbb-align--stretch .wc-mbb-buttons > .wc-mbb-button {
	flex: 1 1 0;
}

.wc-mbb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: var(--wc-mbb-button-height);
	padding: 0 1.25em;
	border: var(--wc-mbb-border-width) solid transparent;
	border-radius: var(--wc-mbb-radius);
	font-size: var(--wc-mbb-font-size);
	font-weight: var(--wc-mbb-font-weight);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		background-color 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease;
	appearance: none;
	-webkit-appearance: none;
}

.wc-mbb-button:hover:not([disabled]):not(.wc-mbb-is-loading) {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.wc-mbb-button:active:not([disabled]) {
	transform: scale(0.985);
}

.wc-mbb-button:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.wc-mbb-button[disabled],
.wc-mbb-button.wc-mbb-is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.wc-mbb-button--full {
	width: 100%;
	flex: 1 1 100%;
}

.wc-mbb-button__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wc-mbb-icon {
	width: var(--wc-mbb-icon-size);
	height: var(--wc-mbb-icon-size);
	flex: 0 0 auto;
}

/* Variants */
.wc-mbb-button--cart.wc-mbb-button--solid {
	background-color: var(--wc-mbb-cart-bg);
	color: var(--wc-mbb-cart-text);
	border-color: var(--wc-mbb-cart-bg);
}

.wc-mbb-button--cart.wc-mbb-button--solid:hover:not([disabled]) {
	background-color: var(--wc-mbb-cart-hover);
	border-color: var(--wc-mbb-cart-hover);
	color: var(--wc-mbb-cart-text);
}

.wc-mbb-button--cart.wc-mbb-button--outline {
	background-color: transparent;
	color: var(--wc-mbb-cart-bg);
	border-color: var(--wc-mbb-cart-bg);
}

.wc-mbb-button--cart.wc-mbb-button--soft {
	background-color: color-mix(in srgb, var(--wc-mbb-cart-bg) 12%, transparent);
	color: var(--wc-mbb-cart-bg);
	border-color: transparent;
}

.wc-mbb-button--external.wc-mbb-button--solid {
	background-color: var(--wc-mbb-ext-bg);
	color: var(--wc-mbb-ext-text);
	border-color: var(--wc-mbb-ext-bg);
}

.wc-mbb-button--external.wc-mbb-button--outline {
	background-color: transparent;
	color: var(--wc-mbb-ext-text);
	border-color: currentColor;
}

.wc-mbb-button--external.wc-mbb-button--outline:hover:not([disabled]) {
	background-color: var(--wc-mbb-ext-hover);
}

.wc-mbb-button--external.wc-mbb-button--soft {
	background-color: var(--wc-mbb-ext-hover);
	color: var(--wc-mbb-ext-text);
	border-color: transparent;
}

.wc-mbb-button--whatsapp.wc-mbb-button--solid {
	background-color: var(--wc-mbb-wa-bg);
	color: var(--wc-mbb-wa-text);
	border-color: var(--wc-mbb-wa-bg);
}

.wc-mbb-button--whatsapp.wc-mbb-button--solid:hover:not([disabled]) {
	background-color: var(--wc-mbb-wa-hover);
	border-color: var(--wc-mbb-wa-hover);
}

.wc-mbb-button--whatsapp.wc-mbb-button--outline {
	background-color: transparent;
	color: var(--wc-mbb-wa-bg);
	border-color: var(--wc-mbb-wa-bg);
}

.wc-mbb-button--whatsapp.wc-mbb-button--soft {
	background-color: color-mix(in srgb, var(--wc-mbb-wa-bg) 14%, transparent);
	color: var(--wc-mbb-wa-hover);
	border-color: transparent;
}

.wc-mbb-button--ghost {
	background-color: transparent;
	color: inherit;
	border-color: rgba(15, 23, 42, 0.18);
}

/* Loading */
.wc-mbb-spinner {
	display: none;
	width: var(--wc-mbb-icon-size);
	height: var(--wc-mbb-icon-size);
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: wc-mbb-spin 0.7s linear infinite;
}

.wc-mbb-button.wc-mbb-is-loading .wc-mbb-spinner {
	display: inline-block;
}

.wc-mbb-button.wc-mbb-is-loading .wc-mbb-icon {
	display: none;
}

@keyframes wc-mbb-spin {
	to {
		transform: rotate(360deg);
	}
}

.wc-mbb-status {
	margin: 0.5rem 0 0;
	font-size: 0.875em;
	min-height: 1em;
}

.wc-mbb-status:empty {
	display: none;
}

.wc-mbb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Modal */
.wc-mbb-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.wc-mbb-modal[hidden] {
	display: none;
}

.wc-mbb-modal__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(2, 6, 23, var(--wc-mbb-backdrop-opacity));
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: wc-mbb-fade 0.2s ease;
}

.wc-mbb-modal__dialog {
	position: relative;
	width: 100%;
	max-width: var(--wc-mbb-modal-width);
	max-height: min(88vh, 900px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background-color: rgba(255, 255, 255, 0.94);
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: calc(var(--wc-mbb-radius) + 8px);
	box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
	padding: 1.5rem;
	color: #0f172a;
	animation: wc-mbb-pop 0.22s ease;
}

.wc-mbb-modal--drawer .wc-mbb-modal__dialog {
	margin-inline-start: auto;
	margin-inline-end: 0;
	max-height: 100vh;
	height: 100%;
	border-radius: calc(var(--wc-mbb-radius) + 8px) 0 0 calc(var(--wc-mbb-radius) + 8px);
	animation: wc-mbb-slide-in 0.24s ease;
}

.wc-mbb-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.wc-mbb-modal__title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
	color: inherit;
}

.wc-mbb-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background-color: rgba(15, 23, 42, 0.06);
	color: inherit;
	cursor: pointer;
}

.wc-mbb-modal__close:hover {
	background-color: rgba(15, 23, 42, 0.12);
}

.wc-mbb-modal__close:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.wc-mbb-modal__summary {
	display: flex;
	gap: 0.85rem;
	align-items: center;
	padding: 0.75rem;
	margin-bottom: 1rem;
	border-radius: var(--wc-mbb-radius);
	background-color: rgba(15, 23, 42, 0.05);
}

.wc-mbb-modal__thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: calc(var(--wc-mbb-radius) - 2px);
}

.wc-mbb-modal__meta {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.wc-mbb-modal__product {
	font-weight: 600;
}

.wc-mbb-modal__price {
	font-size: 0.95em;
}

.wc-mbb-modal__variation {
	font-size: 0.85em;
	opacity: 0.8;
}

.wc-mbb-field {
	margin-bottom: 0.9rem;
}

.wc-mbb-field__label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.wc-mbb-field__required {
	color: #b91c1c;
	margin-inline-start: 0.15em;
}

.wc-mbb-input {
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	border: 1px solid rgba(15, 23, 42, 0.2);
	border-radius: var(--wc-mbb-radius);
	background-color: #ffffff;
	color: inherit;
	font-size: 1rem;
	line-height: 1.4;
}

.wc-mbb-input:focus-visible {
	outline: 3px solid var(--wc-mbb-wa-bg);
	outline-offset: 1px;
	border-color: var(--wc-mbb-wa-bg);
}

.wc-mbb-input--textarea {
	min-height: 84px;
	resize: vertical;
}

.wc-mbb-input.wc-mbb-has-error {
	border-color: #b91c1c;
}

.wc-mbb-field__error {
	margin: 0.3rem 0 0;
	color: #b91c1c;
	font-size: 0.8125rem;
}

.wc-mbb-field__error:empty {
	display: none;
}

.wc-mbb-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.9375rem;
}

.wc-mbb-notice {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	margin: 0 0 0.9rem;
	border-radius: var(--wc-mbb-radius);
	font-size: 0.875rem;
	background-color: rgba(37, 99, 235, 0.1);
	color: #1e3a8a;
}

.wc-mbb-notice--error {
	background-color: rgba(185, 28, 28, 0.1);
	color: #7f1d1d;
}

.wc-mbb-form__status {
	margin: 0.5rem 0 0;
	font-size: 0.875rem;
}

.wc-mbb-form__status:empty {
	display: none;
}

.wc-mbb-modal__actions {
	display: flex;
	gap: 0.75rem;
	justify-content: flex-end;
	margin-top: 1.25rem;
}

.wc-mbb-block-placeholder {
	padding: 1rem;
	border: 1px dashed rgba(15, 23, 42, 0.35);
	border-radius: 8px;
	font-size: 0.875rem;
}

@keyframes wc-mbb-fade {
	from {
		opacity: 0;
	}
}

@keyframes wc-mbb-pop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

@keyframes wc-mbb-slide-in {
	from {
		transform: translateX(24px);
		opacity: 0;
	}
}

/* Responsive */
@media (max-width: 600px) {
	.wc-mbb-stack-mobile .wc-mbb-buttons {
		flex-direction: column;
	}

	.wc-mbb-stack-mobile .wc-mbb-buttons > .wc-mbb-button {
		width: 100%;
	}

	.wc-mbb-modal {
		padding: 0;
		align-items: flex-end;
	}

	.wc-mbb-modal--mobile-drawer .wc-mbb-modal__dialog,
	.wc-mbb-modal--drawer .wc-mbb-modal__dialog {
		max-width: 100%;
		height: auto;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: 18px 18px 0 0;
		padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
		animation: wc-mbb-slide-up 0.24s ease;
	}

	.wc-mbb-modal__actions {
		flex-direction: column-reverse;
	}

	.wc-mbb-modal__actions .wc-mbb-button {
		width: 100%;
	}
}

@keyframes wc-mbb-slide-up {
	from {
		transform: translateY(28px);
		opacity: 0;
	}
}

/* Accessibility preferences */
@media (prefers-reduced-motion: reduce) {
	.wc-mbb-button,
	.wc-mbb-modal__dialog,
	.wc-mbb-modal__backdrop,
	.wc-mbb-spinner {
		transition: none !important;
		animation: none !important;
	}

	.wc-mbb-button:hover:not([disabled]) {
		transform: none;
	}
}

@media (forced-colors: active) {
	.wc-mbb-button {
		border: 1px solid ButtonText;
		forced-color-adjust: none;
		background-color: ButtonFace;
		color: ButtonText;
	}

	.wc-mbb-modal__dialog {
		background-color: Canvas;
		color: CanvasText;
		border: 1px solid CanvasText;
	}
}

/* RTL */
[dir="rtl"] .wc-mbb-modal--drawer .wc-mbb-modal__dialog {
	margin-inline-start: 0;
	margin-inline-end: auto;
}
