/* Matches the theme's rk- design tokens without depending on the theme —
   plain, safe fallback values so this still looks reasonable on any theme. */

/* Language edition picker: a styled dropdown with a live availability hint. */
.rk-rf-language-field {
	width: 100%;
	margin: 0 0 16px;
}

.rk-rf-language-field > label {
	display: block;
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-language-select {
	position: relative;
	display: block;
}

.rk-rf-language-select::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 16px;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--rk-gold, #c7a85d);
	border-bottom: 2px solid var(--rk-gold, #c7a85d);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.rk-rf-language-select select {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	padding: 13px 42px 13px 16px;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: 12px;
	background: var(--rk-white, #fff);
	color: var(--rk-ink, #132033);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rk-rf-language-select select:hover {
	border-color: var(--rk-gold, #c7a85d);
}

.rk-rf-language-select select:focus {
	border-color: var(--rk-gold, #c7a85d);
	outline: none;
	box-shadow: 0 0 0 3px rgba(199, 168, 93, 0.25);
}

/* JS-enhanced custom dropdown: the native select is kept for submission and
   no-JS fallback but visually replaced by a styleable button + panel. */
.rk-rf-dd select {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.rk-rf-dd::after {
	transition: transform 0.2s ease;
}

.rk-rf-dd.is-open::after {
	transform: translateY(-30%) rotate(225deg);
}

.rk-rf-dd__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 13px 42px 13px 16px;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: 12px;
	background: var(--rk-white, #fff);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rk-rf-dd__toggle:hover {
	border-color: var(--rk-gold, #c7a85d);
}

.rk-rf-dd__toggle:focus-visible,
.rk-rf-dd.is-open .rk-rf-dd__toggle {
	border-color: var(--rk-gold, #c7a85d);
	outline: none;
	box-shadow: 0 0 0 3px rgba(199, 168, 93, 0.25);
}

.rk-rf-dd__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 40;
	max-height: 288px;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	list-style: none;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: 14px;
	background: var(--rk-white, #fff);
	box-shadow: 0 18px 44px rgba(6, 17, 31, 0.14);
}

.rk-rf-dd__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 9px;
	cursor: pointer;
}

.rk-rf-dd__option:hover,
.rk-rf-dd__option:focus-visible {
	background: var(--rk-soft, #f4f7fb);
	outline: none;
}

.rk-rf-dd__option[aria-selected='true'] {
	background: var(--rk-gold-bg, #fff6df);
}

.rk-rf-dd__option[aria-selected='true'] .rk-rf-dd__name::after {
	content: '\2713';
	margin-left: 8px;
	color: var(--rk-gold-ink, #8d6e20);
	font-weight: 700;
}

.rk-rf-dd__name {
	font-size: 14px;
	font-weight: 600;
	color: var(--rk-ink, #132033);
	white-space: nowrap;
}

.rk-rf-dd__status {
	font-size: 12px;
	color: var(--rk-muted, #5d6878);
	white-space: nowrap;
}

.rk-rf-dd__status--ready {
	color: var(--rk-success, #0f7a52);
	font-weight: 600;
}

.rk-rf-language-hint {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 8px 0 0;
	font-size: 12.5px;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-language-hint::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--rk-gold, #c7a85d);
}

.rk-rf-language-hint--ready {
	color: var(--rk-success, #0f7a52);
	font-weight: 600;
}

.rk-rf-language-hint--ready::before {
	background: var(--rk-success, #0f7a52);
}

.rk-rf-pending-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--rk-soft, #f4f7fb);
	color: var(--rk-muted, #5d6878);
	font-size: 13px;
}

table.rk-rf-account-reports {
	width: 100%;
	border-collapse: collapse;
}

table.rk-rf-account-reports th,
table.rk-rf-account-reports td {
	padding: 12px 10px;
	border-bottom: 1px solid var(--rk-line, #dfe6ef);
	text-align: left;
}

/* =============================================================================
   Cart, Checkout & order-received (thank you) — WooCommerce Blocks.
   Scoped to the actual block wrapper classes WooCommerce renders, using the
   theme's own --rk-* tokens (already global on the front end) with plain
   fallbacks so this still looks reasonable if the theme's tokens are ever
   missing. Deliberately light-touch: WooCommerce Blocks already inherit a
   fair amount from theme.json (which is why the primary buttons already
   picked up the brand gold) — this fills in the gaps rather than fighting it.
   ========================================================================= */

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
	max-width: var(--rk-max, 1180px);
	margin-inline: auto;
	padding-block: clamp(32px, 5vw, 64px);
	font-family: var(--rk-font-sans, inherit);
}

/*
 * Cart line items + checkout form column: card treatment matching .rk-card.
 * !important is deliberate and scoped to just these visual properties: the
 * exact enqueue order between this stylesheet and WooCommerce Blocks' own
 * (equal-specificity, single-class) rules isn't something a theme/plugin
 * controls, so without it these rules would sometimes win and sometimes
 * silently lose depending on load order — exactly the WordPress core
 * .alignfull-vs-block bug this whole session already ran into once tonight,
 * just from a different source. Not used anywhere else in this file.
 */
.wc-block-cart-items,
.wc-block-checkout__main {
	padding: 24px !important;
	border: 1px solid var(--rk-line, #dfe6ef) !important;
	border-radius: var(--rk-radius, 22px) !important;
	background: var(--rk-white, #fff) !important;
}

/* Sidebar totals / order summary: the same panel treatment used for the
   dark stat panels elsewhere on the site, in its light form. */
.wc-block-cart__sidebar,
.wc-block-checkout__sidebar {
	padding: 24px !important;
	border: 1px solid var(--rk-line, #dfe6ef) !important;
	border-radius: var(--rk-radius, 22px) !important;
	background: var(--rk-soft, #f4f7fb) !important;
}

.wc-block-components-panel,
.wc-block-components-order-summary {
	border-color: var(--rk-line, #dfe6ef);
}

/* Primary actions ("Proceed to Checkout", "Place Order") — reinforce the
   brand gold explicitly rather than relying on inheritance alone, and give
   every WC Blocks button the same pill radius as .rk-btn. */
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-components-button.wp-element-button {
	border-radius: 999px;
	font-weight: 700;
}

.wc-block-components-button.wp-element-button:not(.is-link) {
	background-color: var(--rk-gold, #c7a85d);
	color: #111;
}

.wc-block-components-button.wp-element-button:not(.is-link):hover {
	background-color: #d6b869;
}

/* Text inputs (billing/shipping fields) — match .rk-btn/.rk-panel-list form
   styling used elsewhere (radius, border colour, focus state). */
.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-address-form input,
.wc-block-components-combobox input {
	border-radius: 10px;
	border-color: var(--rk-line, #dfe6ef);
}

.wc-block-components-text-input input:focus,
.wc-block-components-address-form input:focus {
	border-color: var(--rk-gold, #c7a85d);
	box-shadow: 0 0 0 3px rgba(199, 168, 93, 0.25);
}

/* Order-received / thank-you page chrome (success header, overview chips,
   details/customer cards) lives in the THEME: src/scss/woocommerce.scss,
   "Order received" section. Only the .rk-rf-thankyou section below is
   plugin-owned, since its markup is plugin-rendered. */

/* =============================================================================
   "Your reports" section on the thank-you page (class-thankyou.php).
   Two variants: --ready (all files downloadable now) and --pending (at least
   one made-to-order edition still being prepared), plus --unpaid.
   ========================================================================= */

.rk-rf-thankyou {
	margin: 24px 0;
	padding: 28px;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: var(--rk-radius, 22px);
	background: var(--rk-white, #fff);
	font-family: var(--rk-font-sans, inherit);
}

.rk-rf-thankyou--ready {
	border-color: var(--rk-gold-line, #eddba8);
	background: linear-gradient(180deg, #fffdf5 0%, var(--rk-white, #fff) 60%);
}

.rk-rf-thankyou--pending {
	background: var(--rk-soft, #f4f7fb);
}

.rk-rf-thankyou__title {
	margin: 0 0 8px;
	font-size: 24px;
	color: var(--rk-navy, #06111f);
}

.rk-rf-thankyou--ready .rk-rf-thankyou__title::before {
	content: '✓';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin-right: 10px;
	border-radius: 50%;
	background: var(--rk-success, #0f7a52);
	color: #fff;
	font-size: 16px;
	vertical-align: 3px;
}

.rk-rf-thankyou__lede {
	margin: 0 0 20px;
	max-width: 640px;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-thankyou--unpaid .rk-rf-thankyou__lede {
	margin-bottom: 0;
}

.rk-rf-thankyou__items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rk-rf-thankyou__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 16px;
	margin: 0 0 10px;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: var(--rk-radius-sm, 14px);
	background: var(--rk-white, #fff);
}

.rk-rf-thankyou__item-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rk-rf-thankyou__item-name {
	font-weight: 700;
	color: var(--rk-ink, #132033);
}

.rk-rf-thankyou__item-lang {
	font-size: 13px;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-thankyou__download {
	flex-shrink: 0;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--rk-gold, #c7a85d);
	color: #111;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	transition: background-color var(--rk-ease, 0.2s ease);
}

.rk-rf-thankyou__download:hover {
	background: var(--rk-gold-2, #e7d39a);
	color: #111;
}

.rk-rf-thankyou__preparing {
	flex-shrink: 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--rk-gold-bg, #fff6df);
	border: 1px solid var(--rk-gold-line, #eddba8);
	color: var(--rk-gold-ink, #8d6e20);
	font-size: 13px;
	font-weight: 600;
}

.rk-rf-thankyou__note {
	margin: 16px 0 0;
	font-size: 14px;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-thankyou__note a {
	color: var(--rk-steel, #1476a8);
}

@media (max-width: 782px) {
	.wc-block-cart-items,
	.wc-block-checkout__main,
	.wc-block-cart__sidebar,
	.wc-block-checkout__sidebar {
		padding: 18px;
	}

	.rk-rf-thankyou {
		padding: 20px;
	}

	.rk-rf-thankyou__item {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* How many pulls the licence has left — shown next to the Download button so
   the limit is never discovered as a 403. */
.rk-rf-downloads-left {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--rk-slate, #64748b);
}

/* One finished edition only: a dropdown with a single option is a decision
   the buyer can't make, so it becomes a statement of fact instead. */
.rk-rf-language-field--single {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	padding: 12px 14px;
	border: 1px solid var(--rk-line, #dfe6ef);
	border-radius: 14px;
	background: var(--rk-soft, #f4f7fb);
}

.rk-rf-language-field__label {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-language-field__value {
	font-weight: 700;
	color: var(--rk-navy, #06111f);
}

.rk-rf-language-field__value em {
	margin-left: 6px;
	font-style: normal;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--rk-success, #0f7a52);
}

/* The one route left for a language we don't publish yet — a request, never
   a purchase. */
.rk-rf-language-enquiry {
	flex-basis: 100%;
	margin: 6px 0 0;
	font-size: 12.5px;
}

.rk-rf-language-enquiry a {
	color: var(--rk-muted, #5d6878);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rk-rf-language-enquiry a:hover {
	color: var(--rk-navy, #06111f);
}

/* Stands in for the buy button on a report with no finished edition. */
.rk-rf-unavailable {
	padding: 16px;
	border: 1px dashed var(--rk-line, #dfe6ef);
	border-radius: 16px;
	background: var(--rk-soft, #f4f7fb);
}

.rk-rf-unavailable__title {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rk-muted, #5d6878);
}

.rk-rf-unavailable__text {
	margin: 0 0 14px;
	font-size: 14px;
	color: var(--rk-muted, #5d6878);
}

/* A giveaway should read as a decision, not as a zero that slipped in. */
.rk-rf-price-free {
	color: var(--rk-success, #0f7a52);
	font-weight: 800;
	letter-spacing: -0.01em;
}
