/*
 * RAHB Event Calculator styles.
 *
 * Design direction: translucent glass against the host page's red brand
 * background. The calculator sits inside the page like a frosted card —
 * the red bleeds through, the form is clearly readable in cream/white,
 * and the Honey Bucket gold drives the recommended numbers and the
 * primary action.
 *
 * Specificity strategy: every rule is scoped under `.rahb-ec` so it
 * always beats single-tag theme rules (`input`, `button`, etc.). For
 * properties most likely to be overridden by a heavy WooCommerce theme
 * (background, color, border, font-family, padding on form elements),
 * we use `!important` defensively. Less elegant but reliable.
 */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Inter+Tight:wght@400;500;600;700&display=swap');

.rahb-ec {
	--rahb-gold:               #f5b51a;
	--rahb-gold-hover:         #ffc83a;
	--rahb-gold-deep:          #c98f00;
	--rahb-cream:              #fff8e7;
	--rahb-glass-bg:           rgba(255, 255, 255, 0.08);
	--rahb-glass-bg-strong:    rgba(255, 255, 255, 0.14);
	--rahb-glass-border:       rgba(255, 255, 255, 0.28);
	--rahb-glass-border-strong:rgba(255, 255, 255, 0.45);
	--rahb-font-display:       'Oswald', 'Impact', sans-serif;
	--rahb-font-body:          'Inter Tight', system-ui, sans-serif;
	--rahb-radius:             6px;
	--rahb-gap:                1.1rem;

	font-family: var(--rahb-font-body) !important;
	color: var(--rahb-cream) !important;
	max-width: 540px;
	margin: 0 auto;
	line-height: 1.4;
}

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

/* Force [hidden] to win against .rahb-ec__group's display:flex rule.
   Selector matches "any element inside .rahb-ec that has [hidden]" with
   higher specificity than `.rahb-ec .rahb-ec__group`. */
.rahb-ec [hidden],
.rahb-ec .rahb-ec__group[hidden] {
	display: none !important;
}

/* ---------- Form ---------- */

.rahb-ec .rahb-ec__form {
	display: flex !important;
	flex-direction: column !important;
	gap: var(--rahb-gap) !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
}

.rahb-ec .rahb-ec__group {
	display: flex !important;
	flex-direction: column !important;
	gap: var(--rahb-gap) !important;
	padding: 1.25rem !important;
	background: var(--rahb-glass-bg) !important;
	border: 1px solid var(--rahb-glass-border) !important;
	border-radius: var(--rahb-radius) !important;
	backdrop-filter: blur(8px) saturate(1.1);
	-webkit-backdrop-filter: blur(8px) saturate(1.1);
}

.rahb-ec .rahb-ec__field {
	display: flex !important;
	flex-direction: column !important;
	gap: 0.4rem !important;
	margin: 0 !important;
	padding: 0 !important;
}

.rahb-ec .rahb-ec__field label {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--rahb-font-body) !important;
	font-weight: 600 !important;
	font-size: 0.82rem !important;
	letter-spacing: 0.04em !important;
	text-transform: uppercase !important;
	color: var(--rahb-cream) !important;
	line-height: 1.3 !important;
}

.rahb-ec .rahb-ec__field input,
.rahb-ec .rahb-ec__field select {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0.7rem 0.85rem !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 1rem !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	color: var(--rahb-cream) !important;
	background: var(--rahb-glass-bg-strong) !important;
	border: 1px solid var(--rahb-glass-border) !important;
	border-radius: var(--rahb-radius) !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	text-transform: none !important;
}

.rahb-ec .rahb-ec__field select {
	background-image:
		linear-gradient(45deg, transparent 50%, var(--rahb-cream) 50%),
		linear-gradient(135deg, var(--rahb-cream) 50%, transparent 50%) !important;
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 13px) calc(50% - 2px) !important;
	background-size: 5px 5px, 5px 5px !important;
	background-repeat: no-repeat !important;
	padding-right: 2.25rem !important;
}

.rahb-ec .rahb-ec__field input::placeholder {
	color: rgba(255, 248, 231, 0.55) !important;
	opacity: 1 !important;
}

.rahb-ec .rahb-ec__field input:hover,
.rahb-ec .rahb-ec__field select:hover {
	border-color: var(--rahb-glass-border-strong) !important;
}

.rahb-ec .rahb-ec__field input:focus,
.rahb-ec .rahb-ec__field select:focus {
	outline: none !important;
	border-color: var(--rahb-gold) !important;
	background: rgba(255, 255, 255, 0.18) !important;
	box-shadow: 0 0 0 3px rgba(245, 181, 26, 0.25) !important;
}

.rahb-ec .rahb-ec__field input[type="number"]::-webkit-outer-spin-button,
.rahb-ec .rahb-ec__field input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}
.rahb-ec .rahb-ec__field input[type="number"] {
	-moz-appearance: textfield !important;
}

.rahb-ec .rahb-ec__field select option {
	color: #2a2a2a !important;
	background: #fff8e7 !important;
}

/* ---------- Results panel ---------- */

.rahb-ec .rahb-ec__results {
	margin-top: 0.25rem;
}

.rahb-ec .rahb-ec__panel {
	position: relative;
	padding: 1.5rem !important;
	background: var(--rahb-glass-bg-strong) !important;
	border: 1px solid var(--rahb-glass-border-strong) !important;
	border-radius: var(--rahb-radius) !important;
	backdrop-filter: blur(10px) saturate(1.15);
	-webkit-backdrop-filter: blur(10px) saturate(1.15);
	animation: rahbReveal 0.4s ease-out;
}

@keyframes rahbReveal {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.rahb-ec .rahb-ec__panel-title {
	margin: 0 0 1.1rem !important;
	padding: 0 !important;
	font-family: var(--rahb-font-display) !important;
	font-weight: 700 !important;
	font-size: 1.6rem !important;
	line-height: 1.1 !important;
	letter-spacing: 0.01em !important;
	text-transform: uppercase !important;
	color: var(--rahb-cream) !important;
}

.rahb-ec .rahb-ec__panel-title::after {
	content: '';
	display: block;
	width: 2.5rem;
	height: 3px;
	margin-top: 0.55rem;
	background: var(--rahb-gold);
	border-radius: 2px;
}

.rahb-ec .rahb-ec__lines {
	list-style: none !important;
	margin: 0 0 1.4rem !important;
	padding: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 0;
}

.rahb-ec .rahb-ec__line {
	display: flex !important;
	align-items: center !important;
	gap: 1rem !important;
	padding: 0.8rem 0 !important;
	margin: 0 !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
	background: transparent !important;
	list-style: none !important;
}

.rahb-ec .rahb-ec__line::before,
.rahb-ec .rahb-ec__line::marker {
	content: none !important;
	display: none !important;
}

.rahb-ec .rahb-ec__line:last-child {
	border-bottom: none !important;
}

.rahb-ec .rahb-ec__line-image {
	flex: 0 0 auto !important;
	width: 56px !important;
	height: 56px !important;
	border-radius: var(--rahb-radius) !important;
	background: rgba(255, 255, 255, 0.92) !important;
	padding: 4px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	overflow: hidden !important;
}

.rahb-ec .rahb-ec__line-image img {
	display: block !important;
	max-width: 100% !important;
	max-height: 100% !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
}

.rahb-ec .rahb-ec__line-image--placeholder {
	background: repeating-linear-gradient(
		135deg,
		rgba(255, 248, 231, 0.08),
		rgba(255, 248, 231, 0.08) 4px,
		rgba(255, 248, 231, 0.14) 4px,
		rgba(255, 248, 231, 0.14) 8px
	) !important;
	border: 1px dashed rgba(255, 248, 231, 0.5) !important;
	padding: 6px !important;
}

.rahb-ec .rahb-ec__line-image--placeholder span {
	font-family: var(--rahb-font-body) !important;
	font-size: 0.58rem !important;
	font-weight: 600 !important;
	line-height: 1.15 !important;
	letter-spacing: 0.04em !important;
	text-transform: uppercase !important;
	text-align: center !important;
	color: rgba(255, 248, 231, 0.85) !important;
}

.rahb-ec .rahb-ec__line-label {
	flex: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.82rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	color: var(--rahb-cream) !important;
	line-height: 1.3 !important;
}

.rahb-ec .rahb-ec__qty {
	display: block !important;
	width: 4.5rem !important;
	min-width: 4.5rem !important;
	max-width: 4.5rem !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0.55rem 0.5rem !important;
	font-family: var(--rahb-font-display) !important;
	font-weight: 700 !important;
	font-size: 1.45rem !important;
	line-height: 1.2 !important;
	text-align: center !important;
	color: var(--rahb-gold) !important;
	background: rgba(0, 0, 0, 0.18) !important;
	border: 1px solid var(--rahb-glass-border) !important;
	border-radius: var(--rahb-radius) !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: textfield !important;
	appearance: none !important;
}

.rahb-ec .rahb-ec__qty::-webkit-outer-spin-button,
.rahb-ec .rahb-ec__qty::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

.rahb-ec .rahb-ec__qty:hover {
	border-color: var(--rahb-glass-border-strong) !important;
}

.rahb-ec .rahb-ec__qty:focus {
	outline: none !important;
	border-color: var(--rahb-gold) !important;
	background: rgba(0, 0, 0, 0.25) !important;
	box-shadow: 0 0 0 3px rgba(245, 181, 26, 0.25) !important;
}

/* ---------- Action button ---------- */

.rahb-ec .rahb-ec__add-all,
.rahb-ec button.rahb-ec__add-all {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0.5rem !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0.95rem 1.5rem !important;
	font-family: var(--rahb-font-display) !important;
	font-weight: 700 !important;
	font-size: 1.05rem !important;
	line-height: 1.2 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	color: #1a1408 !important;
	background: var(--rahb-gold) !important;
	background-image: none !important;
	border: none !important;
	border-radius: var(--rahb-radius) !important;
	cursor: pointer !important;
	box-shadow:
		0 2px 0 var(--rahb-gold-deep),
		0 6px 18px rgba(0, 0, 0, 0.18) !important;
	transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
	text-shadow: none !important;
	text-decoration: none !important;
}

.rahb-ec .rahb-ec__add-all:hover:not([disabled]),
.rahb-ec button.rahb-ec__add-all:hover:not([disabled]) {
	background: var(--rahb-gold-hover) !important;
	transform: translateY(-1px);
	box-shadow:
		0 3px 0 var(--rahb-gold-deep),
		0 9px 22px rgba(0, 0, 0, 0.22) !important;
}

.rahb-ec .rahb-ec__add-all:active:not([disabled]),
.rahb-ec button.rahb-ec__add-all:active:not([disabled]) {
	transform: translateY(1px);
	box-shadow:
		0 1px 0 var(--rahb-gold-deep),
		0 3px 10px rgba(0, 0, 0, 0.18) !important;
}

.rahb-ec .rahb-ec__add-all[disabled],
.rahb-ec button.rahb-ec__add-all[disabled] {
	opacity: 0.45 !important;
	cursor: not-allowed !important;
	box-shadow: 0 2px 0 var(--rahb-gold-deep) !important;
}

/* ---------- Messages and status ---------- */

.rahb-ec .rahb-ec__msg {
	margin: 0 0 1rem !important;
	padding: 0.85rem 1rem !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.95rem !important;
	font-weight: 500 !important;
	line-height: 1.5 !important;
	background: rgba(0, 0, 0, 0.22) !important;
	border-left: 3px solid var(--rahb-gold) !important;
	border-radius: 3px !important;
	color: var(--rahb-cream) !important;
}

.rahb-ec .rahb-ec__msg a {
	color: var(--rahb-gold) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	font-weight: 600 !important;
}

.rahb-ec .rahb-ec__msg a:hover {
	color: var(--rahb-gold-hover) !important;
}

.rahb-ec .rahb-ec__status {
	margin-top: 0.9rem !important;
	min-height: 1.5em !important;
	font-size: 0.92rem !important;
	font-weight: 500 !important;
	color: var(--rahb-cream) !important;
}

.rahb-ec .rahb-ec__status--error {
	color: #ffd9d9 !important;
}

.rahb-ec .rahb-ec__status--success {
	color: #e8ffd9 !important;
}

.rahb-ec .rahb-ec__status a {
	margin-left: 0.5rem !important;
	color: var(--rahb-gold) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
}

.rahb-ec .rahb-ec__status a:hover {
	color: var(--rahb-gold-hover) !important;
}

/* ---------- "How we calculated this" explanation ---------- */

.rahb-ec .rahb-ec__explain {
	margin: 0 0 1.1rem !important;
	padding: 0 !important;
	background: rgba(0, 0, 0, 0.14) !important;
	border: 1px solid rgba(255, 255, 255, 0.18) !important;
	border-radius: var(--rahb-radius) !important;
	overflow: hidden !important;
}

.rahb-ec .rahb-ec__explain-summary {
	display: flex !important;
	align-items: center !important;
	gap: 0.5rem !important;
	padding: 0.7rem 0.9rem !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.82rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: 0.04em !important;
	text-transform: uppercase !important;
	color: var(--rahb-cream) !important;
	cursor: pointer !important;
	user-select: none !important;
	list-style: none !important;
}

/* Hide native disclosure triangle in Webkit/Blink */
.rahb-ec .rahb-ec__explain-summary::-webkit-details-marker {
	display: none !important;
}

/* Custom chevron */
.rahb-ec .rahb-ec__explain-summary::after {
	content: '';
	margin-left: auto;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--rahb-gold);
	border-bottom: 2px solid var(--rahb-gold);
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
}

.rahb-ec .rahb-ec__explain[open] .rahb-ec__explain-summary::after {
	transform: rotate(-135deg) translateY(0);
}

.rahb-ec .rahb-ec__explain-summary:hover {
	background: rgba(0, 0, 0, 0.06) !important;
}

.rahb-ec .rahb-ec__explain-summary:focus-visible {
	outline: 2px solid var(--rahb-gold) !important;
	outline-offset: -2px !important;
}

.rahb-ec .rahb-ec__explain-steps {
	margin: 0 !important;
	padding: 0.4rem 1rem 0 2rem !important;
	list-style: decimal !important;
	color: rgba(255, 248, 231, 0.92) !important;
}

.rahb-ec .rahb-ec__explain-step {
	margin: 0 0 0.7rem !important;
	padding: 0 !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.9rem !important;
	line-height: 1.45 !important;
	color: rgba(255, 248, 231, 0.92) !important;
}

.rahb-ec .rahb-ec__explain-step::marker {
	color: var(--rahb-gold);
	font-weight: 700;
}

.rahb-ec .rahb-ec__explain-text {
	margin: 0 0 0.2rem !important;
	padding: 0 !important;
}

.rahb-ec .rahb-ec__explain-math {
	margin: 0 !important;
	padding: 0.25rem 0.6rem !important;
	display: inline-block !important;
	background: rgba(0, 0, 0, 0.2) !important;
	border-radius: 3px !important;
	font-family: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace !important;
	font-size: 0.82rem !important;
	color: var(--rahb-gold) !important;
}

.rahb-ec .rahb-ec__explain-final {
	margin: 0.4rem 1rem 1rem !important;
	padding: 0.7rem 0.9rem !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.92rem !important;
	font-weight: 500 !important;
	line-height: 1.45 !important;
	color: var(--rahb-cream) !important;
	background: rgba(245, 181, 26, 0.1) !important;
	border-left: 2px solid var(--rahb-gold) !important;
	border-radius: 3px !important;
}

.rahb-ec .rahb-ec__explain-final strong {
	color: var(--rahb-gold) !important;
	font-weight: 700 !important;
	font-size: 1.05em !important;
}

/* ---------- Accessibility disclaimer ---------- */

.rahb-ec .rahb-ec__disclaimer {
	margin: 1.25rem 0 0 !important;
	padding: 0.85rem 1rem !important;
	font-family: var(--rahb-font-body) !important;
	font-size: 0.82rem !important;
	font-weight: 400 !important;
	font-style: italic !important;
	line-height: 1.5 !important;
	letter-spacing: 0.01em !important;
	color: rgba(255, 248, 231, 0.88) !important;
	background: rgba(0, 0, 0, 0.12) !important;
	border-left: 2px solid rgba(245, 181, 26, 0.7) !important;
	border-radius: 3px !important;
	text-transform: none !important;
}

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

@media (max-width: 480px) {
	.rahb-ec .rahb-ec__panel {
		padding: 1.25rem 1.1rem 1.35rem !important;
	}

	.rahb-ec .rahb-ec__panel-title {
		font-size: 1.35rem !important;
	}

	.rahb-ec .rahb-ec__qty {
		width: 4rem !important;
		min-width: 4rem !important;
		max-width: 4rem !important;
		font-size: 1.25rem !important;
	}

	.rahb-ec .rahb-ec__line-image {
		width: 44px !important;
		height: 44px !important;
	}

	.rahb-ec .rahb-ec__line-label {
		font-size: 0.75rem !important;
		letter-spacing: 0.04em !important;
	}
}

/* ---------- Light-page modifier (opt-in) ---------- */

.rahb-ec.is-light {
	color: #2a2a2a !important;
	--rahb-cream: #2a2a2a;
	--rahb-glass-bg: rgba(0, 0, 0, 0.04);
	--rahb-glass-bg-strong: rgba(0, 0, 0, 0.06);
	--rahb-glass-border: rgba(0, 0, 0, 0.12);
	--rahb-glass-border-strong: rgba(0, 0, 0, 0.25);
}

.rahb-ec.is-light .rahb-ec__qty {
	color: var(--rahb-gold-deep) !important;
	background: rgba(0, 0, 0, 0.04) !important;
}

.rahb-ec.is-light .rahb-ec__msg {
	background: #fff8e7 !important;
}
