/**
 * Webplace4u Favorietenlijsten - Frontend styles
 * Versie: 1.1.0
 *
 * Gebruikt --w4u-fav-color custom property die ingesteld wordt via wp_head
 * op basis van de admin instellingen.
 */

:root {
	--w4u-fav-color: var(--ast-global-color-0, #fead31);
	--w4u-fav-color-soft: rgba(254, 173, 49, 0.12);
}

/* Productpagina knop */
.w4u-fav-wrapper {
	margin: 1rem 0;
	position: relative;
}

/* Inline weergave naast Add-to-Cart knop */
.w4u-fav-inline-wrap {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 0.5rem;
}

.w4u-fav-inline-wrap .w4u-fav-wrapper {
	margin: 0;
	display: inline-flex;
}

.w4u-fav-inline-wrap .w4u-fav-button {
	margin: 0;
	white-space: nowrap;
}

/* Inline-variant: matcht het Add-to-Cart gedrag (zwarte tekst + icon,
   zwart-met-wit op hover). Hogere specificity zodat dit ook de theme
   en Elementor button-styling overruled binnen het cart-formulier. */
.w4u-fav-inline-wrap .w4u-fav-button,
.w4u-fav-inline-wrap .w4u-fav-button.is-active {
	color: #000;
}

.w4u-fav-inline-wrap .w4u-fav-button .w4u-fav-icon svg {
	stroke: #000;
	fill: none;
	transition: fill 0.2s ease, stroke 0.2s ease;
}

.w4u-fav-inline-wrap .w4u-fav-button.is-active .w4u-fav-icon svg {
	fill: #000;
	stroke: #000;
}

.w4u-fav-inline-wrap .w4u-fav-button:hover,
.w4u-fav-inline-wrap .w4u-fav-button:focus,
.w4u-fav-inline-wrap .w4u-fav-button.is-active:hover,
.w4u-fav-inline-wrap .w4u-fav-button.is-active:focus {
	background: #000;
	color: #fff;
	border-color: #000;
	outline: none;
}

.w4u-fav-inline-wrap .w4u-fav-button:hover .w4u-fav-icon svg,
.w4u-fav-inline-wrap .w4u-fav-button:focus .w4u-fav-icon svg {
	stroke: #fff;
	fill: none;
}

.w4u-fav-inline-wrap .w4u-fav-button.is-active:hover .w4u-fav-icon svg,
.w4u-fav-inline-wrap .w4u-fav-button.is-active:focus .w4u-fav-icon svg {
	stroke: #fff;
	fill: #fff;
}

/* Zorg dat de cart form items op één lijn staan */
form.cart {
	flex-wrap: wrap;
	align-items: center;
}

.w4u-fav-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: transparent;
	border: 1px solid #999;
	color: #555;
	padding: 0.6rem 1.1rem;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	line-height: 1.2;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.w4u-fav-button:hover,
.w4u-fav-button:focus {
	color: var(--w4u-fav-color);
	border-color: var(--w4u-fav-color);
	outline: none;
}

.w4u-fav-button.is-active {
	color: var(--w4u-fav-color);
	border-color: var(--w4u-fav-color);
	background: var(--w4u-fav-color-soft);
}

.w4u-fav-button.is-active .w4u-fav-icon svg {
	fill: var(--w4u-fav-color);
	stroke: var(--w4u-fav-color);
}

.w4u-fav-icon {
	display: inline-flex;
	align-items: center;
}

.w4u-fav-icon svg {
	transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Popup
   We gebruiken hoge specificiteit (.w4u-fav-popup-inner button.X) om
   theme-button-styling (Astra/Hello/Storefront/Elementor) te overschrijven
   zonder !important. */
.w4u-fav-popup {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 1rem;
}

.w4u-fav-popup[hidden] { display: none; }

.w4u-fav-popup-inner {
	background: #fff;
	border-radius: 8px;
	max-width: 440px;
	width: 100%;
	padding: 1.75rem 1.75rem 1.5rem;
	position: relative;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	max-height: 85vh;
	overflow-y: auto;
	box-sizing: border-box;
}

.w4u-fav-popup-title {
	margin: 0 0 1.25rem;
	padding-right: 2rem;
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.3;
	color: #1a1a1a;
}

/* Sluitknop: theme overrides resetten */
.w4u-fav-popup-inner button.w4u-fav-popup-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	background: transparent;
	border: none;
	border-radius: 50%;
	font-size: 1.4rem;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	color: #888;
	padding: 0;
	margin: 0;
	box-shadow: none;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease;
}

.w4u-fav-popup-inner button.w4u-fav-popup-close:hover,
.w4u-fav-popup-inner button.w4u-fav-popup-close:focus {
	background: #f0f0f0;
	color: #000;
	outline: none;
}

.w4u-fav-popup-content {
	min-height: 60px;
}

.w4u-fav-loader {
	color: #888;
	font-style: italic;
	text-align: center;
	padding: 1rem;
}

/* Lijsten in popup */
.w4u-fav-popup-lijsten {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
	overflow: hidden;
}

.w4u-fav-popup-lijst-item {
	display: flex;
	align-items: stretch;
	gap: 0;
	padding: 0;
	border-bottom: 1px solid #eee;
	background: #fff;
	transition: background 0.15s ease;
}

.w4u-fav-popup-lijst-item:last-child { border-bottom: none; }
.w4u-fav-popup-lijst-item:hover { background: #fafafa; }

/* Lijst-knop: reset theme button styling volledig */
.w4u-fav-popup-inner button.w4u-fav-popup-lijst-knop {
	flex: 1;
	text-align: left;
	background: transparent;
	border: none;
	border-radius: 0;
	cursor: pointer;
	padding: 0.85rem 1rem;
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.3;
	color: #2a2a2a;
	box-shadow: none;
	min-height: 0;
	width: auto;
	letter-spacing: 0;
	text-transform: none;
	transition: color 0.15s ease;
}

.w4u-fav-popup-inner button.w4u-fav-popup-lijst-knop:hover,
.w4u-fav-popup-inner button.w4u-fav-popup-lijst-knop:focus {
	background: transparent;
	color: var(--w4u-fav-color);
	outline: none;
}

.w4u-fav-popup-lijst-status {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	color: var(--w4u-fav-color);
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0 1rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.w4u-fav-popup-nieuwe {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #eee;
	align-items: stretch;
}

.w4u-fav-popup-inner input.w4u-fav-popup-nieuwe-naam {
	flex: 1;
	min-width: 0;
	padding: 0 0.75rem;
	height: 42px;
	line-height: 42px;
	border: 1px solid #d4d4d4;
	border-radius: 6px;
	font-size: 0.95rem;
	background: #fff;
	color: #1a1a1a;
	box-sizing: border-box;
	box-shadow: none;
	margin: 0;
	transition: border-color 0.15s ease;
}

.w4u-fav-popup-inner input.w4u-fav-popup-nieuwe-naam:focus {
	border-color: var(--w4u-fav-color);
	outline: none;
	box-shadow: 0 0 0 3px var(--w4u-fav-color-soft);
}

/* Toevoegen-knop: reset theme styling, accent met huiskleur, zwarte tekst */
.w4u-fav-popup-inner button.w4u-fav-popup-nieuwe-submit {
	flex-shrink: 0;
	height: 42px;
	min-height: 42px;
	padding: 0 1.1rem;
	margin: 0;
	background: var(--w4u-fav-color);
	color: #000;
	border: none;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	letter-spacing: 0;
	text-transform: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.w4u-fav-popup-inner button.w4u-fav-popup-nieuwe-submit:hover,
.w4u-fav-popup-inner button.w4u-fav-popup-nieuwe-submit:focus {
	background: #000;
	color: #fff;
	filter: none;
	outline: none;
}

/* Subtitel boven het "Nieuwe lijst aanmaken" gedeelte */
.w4u-fav-popup-nieuwe-section {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid #eee;
}

.w4u-fav-popup-subtitle {
	margin: 0 0 0.75rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.3;
}

/* De .w4u-fav-popup-nieuwe binnen een section heeft geen eigen border meer */
.w4u-fav-popup-nieuwe-section .w4u-fav-popup-nieuwe {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

/* Lege staat info-tekst */
.w4u-fav-popup-leeg-info {
	margin: 0 0 0.5rem;
	color: #555;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Login-modal staat */
.w4u-fav-login-state {
	text-align: center;
	padding: 0.5rem 0 0.25rem;
}

.w4u-fav-login-tekst {
	margin: 0 0 1.25rem;
	color: #444;
	font-size: 0.95rem;
	line-height: 1.55;
}

.w4u-fav-popup-inner button.w4u-fav-login-knop {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	min-height: 44px;
	padding: 0 1.5rem;
	margin: 0;
	background: var(--w4u-fav-color);
	color: #000;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.w4u-fav-popup-inner button.w4u-fav-login-knop:hover,
.w4u-fav-popup-inner button.w4u-fav-login-knop:focus {
	background: #000;
	color: #fff;
	outline: none;
}

.w4u-fav-popup-max-bereikt {
	color: #999;
	font-style: italic;
	font-size: 0.9rem;
	padding: 0.75rem 0 0;
	margin-top: 1rem;
	border-top: 1px solid #eee;
	text-align: center;
}

/* Lege staat tekst boven het invulveld */
.w4u-fav-popup-content > p:first-child {
	margin: 0 0 1rem;
	color: #555;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* My Account menu icon voor Bestellijsten/Favorieten endpoint.
   Veel themes gebruiken ::before met een icon-font of SVG mask. We voegen
   hier een neutraal lijst-icon toe via een SVG mask zodat het de currentColor
   van het menu-item overneemt en past bij de andere icons. */
.woocommerce-MyAccount-navigation-link--favorieten a::before {
	content: "";
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.5em;
	vertical-align: -0.2em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6h13'/><path d='M8 12h13'/><path d='M8 18h13'/><path d='M3 6h.01'/><path d='M3 12h.01'/><path d='M3 18h.01'/></svg>") no-repeat center / contain;
	        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6h13'/><path d='M8 12h13'/><path d='M8 18h13'/><path d='M3 6h.01'/><path d='M3 12h.01'/><path d='M3 18h.01'/></svg>") no-repeat center / contain;
	flex-shrink: 0;
}

/* Voor themes die de icon via een ::before op het <li> zetten i.p.v. de <a> */
.woocommerce-MyAccount-navigation-link--favorieten::before {
	content: none;
}

/* My Account */
.w4u-fav-account-intro {
	background: #f7f5f0;
	border-left: 4px solid var(--w4u-fav-color);
	padding: 1rem;
	margin-bottom: 1.5rem;
}

.w4u-fav-account-lijsten-bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #eee;
}

.w4u-fav-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	flex: 1;
	min-width: 200px;
}

.w4u-fav-tab {
	display: inline-block;
	padding: 0.5rem 1rem;
	background: #f3f3f3;
	color: #444;
	text-decoration: none;
	border-radius: 4px 4px 0 0;
	border: 1px solid transparent;
	font-size: 0.95rem;
	transition: background 0.2s ease;
}

.w4u-fav-tab:hover { background: #eaeaea; color: #000; }

.w4u-fav-tab.is-active {
	background: #fff;
	border-color: #ddd;
	border-bottom-color: #fff;
	color: #000;
	font-weight: 600;
}

.w4u-fav-max-bereikt {
	color: #888;
	font-style: italic;
	font-size: 0.9rem;
}

.w4u-fav-nieuwe-lijst-form {
	background: #f7f7f7;
	padding: 1rem;
	border-radius: 4px;
	margin-bottom: 1rem;
}

.w4u-fav-nieuwe-lijst-form[hidden] { display: none; }

.w4u-fav-nieuwe-lijst-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.w4u-fav-form-row {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.w4u-fav-form-row input[type="text"] {
	flex: 1;
	min-width: 200px;
	padding: 0.5rem;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.w4u-fav-lijst-detail { margin-top: 1rem; }

.w4u-fav-lijst-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.w4u-fav-lijst-naam { margin: 0; }

.w4u-fav-lijst-acties {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.w4u-fav-lege-lijst {
	background: #f7f5f0;
	padding: 1.25rem;
	border-radius: 4px;
	color: #666;
	font-style: italic;
}

.w4u-fav-items-tabel {
	width: 100%;
	margin-bottom: 1rem;
}

.w4u-fav-items-tabel th,
.w4u-fav-items-tabel td { vertical-align: middle; }

.w4u-fav-product-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
}

.w4u-fav-product-link img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #eee;
	flex-shrink: 0;
}

.w4u-fav-product-naam { font-weight: 500; }

.w4u-fav-hoeveelheid {
	width: 70px;
	padding: 0.4rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-align: center;
}

.w4u-fav-verwijder-item {
	background: none;
	border: none;
	color: #999;
	cursor: pointer;
	padding: 0.4rem;
	border-radius: 4px;
	transition: color 0.2s ease, background 0.2s ease;
}

.w4u-fav-verwijder-item:hover {
	color: var(--w4u-fav-color);
	background: var(--w4u-fav-color-soft);
}

.w4u-fav-lijst-footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding-top: 1rem;
	border-top: 1px solid #eee;
}

/* Product toevoegen vanuit account */
.w4u-fav-product-toevoegen-sectie {
	margin-bottom: 1rem;
}

.w4u-fav-product-zoek-form {
	background: #f7f7f7;
	padding: 1rem;
	border-radius: 4px;
	margin-top: 0.5rem;
}

.w4u-fav-product-zoek-form[hidden] { display: none; }

.w4u-fav-zoek-row {
	display: flex;
	gap: 0.5rem;
}

.w4u-fav-zoek-input {
	flex: 1;
	padding: 0.5rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.95rem;
}

.w4u-fav-zoek-resultaten {
	margin-top: 0.75rem;
}

.w4u-fav-zoek-lijst {
	list-style: none;
	margin: 0;
	padding: 0;
}

.w4u-fav-zoek-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid #eee;
}

.w4u-fav-zoek-item:last-child { border-bottom: none; }

.w4u-fav-zoek-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #eee;
	flex-shrink: 0;
}

.w4u-fav-zoek-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.w4u-fav-zoek-naam {
	font-weight: 500;
	font-size: 0.95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.w4u-fav-zoek-prijs {
	color: #666;
	font-size: 0.85rem;
}

.w4u-fav-zoek-toevoegen {
	flex-shrink: 0;
	font-size: 1.1rem;
	line-height: 1;
	padding: 0.4rem 0.75rem;
}

.w4u-fav-geen-resultaten {
	color: #888;
	font-style: italic;
	margin: 0;
	padding: 0.5rem 0;
}

/* Toast */
.w4u-fav-toast {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	background: #2d2d2d;
	color: #fff;
	padding: 1rem 1.25rem;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	z-index: 100000;
	max-width: 360px;
	animation: w4uFavToastIn 0.3s ease;
}

.w4u-fav-toast.is-success { background: #1e5631; }
.w4u-fav-toast.is-error { background: #a02020; }

@keyframes w4uFavToastIn {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
	.w4u-fav-account-lijsten-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.w4u-fav-tabs { justify-content: flex-start; }
	.w4u-fav-product-link img { width: 48px; height: 48px; }
	.w4u-fav-toast {
		bottom: 1rem;
		right: 1rem;
		left: 1rem;
		max-width: none;
	}
}
