/**
 * CU Rocket Rates - Frontend Styles
 */

/* Featured Rates Block - Minimal, easy-to-style version */
.cu-rocket-featured-rates {
	width: 100%;
}

.cu-rocket-featured-rates__container {
	margin-left: auto;
	margin-right: auto;
	max-width: 1200px;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

.cu-rocket-featured-rates__wrapper {
	display: flex;
	flex-direction: column;
}

@media (min-width: 768px) {
	.cu-rocket-featured-rates__wrapper {
		flex-direction: row;
		align-items: flex-start;
		gap: 2rem;
	}
}

.cu-rocket-featured-rates__header {
	margin-bottom: 2rem;
	display: flex;
	flex-direction: column;
}

@media (min-width: 768px) {
	.cu-rocket-featured-rates__header {
		margin-bottom: 0;
		flex-shrink: 0;
	}
}

.cu-rocket-featured-rates__heading {
	margin-bottom: 1rem;
	font-size: 1.875rem;
	line-height: 2.25rem;
	font-weight: 700;
}

@media (min-width: 768px) {
	.cu-rocket-featured-rates__heading {
		margin-bottom: 1.5rem;
		font-size: 2.25rem;
		line-height: 2.5rem;
	}
}

.cu-rocket-featured-rates__view-all-btn {
	display: inline-block;
	border-radius: 0.25rem;
	border-width: 1px;
	padding: 0.75rem 1.5rem;
	text-align: center;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.025em;
	transition-property: all;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	transition-duration: 150ms;
}

.cu-rocket-featured-rates__grid {
	display: grid;
	flex: 1 1 0%;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 1rem;
}

@media (min-width: 768px) {
	.cu-rocket-featured-rates__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.cu-rocket-featured-rates__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Tablet 2-column grid: first column of each row should not show a divider.
   Themes often use :not(:first-child) + ::before for vertical rules, which
   wrongly adds one before the first card of row 2. */
@media (min-width: 768px) and (max-width: 1023px) {
	.cu-rocket-featured-rates__grid
		> .cu-rocket-featured-rates__card:nth-child(2n + 1)::before {
		content: none;
		display: none;
	}
}

.cu-rocket-featured-rates__card {
	display: flex;
	flex-direction: column;
	border-width: 1px;
	padding: 1.5rem;
}

.cu-rocket-featured-rates__card-title {
	margin-bottom: 0.5rem;
	font-size: 1.125rem;
	line-height: 1.75rem;
	font-weight: 700;
}

.cu-rocket-featured-rates__card-subtitle {
	margin-bottom: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	text-transform: uppercase;
}

.cu-rocket-featured-rates__rate {
	margin-bottom: 1rem;
}

.cu-rocket-featured-rates__rate-number {
	font-size: 2.25rem;
	line-height: 2.5rem;
	font-weight: 700;
}

.cu-rocket-featured-rates__rate-percent {
	vertical-align: super;
	font-size: 1.5rem;
	line-height: 2rem;
}

.cu-rocket-featured-rates__rate-label {
	margin-top: 0.25rem;
	display: block;
	font-size: 0.75rem;
	line-height: 1rem;
}

.cu-rocket-featured-rates__card-link {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 600;
	text-transform: uppercase;
}

.cu-rocket-featured-rates__card-arrow {
	font-size: 1.125rem;
	line-height: 1.75rem;
}

@media (max-width: 768px) {
	.cu-rocket-featured-rates__grid {
		grid-template-columns: repeat(1, minmax(0, 1fr));
	}

	.cu-rocket-featured-rates__heading {
		font-size: 1.5rem;
		line-height: 2rem;
	}

	.cu-rocket-featured-rates__header {
		align-items: center;
		text-align: center;
	}

	.cu-rocket-featured-rates__card {
		align-items: center;
		text-align: center;
	}

	.cu-rocket-featured-rates__rate {
		text-align: center;
	}

	.cu-rocket-featured-rates__card-link {
		justify-content: center;
	}
}
/* Rates Table Block */
.cu-rocket-rates-table {
	margin-top: 3rem;
	margin-bottom: 3rem;
	--tw-bg-opacity: 1;
	background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
	--cu-rocket-tab-active-bg: transparent;
	--cu-rocket-tab-active-text: #15636e;
	--cu-rocket-tab-inactive-text: #000000;
	--cu-rocket-tab-pill-fill: #15636e;
	--cu-rocket-header-bg: #ffffff;
	--cu-rocket-header-text: #000000;
	--cu-rocket-row-alt-bg: #e4eeee;
	--cu-rocket-column-border: transparent;
	--cu-rocket-tab-radius-tl: 0px;
	--cu-rocket-tab-radius-tr: 0px;
	--cu-rocket-tab-radius-br: 0px;
	--cu-rocket-tab-radius-bl: 0px;
	--cu-rocket-header-radius-tl: 0px;
	--cu-rocket-header-radius-tr: 0px;
	--cu-rocket-header-radius-br: 0px;
	--cu-rocket-header-radius-bl: 0px;
	--cu-rocket-row-radius-tl: 0px;
	--cu-rocket-row-radius-tr: 0px;
	--cu-rocket-row-radius-br: 0px;
	--cu-rocket-row-radius-bl: 0px;
}

.cu-rocket-rates-table__container {
	margin-left: auto;
	margin-right: auto;
	/* max-width: 1200px;
	padding-left: 1.25rem;
	padding-right: 1.25rem; */
}

.cu-rocket-rates-table__title {
	margin-bottom: 2.5rem;
	font-size: 1.875rem;
	line-height: 2.25rem;
	font-weight: 700;
	--tw-text-opacity: 1;
	color: rgb(0 0 0 / var(--tw-text-opacity, 1));
}

.cu-rocket-rates-table__tabs {
	margin-bottom: 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	padding-bottom: 0.625rem;
}

.cu-rocket-rates-table__tab {
	position: relative;
	cursor: pointer;
	border-style: none;
	background-color: transparent;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	line-height: 1.5rem;
	font-weight: 600;
	color: var(--cu-rocket-tab-inactive-text, #000000);
	transition-property: all;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	transition-duration: 300ms;
	/* border-bottom: 3px solid transparent; */
}

/* Overlap active tab into the table header (rounded join) only when the visible
   panel starts with the table — not when intro copy (rate content) comes first. */
@media (min-width: 769px) {
	.cu-rocket-rates-table__container:has(
			.cu-rocket-rates-table__tab-content:not(
					.cu-rocket-rates-table__tab-content--hidden
				)
				> .cu-rocket-rates-table__table:first-child
		)
		.cu-rocket-rates-table__tab {
		margin-bottom: -20px;
		padding: 0.75rem 1.5rem 1.5rem 1.5rem;
	}

	.cu-rocket-rates-table__tab:hover:not(.cu-rocket-rates-table__tab--active) {
		color: var(--cu-rocket-tab-inactive-text, #000000);
		background-color: rgba(21, 99, 110, 0.08);
		border-radius: var(--cu-rocket-tab-radius-tl) var(--cu-rocket-tab-radius-tr)
			var(--cu-rocket-tab-radius-br) var(--cu-rocket-tab-radius-bl);
		/* border-bottom-color: var(--cu-rocket-tab-active-text, #15636e); */
	}
}

.cu-rocket-rates-table__tab--active {
	cursor: default;
	color: var(--cu-rocket-tab-active-text);
	border-bottom-color: var(--cu-rocket-tab-active-text);
	background-color: var(--cu-rocket-tab-active-bg);
	border-radius: var(--cu-rocket-tab-radius-tl) var(--cu-rocket-tab-radius-tr)
		var(--cu-rocket-tab-radius-br) var(--cu-rocket-tab-radius-bl);
}

.cu-rocket-rates-table__tab-content {
	display: block;
}

.cu-rocket-rates-table__tab-content--hidden {
	display: none;
}

.cu-rocket-rates-table__rate-content {
	margin-bottom: 2rem;
	margin-top: 2rem;
	font-size: 1rem;
	line-height: 1.625;
	color: #333;
}

.cu-rocket-rates-table__rate-content p {
	margin-bottom: 1rem;
}

.cu-rocket-rates-table__table {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cu-rocket-rates-table__matrix {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: auto;
	border: none;
}

.cu-rocket-rates-table__thead {
	font-size: clamp(0.875rem, 0.5rem + 1.25vw, 1rem);
	line-height: clamp(1.25rem, 0.85rem + 1.1vw, 1.75rem);
	text-align: left;
}

.cu-rocket-rates-table__thead .cu-rocket-rates-table__th {
	background-color: var(--cu-rocket-header-bg);
	color: var(--cu-rocket-header-text);
	text-align: left;
}

.cu-rocket-rates-table__thead
	.cu-rocket-rates-table__tr:first-child
	.cu-rocket-rates-table__th:first-child {
	border-top-left-radius: var(--cu-rocket-header-radius-tl);
}

.cu-rocket-rates-table__thead
	.cu-rocket-rates-table__tr:first-child
	.cu-rocket-rates-table__th:last-child {
	border-top-right-radius: var(--cu-rocket-header-radius-tr);
}

.cu-rocket-rates-table__tbody {
	--tw-bg-opacity: 1;
	font-size: 0.875rem;
	line-height: 1.25rem;
	background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
}

.cu-rocket-rates-table__tbody .cu-rocket-rates-table__tr:nth-of-type(even),
.cu-rocket-rates-table__tbody.tbody
	.cu-rocket-rates-table__tr:nth-of-type(even) {
	background-color: var(--cu-rocket-row-alt-bg);
	border-radius: var(--cu-rocket-row-radius-tl) var(--cu-rocket-row-radius-tr)
		var(--cu-rocket-row-radius-br) var(--cu-rocket-row-radius-bl);
}

.cu-rocket-rates-table__th,
.cu-rocket-rates-table__td {
	padding: 0.625rem 1.5rem;
	vertical-align: middle;
	box-sizing: border-box;
	border-left: 1px solid var(--cu-rocket-column-border);
}

.cu-rocket-rates-table__th:first-child,
.cu-rocket-rates-table__td:first-child {
	border-left: none;
}
.cu-rocket-rates-table__th:last-child,
.cu-rocket-rates-table__td:last-child {
	border-right: none;
}

.cu-rocket-rates-table__th {
	font-weight: 700;
}

.cu-rocket-rates-table__link > a {
	color: #930027;
	text-decoration-line: none;
}

.cu-rocket-rates-table__link > a:hover {
	text-decoration-line: underline;
}

.cu-rocket-rates-table__link i {
	font-size: 1.875rem;
	line-height: 2.25rem;
	color: #930027;
}

.cu-rocket-rates-table__footnotes p {
	padding: 0;
	font-size: 0.75rem;
	line-height: 1rem;
	color: #666;
}

@media (max-width: 768px) {
	.cu-rocket-rates-table__title {
		font-size: 1.5rem;
		line-height: 2rem;
	}

	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__matrix {
		width: max-content;
		min-width: 100%;
	}

	.cu-rocket-rates-table__tabs {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 0.5rem;
		padding-bottom: 1rem;
		margin-bottom: 1.25rem;
	}

	.cu-rocket-rates-table__tab {
		margin-bottom: 0;
		padding: 0.5rem 1rem;
		font-size: 0.875rem;
		line-height: 1.25rem;
		font-weight: 500;
		border-radius: 9999px;
		border: 1px solid var(--cu-rocket-tab-active-bg, #15636e);
		background-color: #fff;
		color: var(--cu-rocket-tab-inactive-text, #000000);
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
		transition:
			background-color 0.15s ease,
			color 0.15s ease,
			border-color 0.15s ease;
	}

	/* Override desktop-only hover (border-bottom-color) so pills keep a full even border */
	.cu-rocket-rates-table__tab:hover:not(.cu-rocket-rates-table__tab--active) {
		background-color: rgba(21, 99, 110, 0.08);
		color: var(--cu-rocket-tab-inactive-text, #000000);
		border: 1px solid var(--cu-rocket-tab-active-bg, #15636e);
	}

	.cu-rocket-rates-table__tab:active:not(.cu-rocket-rates-table__tab--active) {
		background-color: rgba(21, 99, 110, 0.12);
		color: var(--cu-rocket-tab-inactive-text, #000000);
		border: 1px solid var(--cu-rocket-tab-active-bg, #15636e);
	}

	.cu-rocket-rates-table__tab--active {
		background-color: var(--cu-rocket-tab-pill-fill, #15636e);
		color: #fff;
		border: 1px solid var(--cu-rocket-tab-pill-fill, #15636e);
		border-radius: 9999px;
	}

	.cu-rocket-rates-table__tab--active:hover {
		background-color: var(--cu-rocket-tab-pill-fill, #15636e);
		color: #fff;
		border: 1px solid var(--cu-rocket-tab-pill-fill, #15636e);
	}

	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__th,
	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__td {
		white-space: nowrap;
	}

	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__th:first-child,
	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__td:first-child {
		min-width: 8rem;
	}

	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__th:not(:first-child),
	.cu-rocket-rates-table:not(.cu-rocket-rates-table--stacked)
		.cu-rocket-rates-table__td:not(:first-child) {
		min-width: 5.5rem;
	}

	/* --- Stacked layout: each <tr> becomes a card, <td>::before shows the header --- */

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__table {
		overflow-x: visible;
	}

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__matrix {
		width: 100%;
	}

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.cu-rocket-rates-table--stacked
		.cu-rocket-rates-table__tbody
		.cu-rocket-rates-table__tr {
		display: block;
		margin-bottom: 1.5rem;
	}

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__td {
		display: block;
		padding: 0.625rem 1rem;
		text-align: left;
		white-space: normal;
		border-left: none;
		border-right: none;
	}

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__td::before {
		content: attr(data-label);
		display: block;
		font-weight: 700;
		font-size: 0.75rem;
		text-transform: uppercase;
		margin-bottom: 0.125rem;
	}

	.cu-rocket-rates-table--stacked .cu-rocket-rates-table__td:first-child {
		background-color: var(--cu-rocket-header-bg, #1e1e3f);
		color: var(--cu-rocket-header-text, #fff);
		padding: 0.75rem 1rem;
		font-weight: 700;
	}

	.cu-rocket-rates-table--stacked
		.cu-rocket-rates-table__td:first-child::before {
		color: inherit;
	}

	.cu-rocket-rates-table--stacked
		.cu-rocket-rates-table__tbody
		.cu-rocket-rates-table__tr:nth-of-type(even) {
		background-color: transparent;
		border-radius: 0;
	}
}
