/**
 * Vitamic Subs Switcher - base layout.
 *
 * Everything cosmetic is wrapped in :where() so it carries zero specificity and
 * the per-widget CSS Elementor generates from the Style tab always wins.
 */

.dgxss {
	--dgxss-radio-size: 22px;
	--dgxss-radio-gap: 12px;
	--dgxss-accent: #ea9a00;
	box-sizing: border-box;
	color: inherit;
}

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

.dgxss__list {
	display: grid;
	gap: 16px;
}

:where(.dgxss__group-title) {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 16px;
}

/* ------------------------------------------------------------------ Card */

.dgxss__card {
	position: relative;
	width: 100%;
	text-align: left;
	overflow: visible;
	cursor: pointer;
	border-style: solid;
	border-color: transparent;
	transition-property: border-color, background-color, box-shadow, color;
	transition-timing-function: ease;
	transition-duration: 0.28s;
	-webkit-tap-highlight-color: transparent;
}

:where(.dgxss__card) {
	padding: 18px;
	border-width: 1px;
	border-radius: 10px;
	border-color: rgba(0, 0, 0, 0.08);
	background-color: rgba(255, 255, 255, 0.15);
}

:where(.dgxss__card--badge) {
	padding-top: 26px;
}

/*
 * Hover and selected states, so the shortcode looks right without Elementor.
 * Inside the widget these lose to the Style tab's generated CSS, which is the
 * point - they are only a floor, never a ceiling.
 */
:where(.dgxss__card:hover) {
	border-color: var(--dgxss-accent);
}

:where(.dgxss__card.is-active) {
	border-color: var(--dgxss-accent);
	background-color: rgba(234, 154, 0, 0.07);
	background-color: color-mix(in srgb, var(--dgxss-accent) 7%, transparent);
}

.dgxss__card:focus {
	outline: none;
}

.dgxss__card:focus-visible {
	outline: 2px solid var(--dgxss-accent);
	outline-offset: 3px;
}

.dgxss__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 12px;
	width: 100%;
}

.dgxss__left {
	min-width: 0;
}

.dgxss__head {
	display: flex;
	align-items: flex-start;
	gap: var(--dgxss-radio-gap);
	min-width: 0;
	width: 100%;
}

.dgxss__name {
	margin: 0;
	min-width: 0;
	line-height: 1.2;
	white-space: normal;
	overflow-wrap: anywhere;
}

:where(.dgxss__name) {
	font-size: 17px;
	font-weight: 600;
}

/* ----------------------------------------------------------------- Radio */

.dgxss__radio {
	position: relative;
	flex: 0 0 var(--dgxss-radio-size);
	width: var(--dgxss-radio-size);
	height: var(--dgxss-radio-size);
	margin-top: 1px;
	border-radius: 999px;
	border-style: solid;
	transition-property: border-color, background-color;
	transition-timing-function: ease;
	transition-duration: 0.25s;
}

:where(.dgxss__radio) {
	border-width: 2px;
	border-color: #cfcfcf;
	background-color: #fff;
}

.dgxss__radio::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	border-radius: 999px;
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.25s ease;
}

:where(.dgxss__radio)::after {
	background-color: var(--dgxss-accent);
}

:where(.dgxss__card.is-active .dgxss__radio) {
	border-color: var(--dgxss-accent);
}

.dgxss__card.is-active .dgxss__radio::after {
	transform: translate(-50%, -50%) scale(1);
}

/* ----------------------------------------------------------------- Badge */

.dgxss__badge {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	white-space: nowrap;
	border: 1px solid transparent;
}

:where(.dgxss__badge) {
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

:where(.dgxss__badge--light) {
	background-color: #fff;
	border-color: #fff;
	color: #000;
}

:where(.dgxss__badge--dark) {
	background-color: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
}

/* ----------------------------------------------------------------- Price */

.dgxss__price-block {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	gap: 4px;
	flex: 0 0 auto;
	text-align: right;
	white-space: nowrap;
	min-height: 58px;
}

.dgxss__price-top {
	display: flex;
	align-items: center;
	gap: 10px;
	line-height: 1;
}

.dgxss__price {
	line-height: 1;
}

:where(.dgxss__price) {
	font-size: 26px;
	font-weight: 500;
}

:where(.dgxss__discount) {
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	color: var(--dgxss-accent);
}

:where(.dgxss__old-price) {
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	color: #b7b7b7;
}

.dgxss__old-price {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

:where(.dgxss__price-suffix) {
	font-size: 14px;
	font-weight: 500;
}

/* --------------------------------------------------------------- Divider */

.dgxss__divider {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 12px;
	align-items: center;
}

:where(.dgxss__divider) {
	font-weight: 600;
	text-transform: lowercase;
	letter-spacing: 0.02em;
}

.dgxss__divider::before,
.dgxss__divider::after {
	content: "";
	height: 1px;
	background-color: #dfe7e5;
}

/* -------------------------------------------------------------- Features */

.dgxss__features-wrap {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	margin-left: calc(var(--dgxss-radio-size) + var(--dgxss-radio-gap));
	transition: grid-template-rows 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.dgxss--no-radio .dgxss__features-wrap {
	margin-left: 0;
}

.dgxss__features-inner {
	overflow: hidden;
}

.dgxss__card.is-active .dgxss__features-wrap,
.dgxss[data-features="always"] .dgxss__features-wrap {
	grid-template-rows: 1fr;
	opacity: 1;
	margin-top: 4px;
}

.dgxss__features {
	margin: 0;
	padding: 0;
	list-style: none;
}

:where(.dgxss__features) {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
	color: #555;
}

.dgxss__feature {
	position: relative;
	padding-left: 18px;
	margin: 0;
}

.dgxss__feature::before {
	content: "\2713";
	position: absolute;
	left: 0;
	top: 0;
	font-weight: 700;
	line-height: inherit;
}

:where(.dgxss__feature)::before {
	font-size: 12px;
	color: var(--dgxss-accent);
}

.dgxss__feature + .dgxss__feature {
	margin-top: 4px;
}

/* ------------------------------------------------------- Add to cart form */

.dgxss__form {
	margin: 0;
}

.dgxss__actions {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 20px;
}

.dgxss__qty {
	flex: 0 0 auto;
}

.dgxss__qty .qty {
	height: 100%;
	text-align: center;
}

:where(.dgxss__qty .qty) {
	width: 5em;
	padding: 12px 8px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	font-size: 16px;
}

.dgxss__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	cursor: pointer;
	border-style: solid;
	text-decoration: none;
	transition-property: background-color, border-color, color, box-shadow, transform;
	transition-timing-function: ease;
	transition-duration: 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

:where(.dgxss__submit) {
	padding: 15px 34px;
	border-width: 0;
	border-radius: 999px;
	background-color: var(--dgxss-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

:where(.dgxss__submit:hover) {
	filter: brightness(0.94);
}

.dgxss__submit--wide {
	flex: 1 1 auto;
}

.dgxss__submit:focus-visible {
	outline: 2px solid var(--dgxss-accent);
	outline-offset: 3px;
}

/* The editor preview renders a span, not a button - it must not look clickable. */
span.dgxss__submit {
	cursor: default;
}

/* --------------------------------------------------------------- Notices */

.dgxss-notice {
	padding: 14px 16px;
	border: 1px dashed #d0021b;
	border-radius: 8px;
	background: #fff6f6;
	color: #7a0b16;
	font-size: 13px;
	line-height: 1.5;
}

.dgxss-editor-note {
	margin-top: 12px;
	padding: 10px 12px;
	border-left: 3px solid #ea9a00;
	background: #f7f7f8;
	color: #333;
	font-size: 12px;
	line-height: 1.6;
}

.dgxss-editor-note ul {
	margin: 6px 0;
	padding-left: 16px;
}

.dgxss-editor-note li + li {
	margin-top: 6px;
}

.dgxss-editor-note__key {
	opacity: 0.6;
	font-size: 11px;
}

.dgxss-editor-note code {
	background: #fff;
	padding: 1px 4px;
	border-radius: 3px;
}

/* ------------------------------------------------------------ Responsive */

@media (max-width: 767px) {
	:where(.dgxss__card) {
		padding: 16px;
	}

	:where(.dgxss__card--badge) {
		padding-top: 24px;
	}

	.dgxss__top {
		gap: 10px;
	}

	.dgxss__price-block {
		min-height: auto;
	}

	:where(.dgxss__price) {
		font-size: 24px;
	}

	:where(.dgxss__price-suffix),
	:where(.dgxss__discount),
	:where(.dgxss__old-price) {
		font-size: 13px;
	}

	.dgxss__price-top {
		gap: 7px;
	}
}

@media (max-width: 380px) {
	:where(.dgxss__card) {
		padding: 15px;
	}

	:where(.dgxss__name) {
		font-size: 16px;
		line-height: 1.18;
	}

	:where(.dgxss__price) {
		font-size: 22px;
	}

	:where(.dgxss__price-suffix),
	:where(.dgxss__discount),
	:where(.dgxss__old-price) {
		font-size: 12px;
	}

	:where(.dgxss__badge) {
		font-size: 11px;
		padding: 5px 10px;
	}

	:where(.dgxss__features) {
		font-size: 12.5px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dgxss__card,
	.dgxss__radio,
	.dgxss__radio::after,
	.dgxss__features-wrap {
		transition: none !important;
	}
}
