<?php
/**
 * Booking Extra Fields Partial
 *
 * Renders extra field inputs for variants that have extra_field configured.
 * Called from the booking form after each variant row.
 *
 * Usage: Include this file and call render_variant_extra_input() for each variant
 * that has an extra_field property.
 *
 * @package KursBooking
 * @since   1.3.0
 */

declare(strict_types=1);

// Prevent direct access.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// This file is included from booking-form.php.
// Variables available: $kurs_id, $varianten.

// The actual rendering is done through the class method.
// This partial just ensures the CSS class is available for styling.
?>

<!-- Extra Fields Container Styles -->
<style>
/* Inline styles for extra field inputs in booking form */
.kb-extra-field-input {
	margin-top: 10px;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 6px;
	display: none; /* Hidden until parent ticket has quantity > 0 */
}

.kb-ticket-row.has-tickets .kb-extra-field-input {
	display: block;
}

.kb-extra-field-label {
	display: block;
	font-weight: 500;
	margin-bottom: 5px;
	font-size: 14px;
}

.kb-extra-field-label .kb-required {
	color: #dc3545;
	margin-left: 2px;
}

.kb-extra-quantity {
	width: 80px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	text-align: center;
}

.kb-extra-quantity:focus {
	border-color: #4a90d9;
	outline: none;
	box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.kb-extra-text {
	width: 100%;
	max-width: 300px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.kb-extra-text:focus {
	border-color: #4a90d9;
	outline: none;
	box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* Multiplier indicator */
.kb-extra-field-input[data-multiply="1"]::after {
	content: '(x Preis)';
	display: inline-block;
	margin-left: 8px;
	font-size: 12px;
	color: #666;
}
</style>
