/**
 * Frontend-Styles für Libre Bite
 */

/* Standort-Modal */
.lbite-modal {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Checkout-Bereiche */
.lbite-checkout-selection,
.lbite-tip-selection {
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Produkt-Optionen */
.lbite-product-options label {
	transition: all 0.3s;
}

.lbite-product-options label:hover {
	background: #f9f9f9;
}

.lbite-product-options input[type="checkbox"] {
	margin-right: 8px;
}

/* Nährwerttabelle */
.lbite-nutritional-info {
	transition: all 0.3s;
}

.lbite-nutritional-info:hover {
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Allergene */
.lbite-allergens {
	animation: lbite-fade-in 0.3s ease-out;
}

@keyframes lbite-fade-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive */
@media screen and (max-width: 768px) {
	.lbite-modal-content {
		margin: 20px;
		padding: 20px;
		max-height: 90vh;
	}

	.lbite-tip-options {
		flex-direction: column;
	}

	.lbite-tip-option {
		min-width: 100%;
	}
}

/* Loading States */
.lbite-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
}

.lbite-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(0,0,0,0.1);
	border-top-color: #0073aa;
	border-radius: 50%;
	animation: lbite-spin 1s linear infinite;
}

@keyframes lbite-spin {
	to { transform: rotate(360deg); }
}

/* Tisch-Info-Box im Checkout */
.lbite-table-info-box {
	background: #e7f5ff;
	border: 1px solid #b3d7ff;
	padding: 15px;
	margin-bottom: 20px;
	border-radius: 4px;
	color: #004085;
}

.lbite-table-info-flex {
	display: flex;
	align-items: center;
}

.lbite-table-icon {
	margin-right: 10px;
	color: #0073aa;
}

/* Bestelltyp-Auswahl im Checkout */
.lbite-order-type-selector {
	margin: 20px 0;
	padding: 16px;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	background: #fafafa;
}

.lbite-order-type-selector h3 {
	margin: 0 0 12px;
	font-size: 15px;
}

.lbite-order-type-options {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.lbite-order-type-option {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	transition: border-color 0.15s, background 0.15s;
}

.lbite-order-type-option:has(input:checked) {
	border-color: currentColor;
	background: #fff;
}

.lbite-order-type-option input[type="radio"] {
	margin: 0;
}

.lbite-table-number-wrap {
	margin-top: 12px;
}

.lbite-table-number-wrap label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 14px;
}

.lbite-table-number-wrap .input-text {
	width: 100%;
	max-width: 280px;
}

/* Standort-Filterung im Shop */
#lbite-location-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #f8f8f8;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 10px 14px;
	margin-bottom: 20px;
	font-size: 0.88em;
	color: #555;
	flex-wrap: wrap;
}

.lbite-notice-text {
	flex: 1;
}

.lbite-filter-btn.button {
	white-space: nowrap;
	font-size: 0.85em !important;
	padding: 4px 12px !important;
	height: auto !important;
	line-height: 1.6 !important;
	flex-shrink: 0;
}

.lbite-location-picker {
	font-size: 0.9em;
	padding: 4px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
}

/* .lbite-unavailable dient nur noch als JS-Hook für den "Nur verfügbare Produkte
   anzeigen"-Toggle (siehe LocationFilter.toggle() in frontend.js) — keine passive
   Ausgrau-Optik mehr; der rote Verfügbarkeits-Badge übernimmt den Hinweis. */

.lbite-notice-change-location,
.lbite-notice-change-location:hover,
.lbite-notice-change-location:focus,
.lbite-notice-change-location:active,
.lbite-notice-change-location:visited {
	background: none;
	border: none;
	box-shadow: none;
	outline: none;
	text-shadow: none;
	padding: 0;
	margin-left: 8px;
	color: #555;
	text-decoration: underline;
	cursor: pointer;
	font-size: 1em;
	flex-shrink: 0;
}

.lbite-notice-change-location:hover,
.lbite-notice-change-location:focus {
	color: #222;
}

/* Produkt-Verfügbarkeits-Hinweis (Grid-Item & Einzelprodukt-Seite) */
/* display/width/flex/grid-column erzwingen eine eigene Zeile, unabhängig davon, ob das Theme
   den Shop-Loop-Eintrag als Flex- oder Grid-Container aufbaut (siehe frontend.js für Themes,
   die zusätzlich flex-wrap: nowrap verwenden). */
.lbite-availability {
	position: relative;
	margin-top: 6px;
	font-size: 13px;
	display: block;
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
	grid-column: 1 / -1;
	box-sizing: border-box;
	clear: both;
}

.lbite-availability--compact {
	margin-top: 4px;
	font-size: 11px;
}

.lbite-availability-toggle,
.lbite-availability-toggle:hover,
.lbite-availability-toggle:focus,
.lbite-availability-toggle:active,
.lbite-availability-toggle:visited {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: transparent;
	border: none;
	box-shadow: none;
	outline: none;
	text-shadow: none;
	padding: 0;
	margin: 0;
	color: #d63638;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.4;
}

.lbite-availability-toggle:hover,
.lbite-availability-toggle:focus {
	color: #a02324;
}

.lbite-availability-toggle .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.lbite-availability--compact .lbite-availability-toggle .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

/* Reine Inhaltsvorlage: wird nie inline angezeigt, sondern von ProductAvailability in
   frontend.js in das schwebende .lbite-availability-floating-popup kopiert. */
.lbite-availability-popup {
	display: none;
}

/* Schwebendes Popup: ein einzelnes wiederverwendetes Element als Kind von <body>, per JS
   (position: fixed + berechnete Koordinaten) neben dem jeweiligen Toggle-Button platziert.
   Dadurch bleibt die kompakte Darstellung wie zuvor erhalten, ohne dass Theme-Produktkarten
   mit overflow:hidden (z. B. für Hover-Zoom-Effekte) das Popup abschneiden können. */
.lbite-availability-floating-popup {
	display: none;
	position: fixed;
	z-index: 999999;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	padding: 6px 8px;
	min-width: 140px;
	max-width: 230px;
	height: auto;
	overflow: hidden;
	color: #333;
	box-sizing: border-box;
}

.lbite-availability-floating-popup.lbite-visible {
	display: block;
}

/* Selektoren unter .lbite-availability-floating-popup verschachtelt (höhere Spezifität), damit
   generische Theme-/WooCommerce-Tabellenstile (z. B. grosszügiges table/td-Padding) unser
   kompaktes Popup nicht aufblasen. */
.lbite-availability-floating-popup .lbite-availability-table {
	width: 100%;
	height: auto;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.85em;
	color: #333;
	margin: 0;
}

.lbite-availability-floating-popup .lbite-availability-table td {
	padding: 2px 3px;
	color: #333;
	white-space: normal;
	word-break: break-word;
	vertical-align: middle;
}

.lbite-availability-floating-popup .lbite-availability-table td:last-child {
	width: 18px;
	text-align: right;
	white-space: nowrap;
}

.lbite-availability-floating-popup .lbite-availability-yes,
.lbite-availability-floating-popup .lbite-availability-no {
	display: inline-block;
	font-size: 12px;
	width: 12px;
	height: 12px;
	line-height: 12px;
	vertical-align: middle;
}

.lbite-availability-yes {
	color: #10b981;
}

.lbite-availability-no {
	color: #d63638;
}

/* Darstellungsstil "text": reine Textzeile ohne Button/Popup, für Themes mit ungewöhnlichem
   Shop-Loop-Markup am robustesten. */
.lbite-availability-text {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #d63638;
	line-height: 1.4;
}

.lbite-availability-text .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.lbite-availability--compact .lbite-availability-text .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

/* Darstellungsstil "list": Standortliste immer sichtbar statt im Hover-/Klick-Popup. */
.lbite-availability-table--static {
	margin-top: 4px;
}

/* Item notes in checkout cart */
.lbite-item-note-wrap {
	margin-top: 4px;
}

.lbite-checkout-item-note {
	font-size: 13px;
	padding: 4px 8px;
	border: 1px solid #ddd;
	border-radius: 3px;
	width: 100%;
	max-width: 300px;
	box-sizing: border-box;
	background: #fafafa;
	color: #555;
}

