/**
 * BD Woo Product Card — Description accordion.
 *
 * Collapsible sections for the single product Description tab. Uses the
 * product's category accent (--bd-accent, set inline on .single-product
 * div.product) with a sensible blue fallback.
 */

.bd-acc {
	--bd-acc-accent: var( --bd-accent, #ec4899 );
	--bd-acc-ink: #1f2933;
	--bd-acc-border: #e2e6ea;
	--bd-acc-head-bg: #f7f9fb;
	/* Open + hover/focus header: accent fill with white text (always readable). */
	--bd-acc-open-bg: var( --bd-accent, #ec4899 );
	--bd-acc-open-text: #ffffff;
	--bd-acc-radius: 8px;

	margin: 0 0 1.5em;
	color: var( --bd-acc-ink );
}

.bd-acc__intro {
	margin: 0 0 1.4em;
	line-height: 1.7;
}

.bd-acc__intro > :last-child {
	margin-bottom: 0;
}

/* Reset the heading wrapper so themes don't impose their own h3 styling. */
.bd-acc__heading {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.bd-acc__item {
	border: 1px solid var( --bd-acc-border );
	border-radius: var( --bd-acc-radius );
	margin-bottom: 12px;
	background: #fff;
	overflow: hidden;
}

.bd-acc__item:last-child {
	margin-bottom: 0;
}

/* Header button */
.bd-acc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 16px 20px;
	border: 0;
	background: var( --bd-acc-head-bg );
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	color: var( --bd-acc-ink );
	transition: background-color 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

/*
 * Active states — hover, focus, and open. Accent fill with white text, defined
 * with enough specificity to override a theme's generic button :hover/:focus
 * styles (which were forcing white text onto the near-white header, making the
 * label invisible). The chevron uses currentColor, so it follows the text.
 */
.bd-acc .bd-acc__head:hover,
.bd-acc .bd-acc__head:focus,
.bd-acc .bd-acc__head:active,
.bd-acc .bd-acc__item.is-open > .bd-acc__heading > .bd-acc__head {
	background: var( --bd-acc-open-bg );
	color: var( --bd-acc-open-text );
}

/* Keyboard focus ring, visible on the accent fill. */
.bd-acc .bd-acc__head:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: -4px;
}

.bd-acc__title {
	flex: 1 1 auto;
}

/* Chevron */
.bd-acc__icon {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	position: relative;
	transition: transform 0.25s ease;
}

.bd-acc__icon::before,
.bd-acc__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 8px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

.bd-acc__icon::before {
	left: 0;
	transform: translateY(-50%) rotate(45deg);
}

.bd-acc__icon::after {
	right: 0;
	transform: translateY(-50%) rotate(-45deg);
}

.bd-acc__item.is-open > .bd-acc__heading > .bd-acc__head .bd-acc__icon {
	transform: rotate(180deg);
}

/* Panel. Base (no-JS) state: fully visible and readable. */
.bd-acc__content {
	padding: 18px 20px 20px;
	line-height: 1.7;
}

.bd-acc__content > :first-child {
	margin-top: 0;
}

.bd-acc__content > :last-child {
	margin-bottom: 0;
}

/*
 * Enhanced state (JS on): collapse closed panels, animate height via
 * grid-template-rows. Padding moves to the open state so the 0fr collapse
 * doesn't leave a sliver of vertical padding behind.
 */
.bd-acc.is-enhanced .bd-acc__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s ease;
}

.bd-acc.is-enhanced .bd-acc__item.is-open > .bd-acc__panel {
	grid-template-rows: 1fr;
}

.bd-acc.is-enhanced .bd-acc__content {
	overflow: hidden;
	min-height: 0;
	padding: 0 20px;
}

.bd-acc.is-enhanced .bd-acc__item.is-open > .bd-acc__panel > .bd-acc__content {
	padding: 18px 20px 20px;
}

/* Respect reduced-motion preferences. */
@media ( prefers-reduced-motion: reduce ) {
	.bd-acc__panel,
	.bd-acc__icon,
	.bd-acc__head {
		transition: none;
	}
}
