/*
 * WooCommerce Product FAQs – Frontend Stijlen v1.1.0
 * ====================================================
 * Kleuren worden vanuit PHP als inline :root-variabelen geïnjecteerd.
 * Overschrijf de fallback-waarden in je child-theme indien nodig.
 */

/* ── Standaard CSS-variabelen (fallback als PHP niet beschikbaar is) ──────── */
:root {
	--wcpfaq-accent:      #2563eb;
	--wcpfaq-bg:          #f8fafc;
	--wcpfaq-bg-hover:    #f1f5f9;
	--wcpfaq-bg-open:     #eff6ff;
	--wcpfaq-text-q:      #1e293b;
	--wcpfaq-text-a:      #475569;
	--wcpfaq-border:      #e2e8f0;
	--wcpfaq-radius:      6px;
	--wcpfaq-transition:  0.26s ease;
}

/* ── Gedeeld ──────────────────────────────────────────────────────────────── */
.wcpfaq-title {
	font-size: 1.35em;
	margin: 0 0 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCORDION STIJL
   ═══════════════════════════════════════════════════════════════════════════ */

.wcpfaq-accordion {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 8px;
}

/* Item */
.wcpfaq-item {
	border: 1px solid var(--wcpfaq-border);
	border-radius: var(--wcpfaq-radius);
	overflow: hidden;
	transition: box-shadow var(--wcpfaq-transition);
}

.wcpfaq-item:hover {
	box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

/* Vraag-knop */
.wcpfaq-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 15px 18px;
	background: var(--wcpfaq-bg);
	border: none;
	cursor: pointer;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	color: var(--wcpfaq-text-q);
	transition: background var(--wcpfaq-transition), color var(--wcpfaq-transition);
}

.wcpfaq-question:hover       { background: var(--wcpfaq-bg-hover); }
.wcpfaq-question:focus-visible {
	outline: 2px solid var(--wcpfaq-accent);
	outline-offset: -2px;
}

.wcpfaq-item.wcpfaq-open > .wcpfaq-question {
	background: var(--wcpfaq-bg-open);
	color: var(--wcpfaq-accent);
}

.wcpfaq-question-text { flex: 1; }

/* ── Icoon: Plus/Min (standaard) ─────────────────────────────────────────── */
.wcpfaq-icon {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

/* Alleen tonen bij plus-stijl */
.wcpfaq-icon-plus .wcpfaq-icon::before,
.wcpfaq-icon-plus .wcpfaq-icon::after {
	content: '';
	position: absolute;
	background: currentColor;
	border-radius: 2px;
	transition: transform var(--wcpfaq-transition), opacity var(--wcpfaq-transition);
}

.wcpfaq-icon-plus .wcpfaq-icon::before { /* horizontaal */
	width: 18px; height: 2px; top: 8px; left: 0;
}
.wcpfaq-icon-plus .wcpfaq-icon::after { /* verticaal */
	width: 2px; height: 18px; top: 0; left: 8px;
}
.wcpfaq-icon-plus .wcpfaq-item.wcpfaq-open .wcpfaq-icon::after {
	transform: rotate(90deg);
	opacity: 0;
}

/* ── Icoon: Chevron ──────────────────────────────────────────────────────── */
.wcpfaq-icon-chevron .wcpfaq-icon::before {
	content: '';
	position: absolute;
	width: 10px;
	height: 10px;
	top: 2px;
	left: 4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform var(--wcpfaq-transition);
}
.wcpfaq-icon-chevron .wcpfaq-item.wcpfaq-open .wcpfaq-icon::before {
	transform: rotate(-135deg);
	top: 6px;
}

/* Antwoord – max-height animatie */
.wcpfaq-answer {
	overflow: hidden;
	max-height: 0;
	transition: max-height var(--wcpfaq-transition);
}

.wcpfaq-answer[hidden] {
	display: block !important;
	visibility: hidden;
	max-height: 0;
}

.wcpfaq-answer:not([hidden]) {
	max-height: 4000px;
	visibility: visible;
}

.wcpfaq-answer-inner {
	padding: 16px 18px 18px;
	color: var(--wcpfaq-text-a);
	line-height: 1.7;
	border-top: 1px solid var(--wcpfaq-border);
}
.wcpfaq-answer-inner p:first-child { margin-top: 0; }
.wcpfaq-answer-inner p:last-child  { margin-bottom: 0; }
.wcpfaq-answer-inner a             { color: var(--wcpfaq-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS STIJL
   ═══════════════════════════════════════════════════════════════════════════ */

.wcpfaq-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 8px;
}

.wcpfaq-card {
	border: 1px solid var(--wcpfaq-border);
	border-left: 4px solid var(--wcpfaq-accent);
	border-radius: var(--wcpfaq-radius);
	overflow: hidden;
	transition: box-shadow var(--wcpfaq-transition);
}

.wcpfaq-card:hover {
	box-shadow: 0 3px 12px rgba(0,0,0,.08);
}

.wcpfaq-card-question {
	padding: 14px 18px 12px;
	background: var(--wcpfaq-bg-open);
	color: var(--wcpfaq-accent);
	font-weight: 700;
	font-size: 1em;
	line-height: 1.4;
}

.wcpfaq-card-answer {
	padding: 14px 18px 16px;
	color: var(--wcpfaq-text-a);
	line-height: 1.7;
	border-top: 1px solid var(--wcpfaq-border);
}
.wcpfaq-card-answer p:first-child { margin-top: 0; }
.wcpfaq-card-answer p:last-child  { margin-bottom: 0; }
.wcpfaq-card-answer a             { color: var(--wcpfaq-accent); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.wcpfaq-question,
	.wcpfaq-card-question  { padding: 13px 14px; font-size: .95em; }
	.wcpfaq-answer-inner,
	.wcpfaq-card-answer    { padding: 13px 14px 15px; }
}
