/**
 * Advanced Product Swatches & FAQs for WooCommerce - product FAQs.
 *
 * Neutral by design: typography and color are inherited from the active theme.
 * Override the custom properties below (on .apsf-faq or any ancestor) to restyle.
 *
 * Layout: the column count adapts to the width of the container, not the viewport,
 * so it also behaves inside narrow Elementor columns or theme sidebars:
 *   two columns when each column can be at least ~17.5rem wide, otherwise one.
 */

.apsf-faq {
	--apsf-faq-border: rgba(128, 128, 128, 0.35);
	--apsf-faq-gap: 3rem;
	--apsf-faq-pad: 1.125rem;
	--apsf-faq-speed: 0.28s;
	box-sizing: border-box;
	width: 100%;
	margin: 2rem 0;
	color: inherit;
}

.apsf-faq *,
.apsf-faq *::before,
.apsf-faq *::after {
	box-sizing: border-box;
}

.apsf-faq .apsf-faq__title {
	margin: 0 0 1rem;
	padding: 0;
}

.apsf-faq .apsf-faq__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
	column-gap: var(--apsf-faq-gap);
	align-items: start;
}

/* One column requested (columns="1") or only one FAQ. */
.apsf-faq.apsf-faq--cols-1 .apsf-faq__cols {
	grid-template-columns: minmax(0, 1fr);
}

.apsf-faq .apsf-faq__col {
	min-width: 0;
}

.apsf-faq .apsf-faq__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--apsf-faq-border);
}

.apsf-faq .apsf-faq__item .apsf-faq__heading {
	margin: 0;
	padding: 0;
	border: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/* Question button: reset hostile theme button styles (hover colors, uppercase, shadows...). */
.apsf-faq .apsf-faq__item .apsf-faq__q,
.apsf-faq .apsf-faq__item .apsf-faq__q:hover,
.apsf-faq .apsf-faq__item .apsf-faq__q:focus,
.apsf-faq .apsf-faq__item .apsf-faq__q:active {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: var(--apsf-faq-pad) 0;
	border: 0;
	border-radius: 0;
	background: none !important;
	box-shadow: none !important;
	color: inherit !important;
	font: inherit;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: normal;
	text-align: left;
	text-decoration: none;
	text-transform: none;
	white-space: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.apsf-faq .apsf-faq__item .apsf-faq__q:hover .apsf-faq__q-text {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.apsf-faq .apsf-faq__item .apsf-faq__q:focus {
	outline: none;
}

.apsf-faq .apsf-faq__item .apsf-faq__q:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.apsf-faq .apsf-faq__q-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Plus / minus indicator drawn with two bars; the vertical bar collapses when open. */
.apsf-faq .apsf-faq__icon {
	position: relative;
	flex: 0 0 0.875rem;
	width: 0.875rem;
	height: 0.875rem;
}

.apsf-faq .apsf-faq__icon::before,
.apsf-faq .apsf-faq__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 2px;
	margin-top: -1px;
	border-radius: 1px;
	background: currentColor;
	transition: transform var(--apsf-faq-speed) ease;
}

.apsf-faq .apsf-faq__icon::after {
	transform: rotate(90deg);
}

.apsf-faq .apsf-faq__item.is-open .apsf-faq__icon::after {
	transform: rotate(0deg);
}

/*
 * Expand/collapse: animating the grid row from 0fr to 1fr transitions to the
 * content's natural height without measuring it in JavaScript (no layout jumps).
 * `visibility` keeps collapsed answers out of the tab order and the a11y tree.
 */
.apsf-faq .apsf-faq__a {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows var(--apsf-faq-speed) ease, visibility 0s linear var(--apsf-faq-speed);
}

.apsf-faq .apsf-faq__item.is-open > .apsf-faq__a {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows var(--apsf-faq-speed) ease, visibility 0s linear 0s;
}

.apsf-faq .apsf-faq__a-inner {
	min-height: 0;
	overflow: hidden;
}

.apsf-faq .apsf-faq__a-content {
	padding: 0 2rem var(--apsf-faq-pad) 0;
	line-height: 1.65;
}

.apsf-faq .apsf-faq__a-content > :first-child {
	margin-top: 0;
}

.apsf-faq .apsf-faq__a-content > :last-child {
	margin-bottom: 0;
}

.apsf-faq .apsf-faq__a-content p,
.apsf-faq .apsf-faq__a-content ul,
.apsf-faq .apsf-faq__a-content ol {
	margin-top: 0;
	margin-bottom: 0.75em;
}

/* Tablet: tighter spacing. */
@media (max-width: 1024px) {
	.apsf-faq {
		--apsf-faq-gap: 2rem;
	}
}

/* Mobile. */
@media (max-width: 640px) {
	.apsf-faq {
		--apsf-faq-pad: 1rem;
		margin: 1.5rem 0;
	}

	.apsf-faq .apsf-faq__a-content {
		padding-right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apsf-faq .apsf-faq__a,
	.apsf-faq .apsf-faq__item.is-open > .apsf-faq__a,
	.apsf-faq .apsf-faq__icon::before,
	.apsf-faq .apsf-faq__icon::after {
		transition: none;
	}
}
