/*
 * Subscriptions storefront v1 (D-792, SUBS-1117). Loaded only with eupepsia_subs_v1 = yes
 * (inc/subs-v1.php). Styles WooCommerce Subscriptions' own markup; every value from the site's
 * tokens, with fallbacks. Selectors start with `html body` so they outrank the plugin's
 * build/apfs-frontend.css, which loads on every page.
 */

/* ---------- Product page: buy once / subscribe (grouped layout: two choices, then the plan list) */

html body .eup-buy .wcsatt-options-wrapper {
	margin: 0 0 16px;
	width: 100%;
}

html body .eup-buy .wcsatt-options-prompt-fieldset {
	border: 0;
	margin: 0;
	min-width: 0;
	padding: 0;
}

html body .eup-buy .wcsatt-options-prompt-radios {
	display: grid;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

html body .eup-buy .wcsatt-options-prompt-radio {
	margin: 0;
	padding: 0;
}

html body .eup-buy .wcsatt-options-prompt-label {
	align-items: center;
	background: var(--eup3-surface, #fff);
	border: 1px solid var(--eup3-line, #d9d6cf);
	border-radius: var(--eup3-radius-field, 10px);
	color: var(--eup3-ink, #2b2b2b);
	cursor: pointer;
	display: flex;
	font-size: 15px;
	gap: 12px;
	line-height: 1.35;
	margin: 0;
	min-height: 48px;
	padding: 10px 14px;
	transition: border-color var(--eup3-dur-fast, 120ms) var(--eup3-ease-smooth, ease);
}

html body .eup-buy .wcsatt-options-prompt-label:has( input:checked ) {
	border-color: var(--eup3-ink-strong, #1f1f1f);
	box-shadow: inset 0 0 0 1px var(--eup3-ink-strong, #1f1f1f);
}

html body .eup-buy .wcsatt-options-prompt-label input[type="radio"] {
	accent-color: var(--eup3-ink-strong, #1f1f1f);
	flex: 0 0 auto;
	height: 18px;
	margin: 0;
	width: 18px;
}

html body .eup-buy .wcsatt-options-prompt-label input[type="radio"]:focus-visible {
	outline: 2px solid var(--eup3-accent, #2f6f6a);
	outline-offset: 2px;
}

html body .eup-buy .wcsatt-sub-discount {
	background: var(--eup3-sage, #e7ece4);
	border-radius: var(--eup3-radius-pill, 999px);
	color: var(--eup3-ink-strong, #1f1f1f);
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	margin-left: 6px;
	padding: 4px 8px;
	vertical-align: middle;
}

/* The plan list (shown once "Subscribe" is chosen). */
html body .eup-buy .wcsatt-options-product-wrapper {
	margin: 10px 0 0;
}

html body .eup-buy .wcsatt-options-product-dropdown-label {
	color: var(--eup3-ink-soft, #5a5a5a);
	display: block;
	font-size: 13px;
	margin: 0 0 6px;
}

html body .eup-buy .wcsatt-options-product-dropdown {
	background-color: var(--eup3-surface, #fff);
	border: 1px solid var(--eup3-line, #d9d6cf);
	border-radius: var(--eup3-radius-field, 10px);
	color: var(--eup3-ink, #2b2b2b);
	font-size: 16px; /* 16px: no zoom on focus in iOS Safari. */
	height: 48px;
	margin: 0;
	max-width: 100%;
	padding: 0 12px;
	width: 100%;
}

/* ---------- Price line: the plugin's "or subscribe to save 10%" suffix */

html body .eup-buy__price .wcsatt-sub-options {
	color: var(--eup3-ink-soft, #5a5a5a);
	font-size: 14px;
	font-weight: 400;
}

html body .eup-buy__price .wcsatt-dash {
	display: none;
}

html body .eup-buy__price .wcsatt-sub-options::before {
	content: " \00B7 ";
}

/* Owner, 18 Nov: the price alone, then one calm line under it ("or $8.09 / month when you subscribe (save 10%)"). */
html body .eup-buy__price .eup-subs1-or {
	display: block;
	font-size: 14px;
	line-height: 1.4;
	margin-top: 4px;
}

html body .eup-buy__price .eup-subs1-or::before {
	content: none;
}

/* The one accent: the saving figure, in the palette's text accent (the token the site uses for accent text). */
html body .eup-buy .eup-subs1-pct,
html body .eup-buy__price .eup-subs1-pct {
	color: var(--eup3-accent-text, var(--eup3-ink-strong, #231f20));
	font-weight: 600;
}

/* The "Subscribe & save 10%" choice: title over one quiet detail line. */
html body .eup-buy .eup-subs1-opt {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

html body .eup-buy .eup-subs1-opt__title {
	color: var(--eup3-ink, #2b2b2b);
}

html body .eup-buy .eup-subs1-opt__line {
	color: var(--eup3-ink-soft, #5a5a5a);
	font-size: 13px;
	line-height: 1.4;
}

/* Cards, sliders, related rows and the sticky bar: the price stays one line. */
html body .product-small .wcsatt-sub-options,
html body .product-small .wcsatt-sub-discount,
html body .eup-card .wcsatt-sub-options,
html body .eup-card .wcsatt-sub-discount,
html body .eup-sticky__price .wcsatt-sub-options,
html body .eup-sticky__price .wcsatt-sub-discount {
	display: none;
}

/* ---------- Bag drawer v4: the schedule line and the repeat total */

html body .eup-subs1-repeat {
	margin: 0 0 6px;
}

html body .eup-subs1-repeat__row {
	color: var(--b4-soft, var(--eup3-ink-soft, #5a5a5a));
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
}

html body .eup-subs1-repeat__row .amount {
	color: var(--b4-ink, var(--eup3-ink, #2b2b2b));
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}

/* ---------- Checkout: the plugin's recurring totals rows in the order review */

html body .woocommerce-checkout-review-order-table tr.recurring-totals th {
	font-size: 15px;
	font-weight: 600;
	padding-top: 16px;
	text-align: left;
}

html body .woocommerce-checkout-review-order-table tr.recurring-total th,
html body .woocommerce-checkout-review-order-table tr.recurring-total td {
	font-size: 14px;
	font-weight: 400;
}

html body .woocommerce-checkout-review-order-table .first-payment-date {
	color: var(--eup3-ink-soft, #5a5a5a);
	display: block;
	font-size: 13px;
	font-weight: 400;
}

/* ---------- My Account: subscription list and page */

html body .woocommerce-MyAccount-content .shop_table.my_account_subscriptions,
html body .woocommerce-MyAccount-content .shop_table.subscription_details {
	border-collapse: collapse;
	width: 100%;
}

html body .woocommerce-MyAccount-content .shop_table.subscription_details td,
html body .woocommerce-MyAccount-content .shop_table.my_account_subscriptions td {
	vertical-align: middle;
}

/* The account area paints buttons charcoal; the plugin's buttons inherited the same charcoal as text. */
html body .woocommerce-MyAccount-content .subscription_details .button,
html body .woocommerce-MyAccount-content .my_account_subscriptions .button,
html body .woocommerce-MyAccount-content .order_details .wcs-switch-link,
html body .woocommerce-MyAccount-content .shop_table .wcs-switch-link,
html body.woocommerce-view-subscription .woocommerce-MyAccount-content .my_account_orders .button {
	align-items: center;
	color: var(--eup3-on-ink, #fff);
	display: inline-flex;
	font-size: 14px;
	justify-content: center;
	margin: 0 8px 8px 0;
	min-height: 40px;
	padding: 0 16px;
	width: auto;
}

html body .woocommerce-MyAccount-content .subscription_details .button:hover,
html body .woocommerce-MyAccount-content .subscription_details .button:focus-visible,
html body .woocommerce-MyAccount-content .my_account_subscriptions .button:hover,
html body .woocommerce-MyAccount-content .shop_table .wcs-switch-link:hover {
	color: var(--eup3-on-ink, #fff);
}

@media (max-width: 549px) {
	html body .woocommerce-MyAccount-content .shop_table.subscription_details td,
	html body .woocommerce-MyAccount-content .shop_table.subscription_details th {
		display: block;
		text-align: left;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html body .eup-buy .wcsatt-options-prompt-label {
		transition: none;
	}
}

/* ---------- Guests: sign in first (owner, 18 Nov) */

html body .eup-buy .eup-subs1-guest,
html body .woocommerce-info.eup-subs1-guest--checkout {
	background: var(--eup3-surface, #fff);
	border: 1px solid var(--eup3-line, #d9d6cf);
	border-left: 3px solid var(--eup3-ink-strong, #1f1f1f);
	border-radius: var(--eup3-radius-field, 10px);
	color: var(--eup3-ink, #2b2b2b);
	font-size: 14px;
	line-height: 1.45;
	margin: 0 0 14px;
	padding: 10px 14px;
	width: 100%;
}

/* The product note shows only while a subscription option is checked in its own form (product page and quick view). */
html body form.cart [data-eup-subs-guest] {
	display: none;
}

html body form.cart:has( input[name^="convert_to_sub_"]:checked:not([value="0"]) ) [data-eup-subs-guest] {
	display: block;
}

html body .eup-subs1-guest__link {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

html body .woocommerce-info.eup-subs1-guest--checkout {
	box-sizing: border-box;
	font-size: 15px;
	margin: 0 0 24px;
	max-width: 100%;
}

html body .woocommerce-info.eup-subs1-guest--checkout::before {
	display: none;
}
