/**
 * Global card footer – unified action bar for list cards, Bootstrap card-footer, and form footers.
 * Reference: accounting/customers card footer (customer-card-actions).
 */

/* —— List / grid card action footer —— */
.motorica-card-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	padding: 0.85rem 1.15rem 1rem;
	border-top: 1px solid rgba(226, 232, 240, 0.85);
	margin-top: 0.5rem;
}

.motorica-card-actions .motorica-btn-save--sm {
	min-height: 2.25rem;
	padding: 0.35rem 1rem;
	font-size: 0.85rem;
}

/* Icon-only edit button (pushed right) */
.motorica-card-edit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--motorica-touch-min, 44px);
	min-height: 2.25rem;
	padding: 0.35rem 0.55rem;
	margin-left: auto;
	color: var(--motorica-secondary, #0d234b);
	background: transparent;
	border: 1px solid rgba(13, 35, 75, 0.24);
	border-radius: 0.5rem;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.motorica-card-edit-btn:hover,
.motorica-card-edit-btn:focus {
	background: #f8fafc;
	border-color: rgba(13, 35, 75, 0.42);
	transform: translateY(-1px);
}

/* —— Bootstrap card-footer override —— */
.card-footer.motorica-card-actions {
	background: #fff;
	border-top: 1px solid rgba(226, 232, 240, 0.85);
	margin-top: 0;
}

.card-footer.motorica-card-actions.motorica-form-actions {
	justify-content: center;
	gap: 0.65rem;
}

@media (min-width: 576px) {
	.card-footer.motorica-card-actions.motorica-form-actions {
		justify-content: flex-end;
	}
}

/* Bottom-sheet footer visual alignment */
.bottom-sheet-footer.motorica-card-actions {
	border-top: 1px solid rgba(226, 232, 240, 0.85);
	padding: 0.85rem 1.15rem calc(1rem + env(safe-area-inset-bottom, 0px));
	margin-top: 0;
}

/* Branded footer modifier (PHPStan, Log-Viewer, Profile, etc.) */
.motorica-card-actions--branded {
	border-top-color: rgba(255, 255, 255, 0.15);
}

.log-viewer-bottom-card .card-footer.motorica-card-actions.motorica-card-actions--branded {
	background: linear-gradient(90deg, #c41e3a 0%, #0d234b 100%);
	color: #fff;
}

/* —— Mobile —— */
@media (max-width: 575px) {
	.motorica-card-actions .motorica-btn-save--sm {
		flex: 1 1 100%;
	}

	.motorica-card-edit-btn {
		margin-left: 0;
	}
}
