/* ==========================================================================
   SubsHub Store Fixes — front-end
   Scoped to the elements it fixes. Uses the theme's own tokens so it stays
   visually native, with fallbacks in case a token is renamed.
   ========================================================================== */

:root {
	--shf-ink: var(--ink, #161a10);
	--shf-bg: var(--bg, #f6f4ea);
	--shf-surface: var(--surface, #fcfbf7);
	--shf-line: var(--line, rgba(22, 26, 16, .10));
	--shf-muted: var(--muted, rgba(22, 26, 16, .62));
	--shf-radius: var(--radius, 18px);
	--shf-accent: var(--accent, #4d7cff);
	--shf-lime: #c9e265;
	--shf-warn: #b4590a;
}

/* --------------------------------------------------------------------------
   1. Skip link — keyboard users currently have to tab the whole nav.
   -------------------------------------------------------------------------- */

.shf-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 12px 20px;
	background: var(--shf-ink);
	color: #fff;
	border-radius: 0 0 12px 0;
	font-weight: 600;
	text-decoration: none;
}

.shf-skip:focus {
	left: 0;
	outline: 3px solid var(--shf-accent);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. Product page — "What you are buying" clarity block.
   -------------------------------------------------------------------------- */

.shf-clarity {
	margin: 28px 0 8px;
	padding: 22px 24px;
	background: var(--shf-surface);
	border: 1px solid var(--shf-line);
	border-radius: var(--shf-radius);
}

.shf-clarity__h {
	margin: 0 0 16px;
	font-size: 17px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--shf-ink);
}

.shf-clarity__list {
	margin: 0;
	display: grid;
	gap: 14px;
}

.shf-clarity__row {
	display: grid;
	grid-template-columns: 168px 1fr;
	gap: 4px 20px;
	align-items: start;
}

.shf-clarity__label {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--shf-ink);
}

.shf-clarity__value {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--shf-muted);
	overflow-wrap: break-word;
}

.shf-clarity__value a {
	color: var(--shf-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.shf-clarity__value a:hover,
.shf-clarity__value a:focus-visible {
	color: var(--shf-accent);
}

.shf-clarity__help {
	margin: 18px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--shf-line);
	font-size: 14px;
	color: var(--shf-muted);
}

.shf-clarity__wa {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 4px;
	font-weight: 600;
	color: var(--shf-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.shf-clarity__wa:hover,
.shf-clarity__wa:focus-visible {
	color: #128c7e;
}

.shf-clarity__disclaimer {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--shf-muted);
}

@media (max-width: 640px) {
	.shf-clarity {
		padding: 18px 16px;
	}

	.shf-clarity__row {
		grid-template-columns: 1fr;
		gap: 2px;
	}
}

/* --------------------------------------------------------------------------
   3. "one-time" marker on perpetual licence keys.
   -------------------------------------------------------------------------- */

.shf-oneoff {
	display: inline-block;
	margin-left: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--shf-surface-2, #dbe5ff);
	border: 1px solid var(--shf-line);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--shf-ink);
	vertical-align: middle;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   4. Checkout & cart — the order summary was breaking product names
      mid-word ("Crunch yroll Mega Fan") and stacking prices unreadably.
   -------------------------------------------------------------------------- */

.wc-block-components-order-summary-item {
	word-break: normal;
	overflow-wrap: anywhere;
}

.wc-block-components-order-summary-item__description,
.wc-block-components-order-summary-item__header {
	min-width: 0;
}

.wc-block-components-order-summary-item__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.wc-block-components-order-summary-item .wc-block-components-product-name {
	display: block;
	width: 100%;
	word-break: normal;
	overflow-wrap: break-word;
	hyphens: none;
	font-weight: 600;
	line-height: 1.4;
}

/* Sale price and struck-through price on one readable line. */
.wc-block-components-order-summary-item .wc-block-components-product-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
	white-space: normal;
}

.wc-block-components-order-summary-item .wc-block-components-product-price__regular {
	order: 2;
	font-size: 12px;
	opacity: .6;
}

.wc-block-components-order-summary-item .wc-block-components-product-price__value {
	order: 1;
	font-weight: 700;
	white-space: nowrap;
}

.wc-block-components-order-summary-item .wc-block-components-sale-badge {
	order: 3;
	white-space: nowrap;
}

.wc-block-components-order-summary-item__total-price {
	white-space: nowrap;
	padding-left: 12px;
}

/* The theme wraps page content in a 780px reading-width container. That is
   right for an article and wrong for a two-column checkout: it squeezed the
   order summary until product names broke mid-word. Cart and checkout get
   the full panel width instead. */
.woocommerce-checkout .sh-prose,
.woocommerce-cart .sh-prose,
.woocommerce-order-received .sh-prose {
	max-width: none;
}

@media (min-width: 1000px) {

	.wc-block-checkout__sidebar,
	.wp-block-woocommerce-checkout-totals-block {
		min-width: 300px;
	}
}

/* Reduce the blank-skeleton flash while the block checkout hydrates. */
.wc-block-components-skeleton,
.wc-block-components-order-summary__content .is-loading {
	animation-duration: 1.1s;
}

/* --------------------------------------------------------------------------
   5. Make the WhatsApp field unmistakable — it is the delivery address.
   -------------------------------------------------------------------------- */

#billing-phone,
#shipping-phone {
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

.wc-block-components-address-form .wc-block-components-text-input:has(#billing-phone) {
	position: relative;
}

.shf-wa-hint {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--shf-warn);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. Touch targets. WCAG 2.2 AA asks for 24px minimum; 44px is the
      practical size for a thumb on a 360px phone.
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {

	.sh-btn,
	.button,
	.wc-block-components-button,
	.single_add_to_cart_button,
	.sh-pill,
	.shf-clarity__wa,
	.wc-block-cart__submit-button,
	.wc-block-components-checkout-place-order-button {
		min-height: 44px;
	}

	.sh-qty button,
	.sh-step,
	.quantity .qty,
	.wc-block-components-quantity-selector__button {
		min-width: 44px;
		min-height: 44px;
	}

	.sh-viewall {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.sh-card__actions a,
	.sh-icon-cart,
	.sh-icon-btn {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Header and footer wordmark links were 24px tall. */
	.sh-logo {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	/* Search suggestions, footer nav and popular-search chips. */
	.sh-search__hint a,
	.sh-footer__pop a,
	.sh-footer__links a,
	.sh-drawer a,
	.sh-nav a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}

	.sh-footer__links a {
		padding-block: 2px;
	}
}

/* --------------------------------------------------------------------------
   7. Stop the SALE! badge sitting on top of the product title.
   -------------------------------------------------------------------------- */

.single-product .summary .onsale,
.single-product .sh-pdp__info .onsale {
	position: static;
	display: inline-block;
	margin: 0 0 10px;
	transform: none;
}

/* --------------------------------------------------------------------------
   8. Duration selector — price and saving injected by variations.js.
   -------------------------------------------------------------------------- */

/* The theme lays each pill out as a centred flex ROW. Once a price and a
   saving are added that overflows the grid horizontally on a phone, so the
   pill becomes a column. */
.sh-opt__grid .sh-pill {
	position: relative;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	height: auto;
	min-height: 64px;
	padding: 11px 8px;
	line-height: 1.25;
	text-align: center;
	overflow: visible;
}

.shf-pill-meta {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	font-weight: 600;
	opacity: .8;
	white-space: nowrap;
}

.shf-pill-save {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	color: #2f7d32;
}

.sh-pill.is-active .shf-pill-save {
	color: var(--shf-lime);
}

/* Decorative. Never let these swallow a tap meant for the pill itself. */
.shf-pill-meta,
.shf-pill-save,
.shf-pill-best {
	pointer-events: none;
}

.shf-pill-best {
	position: absolute;
	top: -9px;
	left: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--shf-lime);
	color: var(--shf-ink);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8b. Footer transparency block.
   -------------------------------------------------------------------------- */

.shf-trust {
	background: var(--shf-ink);
	color: rgba(255, 255, 255, .78);
	padding: 40px 20px 34px;
}

.shf-trust__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.shf-trust__h {
	margin: 0 0 22px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .55);
}

.shf-trust__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 26px 32px;
}

.shf-trust__col h3 {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
}

.shf-trust__col p {
	margin: 0;
	font-size: 13px;
	line-height: 1.65;
}

.shf-trust__links {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.4;
}

.shf-trust__links li {
	margin: 0 0 2px;
}

.shf-trust a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
	display: inline-flex;
	align-items: center;
	min-height: 32px;
}

.shf-trust a:hover,
.shf-trust a:focus-visible {
	color: var(--shf-lime);
}

.shf-trust__note {
	margin: 26px 0 0;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	font-size: 12px;
	line-height: 1.7;
	color: rgba(255, 255, 255, .55);
	max-width: 92ch;
}

@media (max-width: 640px) {
	.shf-trust {
		padding: 30px 18px 26px;
	}

	.shf-trust__links li {
		margin: 0 0 4px;
	}

	.shf-trust a {
		min-height: 44px;
	}
}

/* --------------------------------------------------------------------------
   9. Visible focus for keyboard users, everywhere.
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--shf-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
   10. Respect the operating system's reduced-motion setting.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	.sh-marquee,
	.sh-logos__track,
	[class*="marquee"] [class*="track"] {
		animation: none !important;
		transform: none !important;
	}
}
