/* Equipment Verleih – Frontend-Styles */

/* Sicherheitsnetz: verhindert horizontales Überlaufen auf schmalen Bildschirmen,
   unabhängig vom Theme (Padding/Border zählen zur angegebenen Breite dazu). */
.verleih-grid,
.verleih-grid *,
.verleih-einzelansicht,
.verleih-einzelansicht *,
.verleih-warenkorb-wrapper,
.verleih-warenkorb-wrapper *,
.verleih-anfrage-formular-bereich,
.verleih-anfrage-formular-bereich *,
.verleih-login-hinweis,
.verleih-login-hinweis *,
.verleih-card,
.verleih-card * {
	box-sizing: border-box;
	max-width: 100%;
}

.verleih-card__mehr {
	text-align: center;
	text-decoration: none;
	margin-top: auto;
}

.verleih-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin: 24px 0;
}

.verleih-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	background: #fff;
}

.verleih-card__bild img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 8px;
}

.verleih-card__galerie {
	display: flex;
	gap: 6px;
	margin-bottom: 12px;
	overflow-x: auto;
}

.verleih-galerie-thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: none;
}

.verleih-galerie-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.verleih-galerie-thumb.is-aktiv {
	border-color: #2271b1;
}

.verleih-card__titel {
	margin: 0 0 8px;
	font-size: 1.1em;
}

.verleih-card__beschreibung {
	font-size: 0.9em;
	color: #555;
	flex-grow: 1;
}

.verleih-card__preis {
	font-size: 1.1em;
	margin: 12px 0 4px;
}

.verleih-card__bestand {
	font-size: 0.85em;
	color: #777;
	margin: 0 0 12px;
}

.verleih-add-form__zeile {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.verleih-add-form__zeile label {
	display: flex;
	flex-direction: column;
	font-size: 0.8em;
	flex: 1 1 100px;
}

.verleih-add-form__zeile input {
	box-sizing: border-box;
	width: 100%;
	margin-top: 4px;
}

.verleih-add-form__menge {
	max-width: 80px;
}

.verleih-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--verleih-button-padding-v, 8px) var(--verleih-button-padding-h, 18px);
	border: 1px solid transparent;
	border-radius: var(--verleih-button-radius, 6px);
	cursor: pointer;
	font-size: var(--verleih-button-schriftgroesse, 14px);
	font-weight: var(--verleih-button-schriftgewicht, 600);
	line-height: 1;
	margin: var(--verleih-button-abstand, 0);
	transition: background 0.15s, border-color 0.15s;
	text-decoration: none;
	white-space: nowrap;
}

.verleih-btn--primary {
	background: var(--verleih-primaerfarbe, #2271b1);
	border-color: var(--verleih-primaerfarbe, #2271b1);
	color: var(--verleih-button-text-farbe, #fff);
}

.verleih-btn--primary:hover {
	background: var(--verleih-button-hover-farbe, #1a5a8c);
	border-color: var(--verleih-button-hover-farbe, #1a5a8c);
}

.verleih-btn--sekundaer {
	background: #fff;
	color: var(--verleih-primaerfarbe, #2271b1);
	border-color: #dcdfe3;
}

.verleih-btn--sekundaer:hover {
	background: #f5f6f8;
	border-color: var(--verleih-primaerfarbe, #2271b1);
}

.verleih-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.verleih-add-form__status {
	display: block;
	margin-top: 6px;
	font-size: 0.85em;
}

.verleih-add-form__status--ok { color: #2a7d2a; }
.verleih-add-form__status--fehler { color: #b32d2e; }

/* Warenkorb */
.verleih-warenkorb-tabelle {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 16px 0;
	background: #fff;
	border: 1px solid #eceef0;
	border-radius: 10px;
	overflow: hidden;
	font-size: 0.95em;
}

.verleih-warenkorb-tabelle th {
	padding: 12px 16px;
	text-align: left;
	background: #f9fafb;
	color: #6b7280;
	font-size: 0.78em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-bottom: 1px solid #eceef0;
}

.verleih-warenkorb-tabelle td {
	padding: 14px 16px;
	border-bottom: 1px solid #f0f1f3;
	vertical-align: middle;
	color: #1f2937;
}

.verleih-warenkorb-tabelle tbody tr:last-child td {
	border-bottom: none;
}

.verleih-warenkorb-tabelle tbody tr:hover {
	background: #fafbfc;
}

.verleih-warenkorb-bild {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
	margin-right: 10px;
	vertical-align: middle;
}

.verleih-warenkorb-menge {
	box-sizing: border-box;
	width: 56px;
}

.verleih-warenkorb-entfernen {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: none;
	border: none;
	border-radius: 50%;
	color: #9ca3af;
	font-size: 1em;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.verleih-warenkorb-entfernen:hover {
	background: #fdeaea;
	color: #b32d2e;
}

.verleih-warenkorb-tabelle tfoot td {
	border-bottom: none;
	background: #f9fafb;
	padding: 16px;
}

.verleih-warenkorb-gesamt-label,
.verleih-warenkorb-gesamt-wert {
	text-align: right;
	font-size: 1.05em;
}

.verleih-warenkorb-gesamt-label {
	color: #6b7280;
	font-weight: 600;
}

.verleih-warenkorb-gesamt-wert strong {
	font-size: 1.15em;
	color: #1f2937;
}

.verleih-warenkorb-zwischensumme td,
.verleih-warenkorb-mwst-zeile td {
	font-size: 0.9em;
	font-weight: 400;
	color: #6b7280;
	padding-top: 8px;
	padding-bottom: 8px;
}

.verleih-warenkorb-hinweis {
	font-size: 0.85em;
	color: #9ca3af;
	margin-top: 10px;
}

.verleih-warenkorb-leer {
	padding: 24px;
	background: #f9fafb;
	border: 1px solid #eceef0;
	border-radius: 10px;
	color: #6b7280;
	text-align: center;
}

/* Anfrage-Formular */
.verleih-anfrage-formular .verleih-input {
	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
}

/* Gemeinsames Design für alle Formularfelder (Backend-konfigurierbar).
   !important + doppelte Klasse, damit sich das gegen Theme-eigene Regeln
   wie z. B. "input[type='text'], input[type='email'] { ... }" durchsetzt,
   die oft gezielt einzelne input-Typen (aber kein textarea) überschreiben. */
.verleih-feld.verleih-feld {
	background: var(--verleih-feld-hintergrund, #fff) !important;
	border: 1px solid var(--verleih-feld-rahmenfarbe, #ccc) !important;
	border-radius: var(--verleih-feld-radius, 4px) !important;
	padding: var(--verleih-feld-padding-v, 8px) var(--verleih-feld-padding-h, 10px) !important;
	font-size: var(--verleih-feld-schriftgroesse, 14px) !important;
	font-family: inherit;
	box-sizing: border-box;
}

.verleih-feld.verleih-feld:focus {
	outline: none;
	border-color: var(--verleih-feld-fokusfarbe, var(--verleih-primaerfarbe, #2271b1)) !important;
}

.verleih-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
}

.verleih-erfolg {
	padding: 16px;
	background: #e7f7e7;
	border: 1px solid #2a7d2a;
	border-radius: 6px;
	color: #1f5c1f;
}

.verleih-login-hinweis {
	padding: 24px;
	background: #f9fafb;
	border: 1px solid #eceef0;
	border-radius: 10px;
	text-align: center;
}

.verleih-login-hinweis p {
	margin: 0 0 16px;
	color: #4b5563;
	font-size: 1.02em;
}

.verleih-login-hinweis__aktionen {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
}

.verleih-login-hinweis__oder {
	color: #9ca3af;
	font-size: 0.85em;
}

.verleih-fehler {
	padding: 16px;
	background: #fdeaea;
	border: 1px solid #b32d2e;
	border-radius: 6px;
	color: #7d1f20;
	margin-bottom: 16px;
}

/* Equipment-Einzelansicht */
.verleih-einzelansicht__galerie {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
}

.verleih-einzelansicht__galerie img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 6px;
}

.verleih-einzelansicht__beschreibung {
	margin-bottom: 16px;
}

.verleih-einzelansicht__preis {
	font-size: 1.3em;
	margin-bottom: 4px;
}

.verleih-einzelansicht__kaution {
	font-size: 0.6em;
	color: #777;
	margin-left: 6px;
}

.verleih-einzelansicht__bestand {
	color: #777;
	margin-top: 0;
}

.verleih-warenkorb-link {
	margin-top: 10px;
}

.verleih-warenkorb-link a {
	color: var(--verleih-primaerfarbe, #2271b1);
	text-decoration: underline;
	font-size: 0.95em;
}

/* Warenkorb-Icon mit Anzahl-Badge (z. B. für Header/Menü) */
.verleih-warenkorb-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	line-height: 0;
}

.verleih-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--verleih-primaerfarbe, #2271b1);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
}

.verleih-mwst-hinweis {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 8px;
	border-radius: 999px;
	background: #eef1f4;
	color: #6b7280;
	font-size: 0.7em;
	font-weight: 500;
	vertical-align: middle;
}

/* Admin-Status-Badges */
.verleih-status {
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.85em;
	color: #fff;
	background: #999;
}
.verleih-status--neu { background: #2271b1; }
.verleih-status--bestaetigt { background: #2a7d2a; }
.verleih-status--abgelehnt { background: #b32d2e; }
.verleih-status--storniert { background: #777; }

@media (max-width: 600px) {
	.verleih-warenkorb-tabelle thead { display: none; }
	.verleih-warenkorb-tabelle tr {
		display: block;
		margin-bottom: 12px;
		border-bottom: 2px solid #ddd;
	}
	.verleih-warenkorb-tabelle td {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;
		gap: 6px;
		border-bottom: none;
	}
	.verleih-warenkorb-tabelle td::before {
		content: attr(data-label);
		font-weight: bold;
		margin-right: 8px;
		flex: 0 0 auto;
	}
	.verleih-warenkorb-wert {
		display: flex;
		align-items: center;
		gap: 6px;
		flex: 1 1 auto;
		justify-content: flex-end;
		text-align: right;
	}
}

/* Allgemeine Anpassungen für Smartphones */
@media (max-width: 480px) {
	.verleih-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	/* Buttons: Text darf umbrechen statt die Seite horizontal zu sprengen
	   (relevant bei längeren, im Backend frei einstellbaren Button-Texten). */
	.verleih-btn {
		white-space: normal;
		text-align: center;
	}

	/* Haupt-Handlungs-Buttons auf Mobile über die volle Breite, leichter zu treffen. */
	.verleih-anfrage-formular button[type="submit"],
	.verleih-add-form button[type="submit"] {
		width: 100%;
	}

	/* Login/Registrieren untereinander statt eng nebeneinander. */
	.verleih-login-hinweis__aktionen {
		flex-direction: column;
		align-items: stretch;
	}

	.verleih-login-hinweis__aktionen .verleih-btn {
		width: 100%;
	}

	.verleih-login-hinweis__oder {
		margin: 2px 0;
	}

	/* Datumsfelder und Menge im Formular untereinander statt gequetscht nebeneinander. */
	.verleih-add-form__zeile {
		flex-direction: column;
	}

	.verleih-add-form__zeile label {
		flex: 1 1 auto;
	}

	.verleih-add-form__menge {
		max-width: 100%;
	}

	.verleih-einzelansicht__galerie {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}

	.verleih-einzelansicht__preis {
		font-size: 1.15em;
	}

	.verleih-card__bild img {
		height: 160px;
	}
}
