/* HD Southern Stables – frontend fields.
   System font stack only (no external fonts). */

.hd-swcss-fields {
	margin: 0 0 1.25em;
}

/* Two-column layout (enabled by JS once the cart button is relocated).
   Single column by default → mobile-first / responsive. */
@media ( min-width: 768px ) {
	.hd-swcss-fields--twocol {
		display: grid;
		/* Left column shrinks to the calendar's intrinsic width; the right
		   column takes the remaining space. */
		grid-template-columns: min-content 1fr;
		column-gap: 2.5em;
		align-items: start;
	}
	.hd-swcss-fields--twocol .hd-swcss-col--dates {
		grid-column: 1;
		min-width: 0;
	}
	.hd-swcss-fields--twocol .hd-swcss-col--meta {
		grid-column: 2;
		min-width: 0;
	}
}

/* Keep the left-column texts (label, hint, chips) within the calendar width
   so nothing sticks out beyond the calendar. */
.hd-swcss-col--dates .hd-swcss-hint,
.hd-swcss-col--dates > label,
.hd-swcss-col--dates .hd-swcss-selected {
	max-width: 100%;
	overflow-wrap: break-word;
}

/* Spacing for the relocated quantity / add-to-cart button in the right column. */
.hd-swcss-col--meta .quantity {
	margin: 0.5em 0;
}

/* Align inputs and the add-to-cart button to the same (full column) width
   so their left and right edges line up. */
.hd-swcss-col--meta .input-text,
.hd-swcss-col--meta textarea,
.hd-swcss-col--meta select {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}
.hd-swcss-col--meta .single_add_to_cart_button {
	display: block;
	width: 100%;
	max-width: none;
	box-sizing: border-box;
	margin-top: 1.25rem !important;
}

/* Remove horizontal padding/margin on the field rows (the .form-row <p>) so the
   inputs line up flush with the add-to-cart button. Overrides WooCommerce's
   `.woocommerce-js form .form-row` and any theme padding. */
.hd-swcss-fields .form-row,
.hd-swcss-fields .hd-swcss-row {
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.hd-swcss-row {
	display: block;
	margin-bottom: 1em;
}

.hd-swcss-row > label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25em;
	line-height: 1.4;
	hyphens: auto;
	-webkit-hyphens: auto;
	-ms-hyphens: auto;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* Tighten the theme's large line spacing on our labels and helper texts,
   and allow long headline words to hyphenate. */
.hd-swcss-fields .hd-swcss-row label,
.hd-swcss-fields .hd-swcss-hint,
.hd-swcss-fields .hd-swcss-selected,
.hd-swcss-fields .hd-swcss-selected__list li {
	line-height: 1.4 !important;
}
.hd-swcss-fields .hd-swcss-row label {
	hyphens: auto;
	-webkit-hyphens: auto;
	-ms-hyphens: auto;
	overflow-wrap: break-word;
}

.hd-swcss-fields .input-text,
.hd-swcss-fields select,
.hd-swcss-fields textarea {
	width: 100%;
	max-width: 28em;
}

.hd-swcss-hint {
	display: block;
	margin-top: 0.25em;
	font-size: 0.9em;
	color: #555;
}

.hd-swcss-fields .required {
	color: #b32d2e;
	text-decoration: none;
	border: 0;
}

/* Visually hidden, still available to screen readers. */
.hd-swcss-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Inline calendar: always visible, no overlay → no overlap with the summary. */
.hd-swcss-row--date .flatpickr-calendar.inline {
	margin: 0.5em 0 0;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.12 );
	/* A little breathing room between the calendar border and the days.
	   Flatpickr gives the calendar a fixed width; with the theme's
	   border-box the padding would eat into the day grid and clip the
	   last column, so let the padding extend the outer width instead. */
	box-sizing: content-box;
	padding: 0 0.75em 0.75em;
}

/* Selected-dates summary (also an aria-live region). */
.hd-swcss-fields .hd-swcss-selected {
	display: block;
	margin-top: 0.75em;
}

.hd-swcss-fields .hd-swcss-selected__heading {
	font-weight: 600;
}

.hd-swcss-fields .hd-swcss-selected__list {
	list-style: none;
	margin: 0.35em 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.hd-swcss-fields .hd-swcss-selected__list li {
	display: flex;
	align-items: center;
	gap: 0.5em;
	background: #f0f0f1;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 0.3em 0.4em 0.3em 0.6em;
	font-size: 0.85em;
	line-height: 1.3;
}

/* Date label: takes the available space, always on a single line. */
.hd-swcss-fields .hd-swcss-selected__date {
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Delete button — high specificity + !important so the theme's generic
   `button { width:100% }` (which collapsed the date) cannot win. */
.hd-swcss-fields .hd-swcss-selected__list li button.hd-swcss-selected__remove {
	flex: 0 0 auto !important;
	box-sizing: border-box !important;
	width: 1.9em !important;
	min-width: 1.9em !important;
	max-width: 1.9em !important;
	height: 1.9em !important;
	min-height: 1.9em !important;
	margin: 0 !important;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border: 1px solid #c0392b !important;
	border-radius: 4px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #c0392b !important;
	font-size: 1em !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	text-align: center !important;
	cursor: pointer !important;
	transform: none !important;
	overflow: hidden !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hd-swcss-fields .hd-swcss-selected__list li button.hd-swcss-selected__remove:hover,
.hd-swcss-fields .hd-swcss-selected__list li button.hd-swcss-selected__remove:focus {
	background: #c0392b !important;
	border-color: #c0392b !important;
	color: #fff !important;
	outline: 2px solid #2271b1 !important;
	outline-offset: 1px;
}

/* Kill theme/Element-Pack hover pseudo-elements (the pink sliding ellipse). */
.hd-swcss-fields .hd-swcss-selected__list li button.hd-swcss-selected__remove::before,
.hd-swcss-fields .hd-swcss-selected__list li button.hd-swcss-selected__remove::after {
	content: none !important;
	display: none !important;
}

/* Visible focus indicators (WCAG 2.4.7). */
.hd-swcss-fields .input-text:focus,
.hd-swcss-fields select:focus,
.hd-swcss-fields textarea:focus {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

.hd-swcss-qty {
	display: inline-block;
}

/* Preis/Termin auf Anfrage: das Card-CSS wird als Inline-Style im PHP
   ausgegeben (HD_SWCSS_Frontend::request_card_css) — die Site strippt
   ?ver=-Parameter, gecachte Stylesheets wuerden Updates verschlucken. */
/* Loop-Link (Shop/Kategorie) */
.hd-swcss-request__btn { text-decoration: none; }
