/* Variation Cards for Elementor */

.cbdpet-vc {
	--vc-card-gap: 10px;
	--vc-card-radius: 12px;
	--vc-card-border: #e4e1d8;
	--vc-card-bg: #ffffff;
	--vc-card-bg-selected: #eef3fd;
	--vc-accent: #1b4fd0;
	--vc-title-color: #17182c;
	--vc-sub-color: #6c7180;
	--vc-price-color: #17182c;

	--vc-control-height: 52px;
	--vc-control-radius: 999px;
	--vc-btn-bg: #c47612;
	--vc-btn-bg-hover: #a9640c;
	--vc-btn-color: #ffffff;
	--vc-qty-border: #e4e1d8;
	--vc-qty-glyph: #5b6070;
	--vc-qty-glyph-muted: #b9b6ad;
	--vc-qty-bg: #ffffff;

	--vc-focus: 0 0 0 3px rgba(27, 79, 208, 0.35);
}

.cbdpet-vc *,
.cbdpet-vc *::before,
.cbdpet-vc *::after {
	box-sizing: border-box;
}

.cbdpet-vc__form {
	margin: 0;
}

/* ---------- Option cards ---------- */

.cbdpet-vc__options {
	display: flex;
	flex-direction: column;
	gap: var(--vc-card-gap);
	margin-bottom: 18px;
}

.cbdpet-vc__card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 15px 18px;
	background: var(--vc-card-bg);
	border: 1.5px solid var(--vc-card-border);
	border-radius: var(--vc-card-radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cbdpet-vc__card:hover:not(.is-unavailable) {
	border-color: color-mix(in srgb, var(--vc-accent) 45%, var(--vc-card-border));
}

.cbdpet-vc__card.is-selected {
	background: var(--vc-card-bg-selected);
	border-color: var(--vc-accent);
}

.cbdpet-vc__card.is-unavailable {
	cursor: not-allowed;
	opacity: 0.5;
}

.cbdpet-vc__card:has(.cbdpet-vc__radio:focus-visible),
.cbdpet-vc__card.is-focused {
	box-shadow: var(--vc-focus);
	outline: none;
}

/* The real input stays in the accessibility tree but out of sight. */
.cbdpet-vc__radio {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: inherit;
	appearance: none;
	-webkit-appearance: none;
}

.cbdpet-vc__card-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1 1 auto;
	min-width: 0;
}

.cbdpet-vc__card-title {
	color: var(--vc-title-color);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
}

.cbdpet-vc__card-sub {
	color: var(--vc-sub-color);
	font-size: 0.85rem;
	line-height: 1.35;
}

.cbdpet-vc__card-price {
	flex: 0 0 auto;
	color: var(--vc-price-color);
	font-weight: 700;
	font-size: 1rem;
	white-space: nowrap;
}

.cbdpet-vc__card-price del {
	opacity: 0.55;
	font-weight: 500;
	margin-right: 0.35em;
}

.cbdpet-vc__card-price ins {
	text-decoration: none;
}

/* ---------- Check indicator ---------- */

.cbdpet-vc__check {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 1.5px solid #cfccc3;
	border-radius: 50%;
	background: transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cbdpet-vc__card.is-selected .cbdpet-vc__check {
	background: var(--vc-accent);
	border-color: var(--vc-accent);
}

.cbdpet-vc__check::after {
	content: "";
	position: absolute;
	top: 4.5px;
	left: 7px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0.4);
	opacity: 0;
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.cbdpet-vc__card.is-selected .cbdpet-vc__check::after {
	opacity: 1;
	transform: rotate(45deg) scale(1);
}

/* ---------- Quantity + submit ---------- */

.cbdpet-vc__actions {
	display: flex;
	align-items: stretch;
	gap: 12px;
}

.cbdpet-vc__qty {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	width: 132px;
	height: var(--vc-control-height);
	background: var(--vc-qty-bg);
	border: 1.5px solid var(--vc-qty-border);
	border-radius: var(--vc-control-radius);
	overflow: hidden;
}

/* Specificity is deliberate here: themes and Elementor both style bare
   `button` and `input[type=number]`, and we need to win without !important. */
.cbdpet-vc .cbdpet-vc__qty button.cbdpet-vc__qty-btn {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 100%;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	color: var(--vc-qty-glyph);
	font-family: inherit;
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cbdpet-vc .cbdpet-vc__qty button.cbdpet-vc__qty-btn:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.05);
	color: var(--vc-title-color);
}

.cbdpet-vc .cbdpet-vc__qty button.cbdpet-vc__qty-btn:disabled {
	color: var(--vc-qty-glyph-muted);
	opacity: 1;
	cursor: default;
}

.cbdpet-vc .cbdpet-vc__qty button.cbdpet-vc__qty-btn:focus-visible {
	outline: none;
	box-shadow: inset var(--vc-focus);
}

.cbdpet-vc .cbdpet-vc__qty input.cbdpet-vc__qty-input {
	appearance: textfield;
	-moz-appearance: textfield;
	-webkit-appearance: none;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--vc-title-color);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	text-align: center;
}

.cbdpet-vc .cbdpet-vc__qty input.cbdpet-vc__qty-input::-webkit-outer-spin-button,
.cbdpet-vc .cbdpet-vc__qty input.cbdpet-vc__qty-input::-webkit-inner-spin-button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
}

.cbdpet-vc .cbdpet-vc__qty input.cbdpet-vc__qty-input:focus {
	outline: none;
	box-shadow: none;
}

.cbdpet-vc__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: var(--vc-control-height);
	padding: 0 24px;
	border: 0;
	border-radius: var(--vc-control-radius);
	background: var(--vc-btn-bg);
	color: var(--vc-btn-color);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.cbdpet-vc__submit:hover:not(:disabled) {
	background: var(--vc-btn-bg-hover);
}

.cbdpet-vc__submit:focus-visible {
	outline: none;
	box-shadow: var(--vc-focus);
}

.cbdpet-vc__submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cbdpet-vc__submit.is-busy {
	opacity: 0.75;
	pointer-events: none;
}

.cbdpet-vc__submit-price .amount {
	font-weight: inherit;
}

/* ---------- Messages ---------- */

.cbdpet-vc__message {
	margin: 12px 0 0;
	font-size: 0.9rem;
	color: var(--vc-sub-color);
	min-height: 0;
}

.cbdpet-vc__message:empty {
	display: none;
}

.cbdpet-vc__message.is-error {
	color: #b3261e;
}

.cbdpet-vc__notice {
	padding: 14px 16px;
	border: 1px dashed var(--vc-card-border);
	border-radius: var(--vc-card-radius);
	color: var(--vc-sub-color);
	font-size: 0.9rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 420px) {
	.cbdpet-vc__actions {
		flex-wrap: wrap;
	}

	.cbdpet-vc__qty {
		flex: 1 1 100%;
		width: 100%;
		justify-content: space-between;
	}

	.cbdpet-vc__submit {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cbdpet-vc *,
	.cbdpet-vc *::before,
	.cbdpet-vc *::after {
		transition-duration: 0.01ms !important;
	}
}

/* ---------- Hidden core variation form ---------- */

/* WooCommerce's own form stays in the DOM so its JS keeps driving the
   gallery, but is pulled out of view and out of the tab order. */
.cbdpet-vc__core-form {
	position: absolute;
	left: -9999px;
	top: 0;
	width: 1px;
	height: 1px;
	overflow: hidden;
	pointer-events: none;
}
