/* BB Custom Modules — Tabbed Accordion (frontend) */

.bbcm-ta-wrapper {
	/* CSS variable defaults — overridden inline from saved config. */
	--bbcm-ta-accent: #003366;
	--bbcm-ta-accent-text: #ffffff;
	--bbcm-ta-text: #1f2937;
	--bbcm-ta-muted: #6b7280;
	--bbcm-ta-tab-bar-bg: #e5e7eb;
	--bbcm-ta-item-active-bg: #f3f4f6;
	--bbcm-ta-border: #e5e7eb;

	color: var(--bbcm-ta-text);
	font-family: inherit;
	line-height: 1.5;
	width: 100%;
}

.bbcm-ta-wrapper *,
.bbcm-ta-wrapper *::before,
.bbcm-ta-wrapper *::after {
	box-sizing: border-box;
}

/* ============================================
   TITLE
   ============================================ */

.bbcm-ta-title {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 1.25rem;
	color: var(--bbcm-ta-text);
}

@media (min-width: 768px) {
	.bbcm-ta-title {
		font-size: 2rem;
	}
}

/* ============================================
   TAB BAR
   ============================================ */

.bbcm-ta-tabbar {
	margin-bottom: 1.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bbcm-ta-tablist {
	list-style: none;
	margin: 0;
	padding: 4px;
	display: inline-flex;
	gap: 4px;
	background-color: var(--bbcm-ta-tab-bar-bg);
	border-radius: 4px;
	white-space: nowrap;
}

.bbcm-ta-tablist li {
	margin: 0;
	padding: 0;
}

.bbcm-ta-tab {
	display: inline-block;
	background-color: transparent;
	color: var(--bbcm-ta-muted);
	border: 0;
	padding: 8px 16px;
	font-size: 0.9375rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	border-radius: 3px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bbcm-ta-tab:hover:not(.is-active) {
	background-color: rgba(0, 0, 0, 0.05);
	color: var(--bbcm-ta-text);
}

.bbcm-ta-tab.is-active {
	background-color: var(--bbcm-ta-accent);
	color: var(--bbcm-ta-accent-text);
}

.bbcm-ta-tab:focus-visible {
	outline: 2px solid var(--bbcm-ta-accent);
	outline-offset: 2px;
}

/* ============================================
   PANEL LAYOUT (mobile = stacked, desktop = side-by-side)
   ============================================ */

.bbcm-ta-panel[hidden] { display: none; }

.bbcm-ta-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

/* Image-first on mobile so the user sees what the active item refers to. */
.bbcm-ta-image-wrap {
	order: -1;
	width: 100%;
	aspect-ratio: 1 / 1;
	background-color: var(--bbcm-ta-tab-bar-bg);
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.bbcm-ta-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
	.bbcm-ta-layout {
		grid-template-columns: 1fr 1fr;
		gap: 1.5rem;
		align-items: start;
	}
	/* Right (default): accordion left, image right. */
	.bbcm-ta-image-right .bbcm-ta-image-wrap {
		order: 0;
	}
	/* Left: image left, accordion right. */
	.bbcm-ta-image-left .bbcm-ta-accordion {
		order: 2;
	}
	.bbcm-ta-image-left .bbcm-ta-image-wrap {
		order: 1;
	}
	.bbcm-ta-image-wrap {
		position: sticky;
		top: 16px;
		aspect-ratio: 1 / 1;
	}
}

/* ============================================
   ACCORDION
   ============================================ */

.bbcm-ta-accordion {
	display: flex;
	flex-direction: column;
}

.bbcm-ta-item {
	border-bottom: 1px solid var(--bbcm-ta-border);
}

.bbcm-ta-item:last-child {
	border-bottom: 0;
}

.bbcm-ta-item.is-open {
	background-color: var(--bbcm-ta-item-active-bg);
}

.bbcm-ta-item-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	padding: 20px 16px;
	background-color: transparent;
	border: 0;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	color: inherit;
}

.bbcm-ta-item-header:focus-visible {
	outline: 2px solid var(--bbcm-ta-accent);
	outline-offset: -2px;
}

.bbcm-ta-item-title {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	flex: 1;
}

.bbcm-ta-item-icon {
	display: inline-flex;
	margin-left: 16px;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.bbcm-ta-item-icon svg {
	width: 20px;
	height: 20px;
	fill: var(--bbcm-ta-text);
}

.bbcm-ta-item.is-open .bbcm-ta-item-icon {
	transform: rotate(45deg);
}

.bbcm-ta-item-body {
	padding: 0 16px 20px;
	color: var(--bbcm-ta-muted);
	font-size: 0.9375rem;
}

.bbcm-ta-item-body[hidden] {
	display: none;
}

.bbcm-ta-item-content {
	margin-bottom: 12px;
}

.bbcm-ta-item-content > *:first-child { margin-top: 0; }
.bbcm-ta-item-content > *:last-child  { margin-bottom: 0; }
.bbcm-ta-item-content strong { color: var(--bbcm-ta-text); font-weight: 700; }

.bbcm-ta-item-cta-wrap {
	margin: 0;
}

/* ============================================
   LEARN MORE BUTTON
   Normal: brand bg, white text
   Hover:  brand border, transparent bg, brand text
   ============================================ */

.bbcm-ta-wrapper a.bbcm-ta-cta,
.bbcm-ta-wrapper a.bbcm-ta-cta:link,
.bbcm-ta-wrapper a.bbcm-ta-cta:visited {
	display: inline-block;
	background-color: var(--bbcm-ta-accent);
	color: var(--bbcm-ta-accent-text);
	border: 2px solid var(--bbcm-ta-accent);
	border-radius: 3px;
	padding: 8px 16px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bbcm-ta-wrapper a.bbcm-ta-cta:hover,
.bbcm-ta-wrapper a.bbcm-ta-cta:focus {
	background-color: transparent;
	color: var(--bbcm-ta-accent);
	text-decoration: none;
}

.bbcm-ta-wrapper a.bbcm-ta-cta:focus-visible {
	outline: 2px solid var(--bbcm-ta-accent);
	outline-offset: 2px;
}

/* Disabled / placeholder badge — used when an item has a label but no URL
   (e.g. "Product To Be Announced", "Coming Soon"). Visually muted so it
   reads as an info pill rather than a clickable button. */
.bbcm-ta-wrapper .bbcm-ta-cta-disabled {
	display: inline-block;
	background-color: transparent;
	color: var(--bbcm-ta-muted);
	border: 2px solid var(--bbcm-ta-border);
	border-radius: 3px;
	padding: 8px 16px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: not-allowed;
	user-select: none;
}

/* ============================================
   ACCESSIBILITY / MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	.bbcm-ta-tab,
	.bbcm-ta-item-icon,
	.bbcm-ta-image,
	.bbcm-ta-wrapper a.bbcm-ta-cta {
		transition: none;
	}
}
