/* ==========================================================================
   GEMTech FAQs Widget
   ========================================================================== */

/* Grid container — columns/gap values come from Elementor responsive controls */
.gemtech-faqs {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
}

/* Individual item */
.gemtech-faqs__item {
	/* Background, border, shadow via Elementor controls */
}

/* ==========================================================================
   Non-accordion layout
   ========================================================================== */

.gemtech-faqs__question {
	/* Reset UA heading margins so Elementor spacing controls are authoritative */
	margin-top: 0;
	margin-bottom: 0.5em;
}

.gemtech-faqs__answer > *:first-child { margin-top: 0; }
.gemtech-faqs__answer > *:last-child  { margin-bottom: 0; }

/* Divider between non-accordion items */
.gemtech-faqs--divider .gemtech-faqs__item:not(:last-child) {
	border-bottom: 1px solid #e2e8f0;
}

/* ==========================================================================
   Accordion layout
   ========================================================================== */

/* Reset the question heading element — it is purely structural in accordion mode */
.gemtech-faqs__question-heading {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

/* Toggle button — strip all browser chrome, fill the heading */
.gemtech-faqs__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	padding: 0;
	color: inherit;
	font: inherit;
	line-height: inherit;
	transition: color 0.2s ease, background-color 0.2s ease;
}

/* Visible focus ring for keyboard users (suppressed on mouse click by :focus-visible) */
.gemtech-faqs__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.gemtech-faqs__question-text {
	flex: 1;
}

/* Panel — hidden via CSS grid row trick (smooth native animation, no JS height calc) */
.gemtech-faqs--accordion .gemtech-faqs__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.35s ease;
}

/* Inner wrapper provides the overflow clip needed for 0fr collapse */
.gemtech-faqs--accordion .gemtech-faqs__panel > .gemtech-faqs__answer {
	min-height: 0;
	overflow: hidden;
}

.gemtech-faqs--accordion .gemtech-faqs__panel.is-open {
	grid-template-rows: 1fr;
}

/* ==========================================================================
   Toggle icon
   ========================================================================== */

.gemtech-faqs__icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	/* Width/height set via Elementor icon_size control; fallback below */
	width: 16px;
	height: 16px;
	color: inherit;
}

/* ── Plus / Minus ────────────────────────────────────────────────────────── */

.gemtech-faqs--icon-plus .gemtech-faqs__icon::before,
.gemtech-faqs--icon-plus .gemtech-faqs__icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	border-radius: 1px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Horizontal bar */
.gemtech-faqs--icon-plus .gemtech-faqs__icon::before {
	width: 100%;
	height: 2px;
	transform: translate(-50%, -50%);
}

/* Vertical bar — fades out and rotates when open (creates minus) */
.gemtech-faqs--icon-plus .gemtech-faqs__icon::after {
	width: 2px;
	height: 100%;
	transform: translate(-50%, -50%);
}

.gemtech-faqs--icon-plus .gemtech-faqs__toggle[aria-expanded="true"] .gemtech-faqs__icon::after {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(90deg);
}

/* ── Chevron ─────────────────────────────────────────────────────────────── */

.gemtech-faqs--icon-chevron .gemtech-faqs__icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translate(-60%, -70%) rotate(45deg);
	transition: transform 0.3s ease;
}

.gemtech-faqs--icon-chevron .gemtech-faqs__toggle[aria-expanded="true"] .gemtech-faqs__icon::before {
	transform: translate(-60%, -30%) rotate(-135deg);
}
