/* ==========================================================================
   Banierhuis — Single Product variation swatches
   Scope: single product page only (assets enqueued only on is_product()).

   FIX (Elementor layout conflict): every rule below is now scoped under
   the unique wrapper ".bvs-variable-product-form" (see variable.php). No
   selector here is a bare/generic one (.product, .woocommerce, .cart,
   form, table, .single_add_to_cart_button, etc.) — even native WooCommerce
   classes we rely on for functionality (.woocommerce-variation-add-to-cart,
   .quantity, .single_add_to_cart_button) are always qualified with the
   .bvs-variable-product-form ancestor, so nothing here can affect markup
   outside this one wrapper — including Elementor's own containers/columns.
   No width, max-width, position, float, or container-level display/flex/
   grid rules are applied to anything outside .bvs-variable-product-form's
   own descendants.
   ========================================================================== */

/* Hide the native <table class="variations"> visually while keeping it
   fully functional for WooCommerce's own variation JS (reads .val() off
   the real <select> elements regardless of visibility). */
.bvs-variable-product-form .bvs-native-variations {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.bvs-variable-product-form .bvs-single-variation-wrap {
	margin-bottom: 20px;
}

.bvs-variable-product-form .bvs-variations-wrapper {
	margin-top: 4px;
}

.bvs-variable-product-form .bvs-attribute-group {
	margin-bottom: 18px;
}

.bvs-variable-product-form .bvs-attribute-group:last-of-type {
	margin-bottom: 8px;
}

.bvs-variable-product-form .bvs-attribute-label {
	font-weight: 700;
	color: #1b3a5c; /* matches the navy label colour in the reference */
	margin-bottom: 8px;
	font-size: 14px;
	text-transform: none;
}

.bvs-variable-product-form .bvs-swatch-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* ---- Text attribute cards ---------------------------------------------- */

.bvs-variable-product-form .bvs-attribute-group--text .bvs-swatch {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	min-width: 110px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid #e3ddd2;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.3;
	color: #1b3a5c;
	text-align: left;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bvs-variable-product-form .bvs-attribute-group--text .bvs-swatch:hover {
	border-color: #e8791a;
}

.bvs-variable-product-form .bvs-attribute-group--text .bvs-swatch.bvs-selected,
.bvs-variable-product-form .bvs-attribute-group--text .bvs-swatch[aria-pressed="true"] {
	border: 2px solid #e8791a;
	box-shadow: 0 0 0 1px rgba(232, 121, 26, 0.15);
	padding: 9px 15px;
}

.bvs-variable-product-form .bvs-swatch-card-label {
	font-weight: 600;
}

/* Optional secondary line, e.g. "400 Wh / tot 60 km" — supported if you
   pass a two-line label through the woocommerce_variation_option_name
   filter using a <br> or <small>; the layout below already accommodates it. */
.bvs-variable-product-form .bvs-swatch-card-label small,
.bvs-variable-product-form .bvs-swatch-card-label .bvs-swatch-sub {
	display: block;
	font-weight: 400;
	color: #8a8378;
	font-size: 12px;
	margin-top: 2px;
}

/* ---- Color swatches ------------------------------------------------------ */

.bvs-variable-product-form .bvs-attribute-group--color .bvs-swatch {
	background: transparent;
	border: none;
	padding: 3px;
	cursor: pointer;
	border-radius: 50%;
	line-height: 0;
}

.bvs-variable-product-form .bvs-swatch-color {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.bvs-variable-product-form .bvs-attribute-group--color .bvs-swatch.bvs-selected {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e8791a;
}

/* ---- Disabled / unavailable state (optional, if you wire it up) -------- */

.bvs-variable-product-form .bvs-swatch.bvs-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ---- Reset / Clear link -------------------------------------------------- */

.bvs-variable-product-form .bvs-reset-variations {
	display: inline-block;
	margin-top: 4px;
	font-size: 13px;
	color: #8a8378;
}

@media (max-width: 480px) {
	.bvs-variable-product-form .bvs-attribute-group--text .bvs-swatch {
		min-width: 90px;
		padding: 9px 12px;
	}
}

/* ==========================================================================
   Add to Cart + Proefrit row (inside .single_variation_wrap, above swatches)
   ========================================================================== */

/* Quantity input stays in the DOM (so its value="1" still posts with the
   form) but is not shown — per spec, quantity is fixed at 1 and not user
   editable. Scoped under .bvs-variable-product-form so this cannot hide a
   quantity field belonging to any other form on the page. */
.bvs-variable-product-form .woocommerce-variation-add-to-cart .quantity {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Wrapper injected by JS (bvs-cart-actions) around the real Add to Cart
   button + the new Proefrit link, so they sit side by side. This is an
   inline flex row scoped to our own wrapper's contents only — it does not
   affect any ancestor/Elementor container. */
.bvs-variable-product-form .bvs-cart-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: stretch;
	margin: 4px 0 6px;
}

.bvs-variable-product-form .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.bvs-variable-product-form .bvs-cart-actions .bvs-proefrit-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 24px;
	border-radius: 3px;
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
}

.bvs-variable-product-form .woocommerce-variation-add-to-cart .single_add_to_cart_button {
	background: #e8791a;
	border: 1px solid #e8791a;
	color: #1b3a5c;
	flex: 1 1 auto;
}

.bvs-variable-product-form .woocommerce-variation-add-to-cart .single_add_to_cart_button:hover {
	background: #d76c10;
	color: #1b3a5c;
}

.bvs-variable-product-form .bvs-cart-icon {
	width: 20px;
	height: 20px;
	display: inline-block;
	flex: 0 0 auto;
}

.bvs-variable-product-form .bvs-proefrit-button {
	background: #fff;
	border: 1px solid #1b3a5c;
	color: #1b3a5c;
	flex: 1 1 auto;
}

.bvs-variable-product-form .bvs-proefrit-button:hover {
	background: #f4efe6;
	color: #1b3a5c;
}

@media (max-width: 480px) {
	.bvs-variable-product-form .bvs-cart-actions {
		flex-direction: column;
	}
}
