/**
 * Dietary Options Panel
 * Styles for the "Gasten met speciale dieetwensen?" panel on the
 * single product page.
 */

/* =========================================================
   Form element reorder
   The WooCommerce add-to-cart form renders:
     1. [woocommerce_before_add_to_cart_button] → .kls-dietary-panel
     2. .quantity wrapper (qty stepper)
     3. button.single_add_to_cart_button
     4. [woocommerce_after_add_to_cart_button] → "Bekijk winkelwagen" link
   We use flexbox order to display qty BEFORE the dietary panel.
   ========================================================= */

.single-product form.cart {
	display: flex;
	flex-direction: column;
}

.single-product form.cart .quantity {
	order: 1;
}

.single-product form.cart .kls-dietary-panel {
	order: 2;
}

.single-product form.cart .single_add_to_cart_button {
	order: 3;
}

.single-product form.cart a.wc-forward,
.single-product form.cart .product-in-cart ~ a,
.product-in-cart form.cart a.theme-button-secundary {
	order: 4;
}

/* =========================================================
   Panel wrapper
   ========================================================= */

.kls-dietary-panel {
	margin-top: 16px;
	margin-bottom: 8px;
	font-size: 14px;
}

.kls-dietary-panel__heading {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #00C4A7;
	color: inherit;
}

/* =========================================================
   "Aantal personen" label (above the qty stepper)
   ========================================================= */

.kls-dietary-qty-label {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 6px;
}

/* =========================================================
   Option rows
   ========================================================= */

.kls-dietary-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #00C4A7;
}

.kls-dietary-row__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.kls-dietary-row__label {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
}

.kls-dietary-row__price {
	font-size: 13px;
	color: #555;
}

.kls-dietary-row__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* =========================================================
   "Voeg toe" button
   Height matches WooCommerce qty stepper buttons (~32px)
   ========================================================= */

.kls-dietary-add-btn {
	background-color: #00C4A7;
	color: #ffffff;
	border: none;
	border-radius: 50px;
	padding: 0 16px;
	height: 32px;
	line-height: 32px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease;
	display: inline-flex;
	align-items: center;
}

.kls-dietary-add-btn:hover,
.kls-dietary-add-btn:focus-visible {
	background-color: #00a88f;
	outline: none;
}

/* =========================================================
   Counter  (− N +)
   Same height as "Voeg toe" button
   ========================================================= */

.kls-dietary-counter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background-color: #00C4A7;
	border-radius: 50px;
	padding: 0 10px;
	height: 32px;
}

/* Ensure [hidden] always wins, even when display is set explicitly on the element */
.kls-dietary-add-btn[hidden],
.kls-dietary-counter[hidden] {
	display: none !important;
}

.kls-dietary-minus,
.kls-dietary-plus {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
	display: flex;
	align-items: center;
}

.kls-dietary-minus:hover,
.kls-dietary-plus:hover {
	opacity: 0.75;
}

.kls-dietary-count {
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	min-width: 18px;
	text-align: center;
}

/* =========================================================
   "?" tooltip
   ========================================================= */

.kls-tooltip-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.kls-tooltip-trigger {
	background: none;
	border: 1px solid #aaa;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	font-size: 11px;
	color: #777;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kls-tooltip-trigger:hover,
.kls-tooltip-trigger:focus-visible {
	border-color: #00C4A7;
	color: #00C4A7;
	outline: none;
}

.kls-tooltip {
	display: none;
	position: absolute;
	right: 0;
	bottom: calc( 100% + 6px );
	background: #333;
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	padding: 8px 12px;
	border-radius: 6px;
	min-width: 180px;
	max-width: 240px;
	white-space: normal;
	z-index: 100;
	pointer-events: none;
}

/* Show tooltip on hover or keyboard focus */
.kls-tooltip-wrap:hover .kls-tooltip,
.kls-tooltip-wrap:focus-within .kls-tooltip {
	display: block;
}

/* =========================================================
   "Anders nl." free-text field
   ========================================================= */

.kls-dietary-anders {
	padding: 12px 0 8px;
	border-bottom: 1px solid #00C4A7;
}

.kls-dietary-anders__label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
}

.kls-dietary-anders__input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background: #fff;
	box-sizing: border-box;
}

.kls-dietary-anders__input:focus {
	border-color: #00C4A7;
	outline: none;
	box-shadow: 0 0 0 2px rgba( 0, 196, 167, 0.2 );
}

/* =========================================================
   Totaal row
   ========================================================= */

.kls-dietary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0 4px;
	font-size: 15px;
}

.kls-dietary-total__label {
	font-weight: 700;
}

.kls-dietary-total__price {
	font-weight: 700;
	font-size: 15px;
}

/* =========================================================
   Add-to-cart button override (teal when panel is present)
   ========================================================= */

.kls-dietary-panel ~ button[type="submit"].single_add_to_cart_button,
.kls-dietary-panel ~ .single_add_to_cart_button {
	background-color: #00C4A7 !important;
	border-color: #00C4A7 !important;
	color: #ffffff !important;
	border-radius: 50px !important;
	width: 100%;
	margin-top: 12px;
}

.kls-dietary-panel ~ button[type="submit"].single_add_to_cart_button:hover,
.kls-dietary-panel ~ .single_add_to_cart_button:hover {
	background-color: #00a88f !important;
	border-color: #00a88f !important;
}

/* =========================================================
   "Bekijk winkelwagen" button — full width + rounded
   ========================================================= */

.product-in-cart form.cart a.theme-button-secundary,
form.cart a.wc-forward.theme-button-secundary {
	width: 100% !important;
	font-size: 14px !important;
	border-radius: 50px !important;
	text-align: center !important;
	box-sizing: border-box !important;
	margin-top: 8px;
}
